Is it possible write write an existing environment variable into a file from a Kubernetes deployment.yaml file?
The background: I've already parsed a json containing secrets. Now, I'd like to store that secret in a local file.
So far, I've tried something like this:
lifecycle:
postStart:
exec:
command: ["/bin/sh", "-c"],
args: ["echo $PRIVATE_KEY > /var/private.key"]
( I've setup /var/ as an empty writeVolume. )
Or perhaps there is a completely different way to do this, such as storing the secret in it's own, separate secret?