kubectl patch

Patch a live object

high risk

interactive breakdown — edit the command and press Explain
$ 
⚠ Risks & cautions
Safer / dry-run alternatives
kubectl patch <res> -p '<patch>' --dry-run=server -o yamlPreview the result
What it does

Strategic-merge, merge or JSON patches. See the flags and examples below, and run `man kubectl` for the full reference.

Common flags
FlagMeaning
-pPatch body
--type --typemerge | json | strategic
--dry-run=server --dry-run=serverSimulate
Examples
kubectl patch deploy web -p '{"spec":{"replicas":3}}'Set replicas · explain & risk-check →
Related
kubectl edit kubectl apply
Open the full explainer →More in Kubernetes & Helm

Reference text is hand-written and may be incomplete — check man kubectl for your version. Test destructive commands on a non-production system first.