FullStack AI Hub
Studio
Cloud & Kubernetes · 01. Containers & Control Plane
10 min
6 steps
Intermediate

Kubernetes Control Plane & Scheduling

Trace declarative reconciliation loops across API Server, etcd, Scheduler, and Kubelet—plus self-healing node failover.

Cloud & Kubernetes01. Containers & Control PlaneLesson 2 of 2
10 minIntermediate6 steps

Kubernetes Control Plane & Scheduling

Trace declarative reconciliation loops across API Server, etcd, Scheduler, and Kubelet—plus self-healing node failover.

etcd Commit
9 ms
Desired Replicas
3 / 3
State Drift
0
etcd Quorum
Healthy
CONTROL PLANE (3)write specwatch eventkubectl / CIAPI Serveretcd QuorumControllerMgr
Declarative Manifest / API
etcd Watch / State Write
Kubelet Heartbeat / Probe
Reconciled Pod State
Node Loss / Eviction
In This LessonStep 1 of 6
What You Will Master
  • ✓Explain how controllers continuously reconcile actual state toward desired state in etcd
  • ✓Understand predicate filtering and node scoring (affinity, topology spread, requests)
  • ✓Trace how Kubernetes detects a dead node and reschedules pods onto healthy capacity
  • ✓Protect live traffic during maintenance using Readiness Probes and PodDisruptionBudgets

Architectural Trade-Off Comparison Matrix

PatternBest ForKey Trade-Off
API Server + etcd WatchSingle source of truth with event-driven controller notificationsAll control-plane components depend on etcd quorum stability
Topology Spread ConstraintsDistributing pod replicas evenly across Availability ZonesStrict rules can leave pods Pending if one zone fills up
Readiness vs Liveness ProbeRemoving slow pods from Service endpoints without unnecessary restartsBad liveness probes cause cascading restart loops on DB blips
PodDisruptionBudget (PDB)Guaranteeing minimum available replicas during node upgradesSetting minAvailable to 100% blocks voluntary node drains

Step-by-Step Architectural Breakdown (6 Steps)

Full architectural walkthrough transcript and state transitions for Kubernetes Control Plane & Scheduling.

STEP 01 · SETUPJump to step →

From `kubectl apply` to etcd Source of Truth

The **API Server** validates manifests, writes desired state to **etcd** (Raft quorum), and streams watch events to controllers—turning infrastructure into continuous reconciliation.

idea:Only the API Server talks to etcd; every controller and kubelet watches the API Server over HTTP/2.

kube-apiserveretcdWatch StreamDeclarative Spec
STEP 02 · TECHNIQUEJump to step →

Scheduler Filtering, Scoring & Topology Spread

**kube-scheduler** filters out ineligible nodes (taints, insufficient CPU/RAM requests) and scores remaining nodes to spread replicas evenly across Availability Zones.

idea:Scheduling uses pod `requests`, not live utilization—always size requests accurately.

kube-schedulerTopology SpreadTaints & TolerationsResource Requests
STEP 03 · PROBLEMJump to step →

Node Failure & Self-Healing Reconciliation

When a container fails its readiness or liveness check repeatedly, Kubernetes marks it **CrashLoopBackOff** and drops its IP from Service endpoints while healthy replicas continue serving live traffic.

watch:Readiness probes remove failing endpoints in seconds, long before full node eviction timers expire.

Node LeaseReplicaSet LoopEndpointSliceSelf-Healing
STEP 04 · SOLUTIONJump to step →

Readiness Probes, PreStop & Disruption Budgets

Zero-downtime rollouts combine **Readiness Probes** (warmth gate), a **preStop sleep** (drain race buffer), and `maxSurge: 1 / maxUnavailable: 0` so v2 pods become Ready before v1 pods terminate.

good:Keep external DB checks out of Liveness Probes so a brief DB blip never triggers a fleet-wide restart storm.

Readiness ProbeLiveness ProbepreStop HookPodDisruptionBudget
STEP 05 · TRADE-OFFJump to step →

Deployments vs StatefulSets Trade-Off

Stateless pods use interchangeable `Deployments`, whereas databases require stable DNS ordinals (`db-0`, `db-1`) and sticky PersistentVolumes via `StatefulSets`—trading slower ordered rollouts for split-brain safety.

watch:StatefulSets refuse to duplicate a pod from an unreachable node until the node is confirmed fenced.

StatefulSetPersistentVolumeClaimHeadless ServiceSplit-Brain Fencing
STEP 06 · RECAPJump to step →

Kubernetes Control Plane Recap

Kubernetes turns operations into continuous reconciliation loops: desired specs in etcd, multi-AZ scheduling, and safe rollouts protected by probes and PDBs.

good:Even if the Control Plane restarts briefly, already-scheduled data-plane pods continue serving live traffic.

Control vs Data PlaneReconciliation LoopHigh AvailabilityDeclarative Ops

Related Production Deep-Dives & Simulators

Related Systems Course
Free · Verifiable Credential

FS-201Production LLM Engineer

Design an observable full-stack LLM product from capability validation through interfaces retrieval evaluation security and operations.

37 concepts~35h self-paced
Start Free Course
Weekly Engineering Dispatch

Get the weekly systems teardown

One technical note per week covering inference bottlenecks, retrieval harnesses, and commit-pinned teardowns.