kubectl edit

Edit a live object

high risk

interactive breakdown — edit the command and press Explain
$ 
⚠ Risks & cautions
Safer / dry-run alternatives
kubectl get deploy/<name> -o yaml > backup.yamlBack up first
kubectl diff -f <manifest>Change via a reviewed manifest instead
What it does

Opens the live object in $EDITOR. See the flags and examples below, and run `man kubectl` for the full reference.

Examples
kubectl edit deploy/web -n prodEdit a deployment · explain & risk-check →
Related
kubectl apply kubectl patch
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.