12factor on davidchua https://dchua.com/tags/12factor/ Recent content in 12factor on davidchua Hugo -- gohugo.io en-us Fri, 21 Apr 2017 00:00:00 +0000 Load env variables from ConfigMaps and Secrets upon Pod boot https://dchua.com/posts/2017-04-21-load-env-variables-from-configmaps-and-secrets-upon-pod-boot/ Fri, 21 Apr 2017 00:00:00 +0000 https://dchua.com/posts/2017-04-21-load-env-variables-from-configmaps-and-secrets-upon-pod-boot/ One of the coolest stuff I’ve picked up just today is that you can keep environment variables that you want to be loaded into every deployment pod in a neatly configured ConfigMap or Secret which gets injected back into the Pod during deploys. Lets say you have a Secret that looks like: apiVersion: v1 kind: Secret metadata: name: mysecret type: Opaque data: username: YWRtaW4= password: MWYyZDFlMmU2N2Rm And you want username and password to be easily accessible in ENV['username'] and ENV['password'] on your application pods, all you need is a envFrom within your TemplateSpec