DevOps & Kubernetes (50 Qs)•Part 2: Kubernetes Architecture & Core Workloads (11 - 25)
Kubernetes Control Plane Architecture: How do Control Plane components and Worker Node agents interact?
High-Level Architecture
Kubernetes follows a master-worker distributed architecture. The Control Plane maintains cluster state, evaluates scheduling decisions, and orchestrates reconciliation loops, while Worker Nodes execute the containerized workloads.
scss
+-------------------------------------------------------------------------------+
| KUBERNETES CONTROL PLANE |
| |
| +-------------+ +-------------------+ +---------------------+ |
| | etcd |<---->| kube-apiserver |<---->| kube-scheduler | |
| | (Raft Store)| | (Central Gateway) | | (Node Placement) | |
| +-------------+ +-------------------+ +---------------------+ |
| ^ |
| | +---------------------+ |
| +--------------->| kube-controller-mgr | |
| | (Reconcile Loops) | |
| +---------------------+ |
+-----------------------------------|-------------------------------------------+
| HTTPS (Port 6443)
+-----------------------------+-----------------------------+
| |
v v
+-------------------------------+ +-------------------------------+
| WORKER NODE 1 | | WORKER NODE 2 |
| +-------------------------+ | | +-------------------------+ |
| | kubelet | | | | kubelet | |
| | (Node Agent & SyncLoop) | | | | (Node Agent & SyncLoop) | |
| +-------------------------+ | | +-------------------------+ |
| | kube-proxy | | | | kube-proxy | |
| | (iptables/IPVS Rules) | | | | (iptables/IPVS Rules) | |
| +-------------------------+ | | +-------------------------+ |
| | Container Runtime (CRI) | | | | Container Runtime (CRI) | |
| | (containerd / CRI-O) | | | | (containerd / CRI-O) | |
| +-------------------------+ | | +-------------------------+ |
| | [Pod A] [Pod B] | | | | [Pod C] [Pod D] | |
+-------------------------------+ +-------------------------------+
Component Roles & Responsibilities
| Component | Location | Role in Cluster |
|---|---|---|
kube-apiserver | Control Plane | The only component that reads/writes directly to etcd. Exposes the REST API and handles AuthN, AuthZ, and Admission. |
etcd | Control Plane | Consistent, highly-available key-value store holding the complete declarative cluster state using the Raft consensus algorithm. |
kube-scheduler | Control Plane | Watches for newly created unscheduled Pods (nodeName == "") and assigns them to optimal nodes based on resource filtering and scoring. |
kube-controller-manager | Control Plane | Runs core reconciliation loops (DeploymentController, ReplicaSetController, NodeController, EndpointsController). |
kubelet | Worker Node | Primary node agent. Watches API Server for Pods assigned to its node and instructs CRI to create/start/stop containers. |
kube-proxy | Worker Node | Maintains network routing rules (iptables or IPVS) on each node to implement Service abstraction and load balancing. |
| Container Runtime | Worker Node | Software executing the containers (containerd, CRI-O) implementing the Kubernetes Container Runtime Interface (CRI). |