⚡ ~/naveed K8s Hub
⚡ Portfolio Home 👤 About Naveed Bio & Credentials 📫 Contact Naveed Get In Touch ✍️ Engineering Blog Deep Dives 🎯 Interview Hub 1,000+ Scenarios ☸️ Kubernetes Mastery Hub 24 Modules 🎮 DevOps Arcade & Quizzes Subnet Blitz ⚡ 🗺️ DevOps Roadmaps PDFs & Guides 🤖 Morpheus Analysis AI Quant ↗ 🛠️ Developer Tools Utilities 🧪 Labs & Experiments 📄 Interactive CV & Certs 🔗 All Links & Socials ⚡ Join The Dispatch (Weekly SRE Newsletter) →
Phase 1 — Fundamentals Module 01 of 24 Free & Open Access

Kubernetes Architecture & Core Concepts

Kubernetes architecture splits into a control plane (API server, etcd, scheduler, controller manager) that stores the desired state, and worker nodes (kubelet, container runtime, kube-proxy) that make it real. This module traces one kubectl apply through every component so you can tell where a failure actually happens.

Last updated: · By Naveed Ahmed, Certified Kubernetes Administrator

01 - Kubernetes Architecture & Core Concepts

Why this matters

Everything else in Kubernetes is a variation on this control loop. Get this right and every later topic (scheduling, networking, security) slots into a mental model instead of being memorized separately.

Read this first — Definitions & Explanations

Before the quiz, make sure these ideas are clear in plain language.

Control plane vs data plane (nodes)

The control plane is the "brain": API server, etcd, scheduler, controller-manager. It decides what should happen.
The data plane (worker nodes) is where workloads actually run: kubelet, container runtime, kube-proxy. It makes things happen.

kube-apiserver

The front door of the cluster. Every kubectl call, every controller, every kubelet talk goes through the API server. Clients never talk to etcd directly. The API server validates requests, authenticates/authorizes them, then reads/writes cluster state.

etcd

A distributed key-value store that holds the source of truth for cluster state (Pods, Services, Deployments, etc.). Only the API server should access etcd. If etcd is wrong or lost, the cluster’s memory is wrong or lost.

controller-manager

Runs many controllers — small programs that continuously compare desired state (what you declared) with actual state (what is running) and act to close the gap. Example: if you want 3 replicas and only 2 exist, the replication/deployment controller creates another Pod.

Reconciliation loop

The core Kubernetes pattern: observe → diff → act → repeat forever. Controllers don’t “run once.” They keep reconciling.

scheduler

Watches for Pods that are unbound (no node assigned). It filters nodes that can’t run the Pod, scores the rest, and binds the Pod to a node. It does not start containers — kubelet does.

kubelet

The node agent. It talks to the API server, gets PodSpecs for its node, and asks the container runtime (via CRI) to start/stop containers. It also runs probes and reports Pod status.

kube-proxy

On each node, programs packet forwarding so Services reach healthy Pod endpoints (commonly via iptables or IPVS rules).

CRI (Container Runtime Interface)

The API kubelet uses to talk to runtimes like containerd or CRI-O. Kubernetes doesn’t require Docker specifically anymore — it requires a CRI-compatible runtime.

Declarative vs imperative

What Really Happens When You Run kubectl apply -f deployment.yaml?

Most Kubernetes engineers use this command every day, but behind that single line lies an entire distributed orchestration engine working to bring your application to life.

  1. kubectl sends manifest to API Server: Validates schema against local cache, computes 3-way strategic merge patch, sends HTTP POST to kube-apiserver.
  2. API Server validates and stores desired state in etcd: Authenticates caller, checks RBAC permissions, applies Mutating & Validating webhooks, and commits desired state to etcd via Raft consensus.
  3. Deployment Controller creates a ReplicaSet: Watches API server, detects new Deployment, and creates child ReplicaSet object.
  4. ReplicaSet Controller creates unbound Pods: Generates Pod definitions in Pending state with spec.nodeName: "" (no node assigned yet).
  5. kube-scheduler selects the best worker node: Filters ineligible nodes (Predicates) and scores candidate nodes (Priorities), then writes a Binding object.
  6. Kubelet instructs container runtime: Node kubelet detects its assigned Pod, calls containerd (CRI) to pull images and launch the pause sandbox.
  7. CNI configures networking: Allocates Pod IP, creates veth pair, and connects pod network namespace to host bridge/overlay.
  8. Service Ingress routes traffic: Readiness probes pass, Endpoints Controller adds Pod IP to Service Endpoints, and kube-proxy configures iptables/IPVS routing.

👉 The Core Principle: Kubernetes is a Desired State System

You don't tell Kubernetes how to run your application; you tell it what you want, and Kubernetes continuously works to make reality match that desired state. That is why Kubernetes can self-heal failed pods, automatically scale workloads, and recover from node loss.

Official docs (read for detail)

Key Concepts (listen for these in the videos)

YouTube search terms

Hands-on lab (on prod-sim)

# See all control-plane components as pods (in kubeadm-style clusters they run as pods)
kubectl get pods -n kube-system -o wide

# SSH into the control-plane node and look at the actual binaries/processes
minikube ssh -p prod-sim
  ps aux | grep -E 'kube-apiserver|etcd|kube-scheduler|kube-controller-manager|kubelet'
  sudo crictl ps            # see containers via the CRI directly
  exit

# Watch the API server directly (raw REST calls kubectl makes under the hood)
kubectl proxy --port=8080 &
curl http://localhost:8080/api/v1/nodes | jq '.items[].metadata.name'
kill %1

# Trace one `kubectl apply` end to end
kubectl apply -f https://k8s.io/examples/pods/simple-pod.yaml -v=8 2>&1 | less
# Read every log line: it's your kubectl -> apiserver -> etcd -> scheduler -> kubelet flow.

Common mistakes and how to avoid them

  • Thinking the scheduler starts containers. The scheduler only picks a node and records it on the Pod. The kubelet on that node starts the containers. A Pod with no node is a scheduling problem, not a kubelet problem.
  • Treating etcd as an ordinary database. Every cluster object lives in etcd, so losing it loses the cluster state. Back it up on a schedule and run it on fast disks, because slow etcd makes the whole API slow.
  • Editing Pods that a controller owns. Controllers reconcile toward the spec stored in the API server, so a hand-edited or deleted Pod is replaced. Change the Deployment or other owner instead.
  • Assuming kubectl talks to the nodes. kubectl only talks to the API server. For logs and exec the API server then calls the kubelet, so when those fail, check API server to kubelet connectivity on port 10250.
  • Running a single control plane node in production. The API server, scheduler and etcd then share one failure domain. Use three control plane nodes, since etcd needs a majority, or a managed control plane.

Quick answers

What does the kube-apiserver do?

It is the front door of the cluster. It authenticates and authorizes each request, validates objects and stores state in etcd. Every other component, including the scheduler, controllers and kubelets, talks to the API server rather than to each other, which makes it the only path into cluster state.

What happens when you run kubectl apply?

kubectl sends the manifest to the API server, which validates it and writes it to etcd. Controllers notice the new desired state and create the Pods, the scheduler assigns them to nodes, and each node's kubelet starts the containers through the container runtime.

What is a reconciliation loop?

A controller repeatedly compares the desired state in the API server with the observed state and acts to close the gap, for example by creating a missing Pod. This is why Kubernetes self-heals: you declare what you want, and controllers keep working until reality matches.

Notes

(fill in your own words after watching + labbing)

📋 Self-Assessment Mastery Checklist (4 Competencies)
🧠 Practice Exam Questions (Module 01 MCQs)
⚡ Take Quiz & Save Progress in Tracker

Review these sample exam questions out loud, test your retrieval, and then unlock official scoring in the interactive tracker.

Question 1: Which component is the only one that talks directly to etcd?
  • A. kubelet
  • B. kube-scheduler
  • C. kube-apiserver
  • D. kube-proxy
✓ Correct Answer: C (kube-apiserver)
Option C ('kube-apiserver') is the standard production architectural best practice.
Question 2: What is the reconciliation loop pattern?
  • A. observe → diff → act, forever
  • B. build → ship → delete once
  • C. schedule → run → exit
  • D. poll etcd every second only
✓ Correct Answer: A (observe → diff → act, forever)
Option A ('observe → diff → act, forever') is the standard production architectural best practice.
Question 3: Which node agent talks to the API server and the container runtime?
  • A. kube-proxy
  • B. kubelet
  • C. controller-manager
  • D. coredns
✓ Correct Answer: B (kubelet)
Option B ('kubelet') is the standard production architectural best practice.
Question 4: What does kube-proxy primarily implement?
  • A. Pod scheduling
  • B. Service networking on each node
  • C. etcd backups
  • D. Admission control
✓ Correct Answer: B (Service networking on each node)
Option B ('Service networking on each node') is the standard production architectural best practice.
Question 5: Declarative management typically uses which command style?
  • A. kubectl create
  • B. kubectl apply
  • C. kubectl run --rm
  • D. kubectl attach
✓ Correct Answer: B (kubectl apply)
Option B ('kubectl apply') is the standard production architectural best practice.
← Overview All 24 Modules Curriculum Index Next Module (02) → Pods & Workload Controllers