Kubernetes Under the Hood: What Actually Happens When You Run kubectl apply
Scored daily by a customisable AI persona to surface the most relevant engineering leadership news.
Deep dive into Kubernetes internals with admission webhooks, etcd Raft, and controller reconciliation, highly actionable and directly relevant to cloud infrastructure.
When you run `kubectl apply`, you are not issuing an imperative command but recording a desired state in etcd, triggering a cascade of autonomous control loops. The client computes a 3-way strategic merge patch using local YAML, live cluster state, and the last-applied annotation to avoid overwriting concurrent changes like HPA scaling. The API server runs the payload through authentication, mutating webhooks, schema validation, and validating webhooks before the Deployment Controller, scheduler, and kubelet independently reconcile toward the declared intent.