Replace a live object
high risk
kubectl diff -f <file>Diff firstkubectl apply -f <file>Prefer applyReplaces an object from a file. See the flags and examples below, and run `man kubectl` for the full reference.
| Flag | Meaning |
|---|---|
--force --force | Delete and recreate⚠ Causes downtime. |
kubectl replace -f deploy.yamlReplace · explain & risk-check →Reference text is hand-written and may be incomplete — check man kubectl for your version. Test destructive commands on a non-production system first.