问题
I have 2 secrets i.e. production and staging. I want to dynamically load this secret in deployment file using the environment variable being set in same file
env:
- name: NODE_ENV
value: "production"
- name: general-secret
secret:
secretName: general-production-secret
I want to load environment specific secrets like using
secretName: general-{{env. NODE_ENV}}-secret
Is it possible?
回答1:
As far as I know, this is not possible unless you have Helm chart for your applications, then you can make this possible
this is a solution in helm chart close to what you need Dynamically accessing values depending on variable values in a Helm chart
来源:https://stackoverflow.com/questions/61482060/generate-dynamic-secret-name-inside-kubernetes-deployment-file