Define environment variables with `env`.
Section: Pods and Containers
Set explicit environment variables
yaml
yaml
env:
- name: APP_ENV
value: production
- name: LOG_LEVEL
value: infoExplanation
Use `env` for individual variables; use `envFrom` when importing all keys from a ConfigMap or Secret.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Pods and Containers
Override container command and args
Set entrypoint-style command in YAML.
Load env from ConfigMap and Secret
Import environment values into a container.
Expose named container ports
Name ports for Service targeting and probes.