til/content/posts/kubectl-replace.md

185 KiB

title date draft tags images
kubectl replace 2020-09-25 false
kubernetes
kubectl
https://opengraph.cluster.fun/opengraph/?siteTitle=Today%20I%20learnt...&title=kubectl%20replace&tags=kubernetes%2Ckubectl&image=https%3A%2F%2Fmarcusnoble.co.uk%2Fimages%2Fmarcus.jpg&twitter=Marcus_Noble_&github=AverageMarcus&website=www.MarcusNoble.co.uk

After working with Kubernetes for a few years now I've only just today learnt about kubectl replace which, you guessed it, completely replaces a resource.

I've always used kubectl apply to update existing resources (or create new ones) which does a merge between the existing and the supplied manifest.

Hat tip to @vdemeest for this: