You can pass environment variables to your arguments by using parentheses ()
instead of braces {}
envFrom:
- secretRef:
name: secret
command: ["my-command"]
args:
- "--env=ENV1=$(MY_ENV_VAR1)"
- "--env=env2=$(MY_ENV_VAR2)"
Kubernetes docs have an example here for reference: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#use-environment-variables-to-define-arguments