Kubernetes Under the Hood: What Actually Happens When You Run kubectl apply
A visual, 10-minute deep dive into Kubernetes control plane internals. Learn how kube-apiserver processes admission webhooks, how etcd maintains Raft quorum, how controllers reconcile state with Informers, how kube-scheduler scores nodes, and what the Kubelet pause container actually does.
First seen by Oriel on .
AI summary
This article traces kubectl apply through client-side patching, API admission, etcd persistence, controller reconciliation, scheduling, and eventual kubelet-driven container startup.
- kubectl compares local YAML, live state, and the last-applied annotation to create a 3-way strategic merge patch, preserving independently changed fields such as HPA-managed replicas.
- kube-apiserver authenticates and authorizes requests, runs mutating and validating webhooks, validates schemas, and persists accepted objects in etcd before containers start.
- etcd uses Raft quorum commits, while resourceVersion enables optimistic concurrency and Watch streams deliver changes without continuous polling.
- Deployment and ReplicaSet controllers create unassigned Pods, after which kube-scheduler filters and scores nodes before the kubelet directs CRI and CNI setup.
#kubernetes #kubectl #etcd #container orchestration
Generated by gpt-5.6-sol. Check the original for details.
Metric trends
Last 30 days · Up to 120 recorded samples per source and metric, with reposts kept separate · First and latest retained
Reactions
Total public reactions reported by the source; distinct from points and likes.
- DEV Community: 25, latest observation ; +14 over observed period since
Comments
Comment count reported by the source.
- DEV Community: 2, latest observation ; +2 over observed period since
Aliases
| Source | External ID | URL |
|---|---|---|
| DEV Community | 4828114 | https://dev.to/smtahosin/kubernetes-under-the-hood-what-actually-happens-when-you-run-kubectl-apply-5cog Read discussion |