| | |

LFCA 79 ๐Ÿง Kubernetes Architecture โ€” Nodes, Pods, Control Plane

The previous chapter introduced Kubernetes and the declarative model. This chapter covers the architecture that makes the model work: the components that make decisions, the components that run workloads, and the resource that sits between them.

Kubernetes has two halves. The control plane makes global decisions about the cluster and responds to cluster events . The worker nodes run the actual workloads. Every cluster needs at least one worker node to run Pods, and production clusters run multiple nodes and multiple control plane instances for fault tolerance and high availability . The LFCA exam places containers and deployment environments under DevOps Fundamentals, which carries 16% of the total weight. Understanding the architecture is the foundation for every Kubernetes topic that follows.

Key point: The control plane does not run user workloads. It decides where they run. The worker nodes do not make scheduling decisions. They run what the control plane assigns to them. The kubelet is the bridge: it runs on every node, watches the API server for Pod assignments, and starts the containers that match .


Why the architecture matters

You can run a single container without knowing any of this. You cannot debug a Kubernetes cluster without it.

The scheduling problem. A Pod is created, but it has no node. The scheduler watches for Pods with no assigned node and picks one based on resource requirements, affinity rules, and policy constraints . If the scheduler is not running, the Pod stays in Pending forever. Knowing the scheduler exists tells you where to look when a Pod never starts.

The reconciliation problem. A Deployment says three replicas. Two are running. Who creates the third? The controller manager. It runs the controllers that watch the cluster’s state and act when it drifts from the desired state . The Node controller notices when a node goes down. The Job controller creates Pods for one-off tasks. Without the controller manager, nothing self-heals.

The state problem. Every object you create โ€” Pods, Services, Deployments, ConfigMaps โ€” is stored in etcd. It is the single source of truth for the cluster . If etcd is lost and not backed up, the cluster’s state is lost. The Kubernetes documentation is explicit: “make sure you have a backup plan for these data” .

The communication problem. Every component talks to the API server. The kubelet talks to it to report node status and receive Pod assignments. The scheduler talks to it to update Pod assignments. The controller manager talks to it to read and write state. The API server is the front end for the entire control plane .

The trade-off. The architecture adds components. A single machine with Docker has one process. A Kubernetes cluster has an API server, a datastore, a scheduler, a controller manager, and a kubelet and container runtime on every node. Each component is a point of failure. The complexity is the cost of the capabilities.


a. The Control Plane Components

The control plane makes global decisions about the cluster and detects and responds to cluster events . It runs five components.

kube-apiserver exposes the Kubernetes API. It is the front end for the control plane. Every component and every user talks to the API server. It is designed to scale horizontally: you can run multiple instances and balance traffic between them . The API server is the only component that writes to etcd. Everything else reads and writes through the API server.

etcd is a consistent and highly-available key-value store used as Kubernetes’ backing store for all cluster data . It stores the state of every object in the cluster. If etcd is not running, the cluster cannot function. If etcd is lost, the cluster’s state is lost. Backups of etcd are the most critical backup in a Kubernetes cluster .

kube-scheduler watches for newly created Pods with no assigned node and selects a node for them to run on . The scheduler’s decision is based on resource requirements, hardware and software constraints, affinity and anti-affinity specifications, data locality, and deadlines . The scheduler does not start the Pod. It only assigns it to a node. The kubelet on that node does the actual work.

kube-controller-manager runs controller processes . Each controller is logically a separate process, but they are compiled into a single binary and run as a single process to reduce complexity . The controllers include the Node controller (notices when nodes go down), the Job controller (creates Pods for one-off tasks), the EndpointSlice controller (links Services to Pods), and the ServiceAccount controller (creates default accounts for new namespaces) .

cloud-controller-manager embeds cloud-specific control logic . It links the cluster to the cloud provider’s API and separates the components that interact with the cloud platform from those that only interact with the cluster . It runs controllers for node deletion detection, route setup, and load balancer management . If you are running Kubernetes on your own premises, the cluster does not have a cloud controller manager .


b. The Worker Node Components

Worker nodes host the Pods that are the components of the application workload . Every node runs three components.

kubelet is the agent that runs on every node. It ensures that Pods are running, including their containers . The API server communicates with the kubelet to ensure that the node is correctly registered and that the Pods assigned to it are running. The kubelet reads Pod specifications, sets up the required storage volumes, and checks the health of the running containers.

Container runtime is the software responsible for running containers . It pulls container images from registries, runs containers, stops containers, and responds to container queries. The default container runtime is containerd. Docker’s dockershim integration was removed from Kubernetes in version 1.24, but Docker can still be used with Kubernetes by installing the Docker Engine on each node .

kube-proxy maintains network rules on nodes to implement Services . It tracks the IP addresses and ports associated with Pods and routes traffic to the correct destination. Some network plugins provide their own proxy implementations, and in those cases, the node does not need to run kube-proxy .


c. The Pod

The Pod is the smallest deployable unit in Kubernetes . It is a group of one or more containers that share storage, network, and the specification for how to run the containers . The containers in a Pod are always co-located and co-scheduled on the same physical or virtual machine .

The single-container Pod is the most common use case. You can think of the Pod as a wrapper around a single container. Kubernetes manages Pods rather than managing containers directly .

The multi-container Pod is used when containers are tightly coupled and need to share resources. The containers in a Pod share a network namespace, including the IP address and port space. They can communicate with each other using localhost . They share storage volumes, which allows them to share data and allows persistent data to survive a container restart .

Each Pod is assigned a unique IP address. Every container in the Pod shares that address. When containers in a Pod communicate with entities outside the Pod, they must coordinate how they use the shared network resources, such as ports .

Pods are ephemeral. They are designed as relatively temporary, disposable entities . When a Pod is created, it is scheduled on a node and remains there until it finishes, is deleted, is evicted due to resource constraints, or the node fails . You rarely create Pods directly. You use workload resources like Deployments, StatefulSets, and DaemonSets to manage Pods .


Complete Example Session

This session demonstrates the architecture by examining a Pod’s journey from creation to running.

# ============================================
# PART 1: CREATE A POD VIA A DEPLOYMENT
# ============================================

kubectl create deployment web --image=nginx --replicas=3

# The deployment is stored in etcd.
# The controller manager creates a ReplicaSet.
# The ReplicaSet controller creates three Pods.

# ============================================
# PART 2: THE SCHEDULER ASSIGNS THE PODS
# ============================================

kubectl get pods -o wide

# Output:
# NAME                   READY   STATUS    NODE
# web-7d9f8b6c5-2x4kz    1/1     Running   node-1
# web-7d9f8b6c5-8m3np    1/1     Running   node-2
# web-7d9f8b6c5-q7r5t    1/1     Running   node-3

# The scheduler picked a node for each Pod.
# The kubelet on each node started the container.

# ============================================
# PART 3: THE KUBELET STARTS THE CONTAINER
# ============================================

kubectl describe pod web-7d9f8b6c5-2x4kz

# Output (excerpt):
# Node: node-1/10.0.0.5
# Container ID: containerd://abc123...
# Image: nginx:latest
# State: Running

# The kubelet pulled the image.
# The container runtime started the container.

# ============================================
# PART 4: THE API SERVER IS THE HUB
# ============================================

# Every component talks to the API server:
# - kubectl sends commands to the API server
# - The scheduler reads and writes Pod assignments
# - The controller manager reads and writes state
# - The kubelet on each node watches for Pod assignments

# ============================================
# PART 5: THE CONTROLLER MANAGER RECONCILES
# ============================================

# Delete a Pod
kubectl delete pod web-7d9f8b6c5-2x4kz

# The controller manager notices the actual state (2 Pods)
# does not match the desired state (3 Pods).
# It creates a replacement Pod.
# The scheduler assigns it to a node.
# The kubelet starts it.

kubectl get pods

# Three Pods are running again.

# ============================================
# PART 6: THE NODE CONTROLLER DETECTS FAILURE
# ============================================

# Simulate a node failure (conceptually)
# The Node controller notices the node is unreachable.
# The Pods on that node are marked as lost.
# The controller manager creates replacements on other nodes.

# ============================================
# PART 7: THE ETCD BACKUP
# ============================================

# etcd stores the entire cluster state.
# A backup is essential.
# The exact command depends on the etcd deployment.
# The Kubernetes documentation recommends a backup plan.

# ============================================
# PART 8: THE CLOUD CONTROLLER MANAGER
# ============================================

# On a cloud provider, the cloud-controller-manager:
# - Checks if a node has been deleted in the cloud
# - Sets up routes in the cloud infrastructure
# - Creates and manages cloud load balancers

# On a self-managed cluster, this component is absent.

# ============================================
# PART 9: THE KUBE-PROXY
# ============================================

# kube-proxy maintains network rules for Services.
# When you create a Service, kube-proxy on each node
# updates the network rules to route traffic to the
# correct Pods.

kubectl expose deployment web --port=80 --type=ClusterIP

# The Service is created.
# kube-proxy configures the routing.

# ============================================
# PART 10: THE ARCHITECTURE SUMMARY
# ============================================

# Control plane:
#   kube-apiserver: front end for the API
#   etcd: cluster state storage
#   kube-scheduler: assigns Pods to nodes
#   kube-controller-manager: reconciles state
#   cloud-controller-manager: cloud integration

# Worker nodes:
#   kubelet: runs Pods on the node
#   container runtime: runs containers
#   kube-proxy: network rules for Services

# Pods:
#   Smallest deployable unit
#   One or more containers
#   Shared network and storage

The ten parts cover creating a Pod via a Deployment, the scheduler assigning Pods, the kubelet starting the container, the API server as the hub, the controller manager reconciling, the Node controller detecting failure, the etcd backup, the cloud-controller-manager, kube-proxy, and the architecture summary.


Quick Reference

The Control Plane Components

ComponentPurpose
kube-apiserverExposes the Kubernetes API; front end for the control plane
etcdConsistent and highly-available key-value store for cluster data
kube-schedulerWatches for new Pods and assigns them to nodes
kube-controller-managerRuns controllers that reconcile desired state
cloud-controller-managerIntegrates with cloud provider APIs

The Node Components

ComponentPurpose
kubeletEnsures Pods are running on the node
Container runtimeRuns containers (containerd, CRI-O)
kube-proxyMaintains network rules for Services

The Pod

AspectDescription
DefinitionSmallest deployable unit
ContainersOne or more, co-located and co-scheduled
NetworkShared IP address and port space
StorageShared volumes
CommunicationContainers use localhost
LifecycleEphemeral; scheduled until finished, deleted, or evicted

The Controllers

ControllerResponsibility
Node controllerNotices and responds when nodes go down
Job controllerCreates Pods for one-off tasks
EndpointSlice controllerLinks Services to Pods
ServiceAccount controllerCreates default accounts for new namespaces

Best Practices

โœ… Do This:

# Use Deployments for stateless applications
kubectl create deployment web --image=nginx                       # โœ…
# Check which node a Pod is running on
kubectl get pods -o wide                                          # โœ…
# Back up etcd regularly
# The cluster state is stored there.                              # โœ…
# Use multi-container Pods for tightly coupled containers
# For example, a web server and a sidecar.                        # โœ…

โŒ Don’t Do This:

# Don't create Pods directly for production workloads
kubectl run my-pod --image=nginx  # no self-healing               # โŒ
# Don't run user workloads on control plane nodes in production
# Dedicate control plane nodes to the control plane.             # โŒ
# Don't skip etcd backups
# Losing etcd means losing the cluster state.                    # โŒ

Common Pitfalls

PitfallWhy It HappensFix
Pod stuck in PendingScheduler cannot find a suitable nodeCheck resource requests and node labels
Pod stuck in ContainerCreatingImage pull failure or volume issueCheck kubectl describe pod
Node NotReadyKubelet not running or node unreachableCheck kubelet status on the node
Service not routingkube-proxy not running or misconfiguredCheck kube-proxy status
etcd backup missingNo backup planConfigure etcd backups

Real-World Examples

1. API Server

kubectl cluster-info

2. Scheduler

kubectl describe pod my-pod | grep Node

3. Controller Manager

kubectl get deployments

4. Kubelet

# Runs on every node
systemctl status kubelet

5. Container Runtime

# containerd or CRI-O
crictl ps

6. kube-proxy

kubectl get services

7. Pod with Multiple Containers

# web server + sidecar

8. Pod IP Address

kubectl get pods -o wide

9. Node Status

kubectl get nodes

10. etcd Backup

# Command depends on the etcd deployment

Visual

The Kubernetes Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  CONTROL PLANE                               โ”‚
โ”‚    kube-apiserver  โ† front end               โ”‚
โ”‚    etcd            โ† state store             โ”‚
โ”‚    kube-scheduler  โ† assigns Pods            โ”‚
โ”‚    kube-controller-manager โ† reconciles      โ”‚
โ”‚    cloud-controller-manager โ† cloud APIs     โ”‚
โ”‚                                              โ”‚
โ”‚  WORKER NODES                                โ”‚
โ”‚    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”       โ”‚
โ”‚    โ”‚ Node 1  โ”‚ โ”‚ Node 2  โ”‚ โ”‚ Node 3  โ”‚       โ”‚
โ”‚    โ”‚ kubelet โ”‚ โ”‚ kubelet โ”‚ โ”‚ kubelet โ”‚       โ”‚
โ”‚    โ”‚ runtime โ”‚ โ”‚ runtime โ”‚ โ”‚ runtime โ”‚       โ”‚
โ”‚    โ”‚ kube-   โ”‚ โ”‚ kube-   โ”‚ โ”‚ kube-   โ”‚       โ”‚
โ”‚    โ”‚ proxy   โ”‚ โ”‚ proxy   โ”‚ โ”‚ proxy   โ”‚       โ”‚
โ”‚    โ”‚ Pods    โ”‚ โ”‚ Pods    โ”‚ โ”‚ Pods    โ”‚       โ”‚
โ”‚    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜       โ”‚
โ”‚                                              โ”‚
โ”‚  Every component talks to the API server.    โ”‚
โ”‚  The kubelet runs Pods on each node.         โ”‚
โ”‚                                              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

The Pod

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  POD                                         โ”‚
โ”‚    Shared IP address                         โ”‚
โ”‚    Shared network namespace                  โ”‚
โ”‚    Shared storage volumes                    โ”‚
โ”‚                                              โ”‚
โ”‚    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”           โ”‚
โ”‚    โ”‚ Container 1 โ”‚ โ”‚ Container 2 โ”‚           โ”‚
โ”‚    โ”‚ (web server)โ”‚ โ”‚ (sidecar)   โ”‚           โ”‚
โ”‚    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜           โ”‚
โ”‚                                              โ”‚
โ”‚  Containers communicate via localhost.       โ”‚
โ”‚  Pods are ephemeral.                         โ”‚
โ”‚                                              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

The Reconciliation Loop

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  RECONCILIATION                              โ”‚
โ”‚                                              โ”‚
โ”‚  Desired state: 3 replicas                   โ”‚
โ”‚  Actual state: 2 replicas                    โ”‚
โ”‚       โ”‚                                      โ”‚
โ”‚       โ–ผ                                      โ”‚
โ”‚  Controller manager notices mismatch         โ”‚
โ”‚       โ”‚                                      โ”‚
โ”‚       โ–ผ                                      โ”‚
โ”‚  Creates a new Pod                           โ”‚
โ”‚       โ”‚                                      โ”‚
โ”‚       โ–ผ                                      โ”‚
โ”‚  Scheduler assigns it to a node              โ”‚
โ”‚       โ”‚                                      โ”‚
โ”‚       โ–ผ                                      โ”‚
โ”‚  Kubelet starts the container                โ”‚
โ”‚       โ”‚                                      โ”‚
โ”‚       โ–ผ                                      โ”‚
โ”‚  Desired state: 3 replicas                   โ”‚
โ”‚  Actual state: 3 replicas                    โ”‚
โ”‚                                              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

The Communication Flow

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  EVERYTHING TALKS TO THE API SERVER          โ”‚
โ”‚                                              โ”‚
โ”‚  kubectl โ”€โ”€> API server                      โ”‚
โ”‚  Scheduler โ”€โ”€> API server                    โ”‚
โ”‚  Controller manager โ”€โ”€> API server           โ”‚
โ”‚  Kubelet โ”€โ”€> API server                      โ”‚
โ”‚  kube-proxy โ”€โ”€> API server                   โ”‚
โ”‚                                              โ”‚
โ”‚  Only the API server writes to etcd.         โ”‚
โ”‚                                              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Summary

ItemValue
Cluster compositionControl plane + worker nodes
Control plane componentskube-apiserver, etcd, kube-scheduler, kube-controller-manager, cloud-controller-manager
Node componentskubelet, container runtime, kube-proxy
API serverFront end; only writer to etcd
etcdKey-value store for all cluster data
SchedulerAssigns Pods to nodes
Controller managerReconciles desired state with actual state
KubeletEnsures Pods are running on the node
PodSmallest deployable unit
Pod sharingNetwork namespace, IP address, storage volumes
LFCA weightDevOps Fundamentals, 16%

Key takeaways:

  • A Kubernetes cluster consists of a control plane and worker nodes. The control plane makes global decisions about the cluster. The worker nodes run the application workloads. Every cluster needs at least one worker node .
  • The API server is the front end for the control plane. Every component and every user talks to the API server. It is the only component that writes to etcd .
  • etcd stores the entire cluster state. If etcd is lost and not backed up, the cluster’s state is lost. The Kubernetes documentation recommends a backup plan for etcd data .
  • The scheduler assigns Pods to nodes. It watches for newly created Pods with no assigned node and selects a node based on resource requirements, affinity rules, and policy constraints .
  • The controller manager runs the reconciliation loop. It notices when the actual state differs from the desired state and acts to fix the difference. The Node controller notices when nodes go down. The Job controller creates Pods for one-off tasks .
  • The kubelet runs on every node and ensures Pods are running. It communicates with the API server, reads Pod specifications, and starts the containers .
  • The Pod is the smallest deployable unit. It is a group of one or more containers that share network and storage. Pods are ephemeral. They are scheduled, run, and replaced .

Remember: The Kubernetes architecture is a set of components that work together to maintain the desired state of the cluster. The control plane decides. The worker nodes run. The API server is the hub. etcd is the memory. The scheduler places. The controller manager reconciles. The kubelet executes. The Pod is the unit of work. Understanding the architecture is understanding who does what and why a Pod that never starts is a scheduler problem, not a container problem.


Stop using slow, ad-bloated tool sites! ๐Ÿคฎ

๐Ÿ”Ž Search “KandZ Tools” on Google to use many professional utilities for free.

KandZ.me is the ultimate minimalist hub for:
โœ… Finance (Mortgage, Interest, Inflation)
โœ… Tech (Base64, JSON, Dev Suite, IP)
โœ… Health (BMI, BMR, TDEE)
โœ… Productivity (Timer, Workspace, QR)

โšก๏ธ Fast & Private
๐Ÿ”’ No data leaves your device
๐Ÿ’Ž 100% Free

๐Ÿ”— Use it now: https://tools.kandz.me
๐Ÿ”– Bookmark itโ€”youโ€™ll need it later!