How to set dynamic values with Kubernetes yaml file

You can also use envsubst when deploying.

e.g.

cat app/deployment.yaml | envsubst | kubectl apply ...

It will replace all variables in the file with their values.
We are successfully using this approach on our CI when deploying to multiple environments, also to inject the CI_TAG etc into the deployments.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)