kubectl replace

Replace a live object

high risk

interactive breakdown — edit the command and press Explain
$ 
⚠ Risks & cautions
Safer / dry-run alternatives
kubectl diff -f <file>Diff first
kubectl apply -f <file>Prefer apply
What it does

Replaces an object from a file. See the flags and examples below, and run `man kubectl` for the full reference.

Common flags
FlagMeaning
--force --forceDelete and recreate⚠ Causes downtime.
Examples
kubectl replace -f deploy.yamlReplace · explain & risk-check →
Related
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.