Kubernetes Workloads Cheat Sheet/Set environment variable

Set or update environment variables.

Section: Deployments

Set environment variable

bash
bash
kubectl set env deployment/web APP_ENV=production -n payments
Explanation

Set or update environment variables.

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 Deployments
List deployments
Show deployments across namespaces.
OpenIn sheetbashsame section
Describe deployment
Inspect rollout state, replicas, and events.
OpenIn sheetbashsame section
Update deployment image
Roll out a new container image.
OpenIn sheetbashsame section
Set deployment resources
Update requests and limits from the CLI.
OpenIn sheetbashsame section
Watch rollout status
Block until the rollout finishes or fails.
OpenIn sheetbashsame section
Show rollout history
List deployment revisions.
OpenIn sheetbashsame section