I am setting up my Kubernetes
cluster using kubectl -k
(kustomize). Like any other such arrangement, I depend on some secrets during deployment. The route I want go is to use the secretGenerator
feature of kustomize
to fetch my secrets from files or environment variables.
However managing said files or environment variables in a secure and portable manner has shown itself to be a challenge. Especially since I have 3 separate namespaces for test, stage and production, each requiring a different set of secrets.
So I thought surely there must be a way for me to manage the secrets in my cloud provider's official way (google cloud platform - secret manager).
So how would the secretGenerator
that accesses secrets stored in the secret manager look like?
My naive guess would be something like this:
secretGenerator:
- name: juicy-environment-config
google-secret-resource-id: projects/133713371337/secrets/juicy-test-secret/versions/1
type: some-google-specific-type
- Is this at all possible?
- What would the example look like?
- Where is this documented?
- If this is not possible, what are my alternatives?