What Actually Happens When You Run kubectl run nginx
When you run 'kubectl run nginx --image nginx', a series of orchestrated steps occur across the Kubernetes control plane: kubectl constructs a minimal Pod spec, authenticates and sends it to the API server, which processes it through admission, validation, and storage via etcd; the scheduler then assigns the pod to a node, and the kubelet starts the container using the container runtime. The entire process involves client-side parsing, secure communication, policy enforcement, and distributed consensus. Though the pod appears created quickly, multiple subsystems coordinate to bring it to a running state. This sequence spans client, API server, scheduler, and node components, reflecting the platform's layered architecture.
- ▪kubectl parses the command, reads kubeconfig, and sends a minimal Pod object to the API server over TLS-secured HTTP/2.
- ▪The API server authenticates, authorizes, and applies mutating and validating admission logic before persisting the pod to etcd via Raft consensus.
- ▪The scheduler selects a node using filter and scoring plugins, then binds the pod, which triggers the kubelet to create the pod sandbox and container via CRI.
- ▪The kubelet uses the container runtime (e.g., containerd) to pull the image, set up the network via CNI, and start the container using runc with security constraints.
- ▪Each phase involves precise system calls, API interactions, and configuration defaults, with full fidelity to Kubernetes 1.36 behavior and component ordering.
Opening excerpt (first ~120 words) tap to expand
try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 225861) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } saiyam1814 Posted on Apr 29 • Originally published at blog.kubesimplify.com What Actually Happens When You Run kubectl run nginx #kubernetes #containers #devops So you type kubectl run nginx --image nginx. One line, one pod. About a second later on a warm cluster, the pod is Running. But what actually happens behind the scenes? Let us walk through it, step by step, step by step.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at DEV.to (Top).