EKS K8s secret cannot be created from volume mount with secret store csi driver #444
Replies: 10 comments
-
Exactly the same issue here. Seems secretproviderclass is not creating the secret when mounting volume. |
Beta Was this translation helpful? Give feedback.
-
Experiencing the same exact issue - can successfully see mounted secrets within the pod but kubernetes secret object not being created when mounting volume for a env var. pod is stuck in creation. |
Beta Was this translation helpful? Give feedback.
-
Experiencing the same exact issue |
Beta Was this translation helpful? Give feedback.
-
Just in case it works for someone. I fixed it by enabling syncsecret on helm instantiation.
|
Beta Was this translation helpful? Give feedback.
-
I just upgraded my helm install with the following:
Even with this change the secret is still not being created from the volume mount, maybe I'm missing something. |
Beta Was this translation helpful? Give feedback.
-
@flaviops I had the same issue and setting
Have you looked at the events to see if maybe you're running into the same issue? |
Beta Was this translation helpful? Give feedback.
-
I noticed that the ClusterRole is missing permissions to get/create/patch secrets Add the following permissions to your ClusterRole
Also, the secret name has to be referenced somewhere in your Pod spec (in |
Beta Was this translation helpful? Give feedback.
-
It was a similar problem, thanks for the help |
Beta Was this translation helpful? Give feedback.
-
It worked for me. --set syncSecret.enabled=true . However, it only works when a pod mounts a volume using the SecretProviderClass by name. I would prefer it to create the secret independently. |
Beta Was this translation helpful? Give feedback.
-
If you check the secret-store-csi-driver Helm chart, you can see that if you set the syncSecret.enabled=true then a separate ClusterRole and ClusterRoleBinding will be created with the proper permissions to access k8s secrets: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to pass the aws secrets manager secret as an environment variable to the eks container. However even after correctly volume mounted the secret, the kubernetes secret could not be created from the volume mount.
I am using the roles and service account mentioned in the document.
To Reproduce
Here is my secretprovider class:
My deployment manifest section where I am passing the secret as an Environment variable:
However the Pod goes to CreateContainerConfigError state and the following error was encountered:
Expected behavior
The secret should be created and passed as an environment variable to the kubernetes container.
Additional context
As mentioned in the description above I can though retrieve the secret in the volume mounted:
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions