Core Concepts (Part 1)
Kubernetes Cluster Architecture
Kubernetes automates the deployment, scaling, and networking of containerized applications. While its internal architecture can seem intimidating at first, mapping its components to a maritime shipping fleet makes every piece intuitive.
The High-Level Analogy: Control Ships vs. Cargo Ships
A Kubernetes cluster consists of machines—physical or virtual, on-premises or in the cloud—divided into two functional roles:
- Control Plane (Master Nodes) — The Control Ships: Manage the cluster, store state records, decide where containers go, and monitor cluster health.
- Worker Nodes — The Cargo Ships: Carry the actual workload by running your containerized applications.
Maritime Analogy | Kubernetes Component | Primary Role |
Control Ship | Control Plane (Master Node) | Cluster management and orchestration |
Cargo Ship | Worker Node | Running application workloads |
Shipping Container | Pod / Container | Packaged application instance |
Ship's Logbook | etcd | Distributed key-value state database |
Harbor Cranes | kube-scheduler | Assigning workloads to the right nodes |
Port Operations Offices | kube-controller-manager | Monitoring state and self-healing |
Port Radio Tower | kube-apiserver | Central communication and API hub |
Ship Captain | kubelet | Node-level agent managing local containers |
Inter-Ship Radio Network | kube-proxy | Service networking and traffic routing |
Container Handling Gear | Container Runtime | Low-level software executing containers |
Control Plane Components (The Control Ship)
The Control Plane acts as the brain of the cluster, making global decisions and responding to cluster events.
1. kube-apiserver (The Port Radio Tower)
The kube-apiserver is the central management hub of Kubernetes. It exposes the Kubernetes API and orchestrates every operation in the cluster:
- External users and CLI tools (
kubectl) send commands here. - Internal controllers query it to monitor cluster state.
- Worker nodes report status back to it.
All communication flows through the API server; components rarely talk directly to etcd or one another without passing through it.
2. etcd (The Ship's Logbook)
etcd is a consistent, highly available distributed key-value store that serves as Kubernetes' single source of truth. It records:
- Which nodes belong to the cluster.
- Which containers are scheduled on which nodes.
- Configuration data, secrets, and state timestamps.
3. kube-scheduler (The Harbor Cranes)
When a new workload arrives, the kube-scheduler watches for unscheduled Pods and selects the optimal Worker Node to run them. It filters and scores nodes based on:
- CPU and memory resource requirements.
- Node capacity and current load.
- Scheduling constraints such as taints and tolerations, node affinity, and anti-affinity rules.
4. kube-controller-manager (Port Operations Offices)
Controllers run continuous control loops that watch the actual state of the cluster via the API server and make changes to move it toward the desired state:
- Node Controller: Monitors node health, onboarded nodes, and responds when a node becomes unreachable or crashes.
- Replication / ReplicaSet Controller: Ensures the exact desired number of Pod replicas are running at all times, replacing any that fail.
- Service Account & Token Controllers: Manage authentication identities and API access credentials across namespaces.
Worker Node Components (The Cargo Ships)
Worker nodes provide the compute, memory, and networking resources needed to run applications.
1. kubelet (The Ship Captain)
The kubelet is the primary node agent running on every Worker Node. It registers the node with the Control Plane, watches the kube-apiserver for Pod assignments, instructs the container runtime to start or stop containers, and continuously reports node and Pod health back to the master.
2. kube-proxy (The Inter-Ship Network)
Applications spread across multiple nodes need reliable communication (for example, a frontend web container on Node A talking to a backend database container on Node B). kube-proxy runs on every node and maintains network rules (via iptables or IPVS) that route traffic to the appropriate Pods behind Kubernetes Services.
3. Container Runtime (Container Handling Gear)
The container runtime is the underlying software responsible for pulling container images and running containers on the host OS. Modern Kubernetes clusters use CRI-compliant runtimes such as containerd or CRI-O (having deprecated direct Docker Engine integration via dockershim in Kubernetes v1.24).
Comments
Join the discussionNo comments yet. Be the first to comment.