If trying to pass a startup command with env substitution to the command
/args
fields in a kubernetes yml
file,
don't try to use substituition in the arguments as you normally would - that will be parsed differently. Instead,
make your life easier by using /bin/sh -c
like in this example:
command: ["/bin/sh"]
args: ["-c", "pg_dump -v -U ${DATABASE_USER} -h ${DATABASE_HOST} ${DATABASE_NAME} > /db-backup/$(date +'%Y-%m-%d_%H-%M-%S')_${DATABASE_NAME}.backup.sql"]