Core Kubernetes · 02

Architecture

1.What is in a cluster ?

Two halves. The control plane stores the state you asked for and keeps steering toward it. The nodes run your Pods. You need at least one.

  • Control plane : kube-apiserver, etcd, kube-scheduler, kube-controller-manager, plus cloud-controller-manager on a cloud.
  • Node : kubelet, a container runtime, usually kube-proxy.
  • Add-ons : a CNI network plugin (required) and cluster DNS.
  • Cloud : in-tree cloud code is gone since v1.31, so clouds run cloud-controller-manager.

2.Old words, new words

  • masterSay control plane. kubeadm switched its node label in v1.24.
  • minionSay node, or worker node.
  • client-serverNo. Hub-and-spoke around kube-apiserver.
  • dockershimGone in v1.24. Nodes use a CRI runtime.
  • kube-dnsCoreDNS since v1.13, behind a Service still named kube-dns.
  • /healthzDeprecated (v1.16), like componentstatuses (v1.19). Use /livez, /readyz.

3.Who talks to whom

kube-apiserver is the hub. The others watch it and write back to it. Only kube-apiserver touches etcd.

kubectl / clients HTTPS :6443 load balancer (HA) cloud provider API Control plane any healthy copy kube-apiserver the hub etcd all cluster state :2379 read / write cloud-controller-manager kube-controller-manager kube-scheduler LBs, routes, nodes watch my Pods, status, Lease logs, exec :10250 watch Services Every node Pods container runtime kubelet CRI kube-proxy (optional) kubectl :6443 load balancer (HA) kube-apiserver, the hub rest of the control plane etcd read / write on :2379 kube-scheduler kube-controller-manager cloud-controller-manager cloud provider API every node kube-proxy (optional) kubelet CRI container runtime Pods

Arrows point from the caller. Dashed : kube-apiserver calls the kubelet for logs, exec and port-forward. A CNI plugin such as Cilium can replace kube-proxy.

4.The parts, one by one

PartRuns onJobPort
kube-apiserverControl planeHTTP API, authn, authz, admission. Only etcd client.6443
etcdControl planeHolds every API object, the cluster's only source of truth. Back it up.2379-2380
kube-schedulerControl planeGives each unscheduled Pod a node10259
kube-controller-managerControl planeBuilt-in loops (Deployment, ReplicaSet, Node ...)10257
cloud-controller-managerCloud onlyNode, route and load balancer loops, cloud API10258
kubeletEvery nodeRegisters the node, runs its Pods via CRI10250
container runtimeEvery nodePulls images, makes Pod sandboxes and containers for the kubelet (CRI v1)socket
kube-proxy (optional)Every nodePacket rules for Service virtual IPs10256
CNI plugin (add-on)Every nodePod IPs and Pod-to-Pod traffic-
CoreDNS (add-on)kube-system PodsCluster DNS for Services and Pods-

Ports are TCP. NodePort range : see Services.

In short : The control plane stores the desired state and reconciles toward it, each node's kubelet makes it real through a CRI runtime, and every part goes through kube-apiserver, the only one that touches etcd.

1.From apply to running

  • 1-3, API : kubectl apply sends the Deployment over HTTPS. kube-apiserver checks it (authn, authz, mutating admission, validation, validating admission) and saves it in etcd.
  • 4-5, controllers : the Deployment controller makes a ReplicaSet, which makes Pods with no node yet (Pending).
  • 6, scheduler : filters and scores the nodes, then posts a binding.
  • 7-11, node : the kubelet sees the Pod and asks the runtime for a sandbox. The runtime calls CNI for the Pod IP, pulls the image, starts the containers. The kubelet reports Running.
kubectl kube-controller-manager Deploymentcontroller ReplicaSetcontroller kube-apiserver2 : runs checks etcd kube-scheduler 1 3 4 5 6 kubelet runtime (CRI) CNI plugin containers upimage pulled first 7, 11 8 9 10

No one calls the next step. Each part watches the API and reacts to a change.

2.Inside a node

  • The kubelet registers its Node and renews a Lease in kube-node-lease as its heartbeat.
  • It drives the runtime over CRI gRPC on a local socket. CRI v1 only : containerd, CRI-O, or Docker via cri-dockerd.
  • Static Pods : files in the kubelet's manifest folder run with no API server. kubeadm puts the control plane in /etc/kubernetes/manifests.
  • Since v1.35 the kubelet refuses cgroup v1 unless overridden. v1.36+ needs containerd 2.0+.

3.kube-proxy is not the network

Key point
  • Pod IPs and Pod-to-Pod traffic come from the CNI plugin.
  • kube-proxy only turns Services and EndpointSlices into rules for Service virtual IPs.
  • Modes : iptables (default), nftables (GA v1.33), ipvs (deprecated v1.35). Pick one explicitly.
  • Cilium and some other CNIs replace it, so no kube-proxy Pods.

4.HA control plane

  • 3+ control plane nodes, odd count for etcd quorum : 3 survive 1 loss, 5 survive 2.
  • kube-apiserver : all copies active behind a load balancer (TCP check, 6443).
  • Scheduler, controller-manager : one leader per Lease, the rest wait.
  • Stacked etcd (kubeadm default) : fewer hosts, but a dead node takes an apiserver and an etcd member.
  • External etcd : 3+ own hosts, failures stay apart.
workers + kubectl load balancer :6443 all active CP node 1 apiserver etcd sched leader CP node 2 apiserver etcd kcm leader CP node 3 apiserver etcd standby

Bottom row : scheduler and controller-manager, each with its own leader Lease.

5.Commands

CommandShows
kubectl get nodes -o wideNodes, kubelet version, CONTAINER-RUNTIME column
kubectl get pods -n kube-system -o wideStatic control plane Pods, CoreDNS, kube-proxy, CNI, and their nodes
kubectl get --raw='/readyz?verbose'API server checks one by one. /livez for liveness
kubectl -n kube-system get lease -l apiserver.kubernetes.io/identity=kube-apiserverOne Lease per running kube-apiserver
sudo crictl psOn the node : containers via CRI, even with the API server down
In short : Each step from apply to running is a loop reacting to an API change, the kubelet makes Pods real through CRI and CNI, and HA means 3+ control plane nodes behind a load balancer.