-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
This is a feature request/enhancement
This is for clusters running in GKE.
When defining a SecretStore that uses the gcpsm (Google Secret Manager) provider, you are required to define "clusterLocation", "clusterName" and "clusterProjectID" when setting up workloadIdentity authentication.
Exampoe:
spec:
provider:
gcpsm:
auth:
workloadIdentity:
clusterLocation: <CLUSTER REGION>
clusterName: <CLUSTER NAME>
clusterProjectID: <CLUSTER PROJECT ID>
If your cluster has many workspaces or just a lot of SecretStores this ends up being a lot of duplicate configuration to maintain and also makes the configuration a tad more complex that what it needs to be.
So my request would be for the following enhancement.
Make these three values auto detected. The google metadata service is available to all pods by default in a GKE cluster. So if the external-secret operator detected (or was told) it was running in GKE then it could just query these values from the metadata REST endpoint and use them in the SecretStore configuration unless they were manually defined (ie. overridden) in the SecretStore object.
Metadata Service documentation: https://cloud.google.com/kubernetes-engine/docs/concepts/workload-identity#instance_metadata
Example REST calls from inside of a pod running in GKE which will return the above values:
curl http://metadata.google.internal/computeMetadata/v1/instance/attributes/cluster-location -H "Metadata-Flavor: Google"
us-east1
curl http://metadata.google.internal/computeMetadata/v1/instance/attributes/cluster-name -H "Metadata-Flavor: Google"
mycoolcluster
curl http://metadata.google.internal/computeMetadata/v1/project/project-id -H "Metadata-Flavor: Google
myawesomeproject