envsubst 1/2

envsubst 1/2

Poor man’s templating

export PASSWORD="$(pass myapp/password)"
envsubst < manifest.yaml | kubectl apply -f -

envsubst is not a real templating engine


envsubst 2/2

Pitfalls

All variables are replaced (${foo} and $foo)

Preserving some variables is ugly:

export PASSWORD="$(pass myapp/password)"
envsubst '$PASSWORD' < manifest.yaml | kubectl apply -f -


Friends don’t let friends use envsubst
for templating

Unknown