kubectl apply, and The Dark Art of Declarative Object Management
summary
kubectl apply computes a three-way diff (local, live, last-applied-configuration) and stores the last-applied blob as an annotation to decide adds/updates/deletes, using json merge patch or Kubernetes’ strategic-merge-patch with per-field patchMergeKeys. Containers merge by name, tolerations often get replaced, and API defaulting (replicas, updateStrategy) can cause incompatible-update errors unless defaults are explicitly managed. Features covered: apply prune, override/conflict detection, and editing last-applied to recover; recommended: keep replicas out of manifests and use a single source of truth.
AI-written summary · about
chapters (8)
- 0:00Intro
- 0:29Why "the dark art"?
- 4:24Example of adding a field
- 8:50Let's talk about merge calculations
- 14:33Strategic Merge Patch
- 22:01Aaron's brief list of recommendations
- 23:46Things we didn't get to cover
- 26:21Homework...
related talks
07mKustomize: Manage K8S manifests natively
11m⚡ Lightning Talk: The Merge Conflict - Conflict: Apply-Before-Merge vs. Traditional Continuous Deployment
28mWhat the Diff?
41mKustomizing Auto DevOps - an Extensible Deploy Stage
31mTouch Base: How I Broke Business Applications Deployment
16mKustomize Your Operator
34mKustomize: Template-Free Configuration Customization for Kubernetes
29mHow to Preview and Diff Your Argo CD Deployments
