Google Secret Manager provider for the Secret Store CSI Driver.
Go
266
249 commits
updated Sep 22, 2026
Google Secret Manager provider for the Secret Store CSI Driver. Allows you to access secrets stored in Secret Manager as files mounted in Kubernetes pods.
kubectl apply -f deploy/provider-gcp-plugin.yaml
# if you want to use helm
# helm upgrade --install secrets-store-csi-driver-provider-gcp charts/secrets-store-csi-driver-provider-gcp
NOTE: The driver's rotation and secret syncing functionality is still in Alpha and requires additional installation steps.
The provider will use the workload identity of the pod that a secret is mounted onto when authenticating to the Google Secret Manager API. For this to work the workload identity of the pod must be configured and appropriate IAM bindings must be applied.
$ export PROJECT_ID=<your gcp project>
$ gcloud config set project $PROJECT_ID
$ export PROJECT_NUMBER="$(gcloud projects describe "${PROJECT_ID}" --format='value(projectNumber)')"
# Create a secret with 1 active version
$ echo "foo" > secret.data
$ gcloud secrets create testsecret --replication-policy=automatic --data-file=secret.data
$ rm secret.data
# grant the new service account permission to access the secret
$ gcloud secrets add-iam-policy-binding testsecret \
--role=roles/secretmanager.secretAccessor \
--member=principal://iam.googleapis.com/projects/${PROJECT_NUMBER}/locations/global/workloadIdentityPools/${PROJECT_ID}.svc.id.goog/subject/ns/default/sa/mypodserviceaccount
Note: Regional secrets are also supported from v1.6.0, Please see Regional Secret Documentation.
Try it out the example which attempts to mount the secret "test" in $PROJECT_ID to /var/secrets/good1.txt and /var/secrets/good2.txt
$ ./scripts/example.sh
$ kubectl exec -it mypod /bin/bash
root@mypod:/# ls /var/secrets
From version 1.9.0, secrets-store-csi-driver-provider-gcp also supports mounting the parameter version from Google Parameter Version
Parameter Manager is an extension to the Secret Manager service and provides a centralized storage for all configuration parameters related to your workload deployments.
$ export PROJECT_ID=<your gcp project>
$ gcloud config set project $PROJECT_ID
$ export PROJECT_NUMBER="$(gcloud projects describe "${PROJECT_ID}" --format='value(projectNumber)')"
# set the location
$ export LOCATION_ID=<location>
$ gcloud config set api_endpoint_overrides/parametermanager https://parametermanager.${LOCATION_ID}.rep.googleapis.com/
$ echo "server_port: 8080" > parameter.data
$ gcloud parametermanager parameters create testparameter --location ${LOCATION_ID} --parameter-format=YAML --project ${PROJECT_ID}
$ gcloud parametermanager parameters versions create testversion --parameter=testparameter --location=${LOCATION_ID} --payload-data-from-file=parameter.data
$ rm parameter.data
# grant the new service account permission to access the secret
$ gcloud projects add-iam-policy-binding ${PROJECT_ID} \
--role=roles/parametermanager.parameterAccessor \
--member=principal://iam.googleapis.com/projects/${PROJECT_NUMBER}/locations/global/workloadIdentityPools/${PROJECT_ID}.svc.id.goog/subject/ns/default/sa/mypodserviceaccount
$ ./scripts/pm_example.sh
# wait for pod to be in running state
$ kubectl exec -it mypod -- cat /var/secrets/good1.txt
This plugin is built to ensure compatibility between Secret Manager and Kubernetes workloads that need to load secrets from the filesystem. It also enables syncing of those secrets to Kubernetes-native secrets for consumption as environment variables.
When evaluating this plugin consider the following threats:
For these reasons, when possible we recommend using the Secret Manager API directly (using one of the provided client libraries, or by following the REST or GRPC documentation).
Please see the contributing guidelines.
This is not an officially supported Google product.
For support please search open issues here, and if your issue isn't already represented please open a new one. Pull requests and issues will be triaged weekly.
We close issues after 30 days if there's been no response or action taken.
Overall
Maintained
Code review
Latest release
Releases this year
137 followers · starred Mar 2021
1,032 followers · starred Jun 2020
157 followers · starred Jun 2020
130 followers · starred Sep 2026
Google Secret Manager provider for the Secret Store CSI Driver.
Go
266
249 commits
updated Sep 22, 2026
Google Secret Manager provider for the Secret Store CSI Driver. Allows you to access secrets stored in Secret Manager as files mounted in Kubernetes pods.
kubectl apply -f deploy/provider-gcp-plugin.yaml
# if you want to use helm
# helm upgrade --install secrets-store-csi-driver-provider-gcp charts/secrets-store-csi-driver-provider-gcp
NOTE: The driver's rotation and secret syncing functionality is still in Alpha and requires additional installation steps.
The provider will use the workload identity of the pod that a secret is mounted onto when authenticating to the Google Secret Manager API. For this to work the workload identity of the pod must be configured and appropriate IAM bindings must be applied.
$ export PROJECT_ID=<your gcp project>
$ gcloud config set project $PROJECT_ID
$ export PROJECT_NUMBER="$(gcloud projects describe "${PROJECT_ID}" --format='value(projectNumber)')"
# Create a secret with 1 active version
$ echo "foo" > secret.data
$ gcloud secrets create testsecret --replication-policy=automatic --data-file=secret.data
$ rm secret.data
# grant the new service account permission to access the secret
$ gcloud secrets add-iam-policy-binding testsecret \
--role=roles/secretmanager.secretAccessor \
--member=principal://iam.googleapis.com/projects/${PROJECT_NUMBER}/locations/global/workloadIdentityPools/${PROJECT_ID}.svc.id.goog/subject/ns/default/sa/mypodserviceaccount
Note: Regional secrets are also supported from v1.6.0, Please see Regional Secret Documentation.
Try it out the example which attempts to mount the secret "test" in $PROJECT_ID to /var/secrets/good1.txt and /var/secrets/good2.txt
$ ./scripts/example.sh
$ kubectl exec -it mypod /bin/bash
root@mypod:/# ls /var/secrets
From version 1.9.0, secrets-store-csi-driver-provider-gcp also supports mounting the parameter version from Google Parameter Version
Parameter Manager is an extension to the Secret Manager service and provides a centralized storage for all configuration parameters related to your workload deployments.
$ export PROJECT_ID=<your gcp project>
$ gcloud config set project $PROJECT_ID
$ export PROJECT_NUMBER="$(gcloud projects describe "${PROJECT_ID}" --format='value(projectNumber)')"
# set the location
$ export LOCATION_ID=<location>
$ gcloud config set api_endpoint_overrides/parametermanager https://parametermanager.${LOCATION_ID}.rep.googleapis.com/
$ echo "server_port: 8080" > parameter.data
$ gcloud parametermanager parameters create testparameter --location ${LOCATION_ID} --parameter-format=YAML --project ${PROJECT_ID}
$ gcloud parametermanager parameters versions create testversion --parameter=testparameter --location=${LOCATION_ID} --payload-data-from-file=parameter.data
$ rm parameter.data
# grant the new service account permission to access the secret
$ gcloud projects add-iam-policy-binding ${PROJECT_ID} \
--role=roles/parametermanager.parameterAccessor \
--member=principal://iam.googleapis.com/projects/${PROJECT_NUMBER}/locations/global/workloadIdentityPools/${PROJECT_ID}.svc.id.goog/subject/ns/default/sa/mypodserviceaccount
$ ./scripts/pm_example.sh
# wait for pod to be in running state
$ kubectl exec -it mypod -- cat /var/secrets/good1.txt
This plugin is built to ensure compatibility between Secret Manager and Kubernetes workloads that need to load secrets from the filesystem. It also enables syncing of those secrets to Kubernetes-native secrets for consumption as environment variables.
When evaluating this plugin consider the following threats:
For these reasons, when possible we recommend using the Secret Manager API directly (using one of the provided client libraries, or by following the REST or GRPC documentation).
Please see the contributing guidelines.
This is not an officially supported Google product.
For support please search open issues here, and if your issue isn't already represented please open a new one. Pull requests and issues will be triaged weekly.
We close issues after 30 days if there's been no response or action taken.
Overall
Maintained
Code review
Latest release
Releases this year
137 followers · starred Mar 2021
1,032 followers · starred Jun 2020
157 followers · starred Jun 2020
130 followers · starred Sep 2026