How to dynamically set yaml settings by pod name

6/20/2019

I am trying to set terminationMessagePath dynamically to the name of the pod so that the file will not be overwritten on each termination. Is it possible to inject environment variables in yaml settings on startup of pods?

I have tried setting the YAML as /approot/log/termination-log_${HOSTNAME} and /approot/log/termination-log_$HOSTNAME but have not found a way to set this path dynamically.

-- Nick Anderson
kubernetes
openshift-origin

0 Answers