kubectl patch deploy/web -p '{"spec":{"replicas":5}}'

Category: Kubernetes & Containers

kubectl patch deploy/web -p '{"spec":{"replicas":5}}'

Patch a deployment's replicas

Applies a surgical JSON patch to the live deployment, here scaling replicas to 5 without editing the whole object. Patches are ideal for single-field changes in scripts. Related: kubectl edit deploy/web for interactive edits.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.