High-Level Kubernetes Architecture

Kubernetes follows a master–worker (control-plane / node) model.

At a high level:

  • Control Plane = Brain of the cluster
  • Worker Nodes = Muscles that run applications
  • Pods = Smallest deployable units
  • Kubelet / Kube-Proxy / CRI = Agents that make nodes obey the control plane

🧠 1. Control Plane Components (The Brain of Kubernetes)

The Control Plane makes all decisions:

  • Where to run containers
  • How many replicas
  • How to roll out updates
  • How to recover from failures

🔹 1.1 API Server (kube-apiserver)

The front door of Kubernetes

  • All commands (kubectl, UI, controllers) go through the API Server
  • Validates and processes all API requests
  • Exposes the entire Kubernetes REST API

Analogy: Like a receptionist + gatekeeper.

🔹 1.2 etcd (Distributed Key-Value Store)

The source of truth of the entire cluster

  • Stores all cluster data: pods, nodes, configs, secrets
  • Highly consistent and fault-tolerant
  • Every Kubernetes state lives in etcd

Analogy: A very reliable database for the cluster’s brain.

🔹 1.3 Scheduler (kube-scheduler)

Decides which node will run a new Pod

It checks:

  • CPU / memory availability
  • Node labels
  • Taints & tolerations
  • Affinity/anti-affinity rules

Analogy: A job scheduler assigning workers to tasks.

🔹 1.4 Controller Manager (kube-controller-manager)

Ensures the “desired state” matches the “actual state”

Includes several controllers:

  • Node Controller
  • Deployment Controller
  • ReplicaSet Controller
  • Endpoint Controller
  • Job Controller

Function:
If you say “I want 5 replicas,” this ensures 5 always exist.

Analogy: A supervisor constantly checking if everything is correct.

🔹 1.5 Cloud Controller Manager

Integrates Kubernetes with cloud platforms (AWS, GCP, Azure)

Responsible for:

  • Load balancers
  • Node life cycle
  • Route management
  • Persistent volumes

⚙️ 2. Worker Node Components (Where Your Apps Actually Run)

Each worker node runs:

  • Pods
  • Container runtime
  • Network proxies
  • Node-level agents

🔹 2.1 Kubelet

The agent that runs on every worker node

Responsibilities:

  • Receives Pod definitions from API server
  • Starts containers via container runtime
  • Performs health checks
  • Reports status back to the control plane

Analogy: A local manager following central instructions.

🔹 2.2 Kube-Proxy

Handles networking and forwarding traffic inside the cluster

  • Maintains network rules
  • Handles Service discovery & load balancing
  • Manages cluster IP routing

🔹 2.3 Container Runtime

The actual software that runs containers

Kubernetes supports multiple:

  • containerd
  • CRI-O
  • Docker (deprecated for direct integration)

Role: Pull images, start containers, manage storage & network namespaces.

📦 3. Kubernetes Objects (Running Your Application)

🔹 3.1 Pods

Smallest deployable unit in Kubernetes.

Contains 1 or more containers that share:

  • Networking
  • Storage
  • Lifecycle

🔹 3.2 ReplicaSets

Ensure a specific number of pod replicas always run.

🔹 3.3 Deployments

Most common way to run stateless apps

Provide:

  • Rolling updates
  • Rollbacks
  • Scaling

🔹 3.4 Services

Stable endpoint for connecting to pods.

Types:

  • ClusterIP
  • NodePort
  • LoadBalancer
  • Headless services

🔹 3.5 ConfigMaps & Secrets

Externalize app configuration and sensitive data.

🔹 3.6 Ingress

Layer 7 (HTTP/HTTPS) traffic routing.

🕸️ 4. Kubernetes Networking Model (High Level)

Kubernetes networking ensures:

  • Every Pod gets its own unique IP
  • Pods can talk to each other without NAT
  • Nodes can talk to Pods
  • Services provide stable virtual IPs

Networking is implemented by CNI plugins like:

  • Calico
  • Flannel
  • Cilium
  • Weave

🧩 5. Putting It All Together — How Kubernetes Actually Works

  1. You deploy a YAML saying 3 replicas of nginx.
  2. API Server stores this in etcd.
  3. Scheduler finds suitable nodes for the 3 Pods.
  4. Kubelet on each node pulls images & starts containers.
  5. Kube-Proxy sets up networking & load balancing.
  6. Controllers continuously check:
    • Are 3 pods running?
    • Are they healthy?
    • Is an update rolling out?
  7. If a node crashes:
    • Controller notices
    • Scheduler creates replacement Pods elsewhere
    • Zero manual intervention

This is desired state management — the core of Kubernetes.

🧠 Summary Table (Interview Perfect)

Component Plane Function
API Server Control Cluster entry point, REST API
etcd Control Stores cluster state
Scheduler Control Chooses nodes for Pods
Controller Manager Control Maintains desired state
Cloud Controller Control Cloud integration
Kubelet Worker Runs containers & reports status
Kube-Proxy Worker Networking & load balancing
Runtime Worker Pulls images & runs containers
Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post

MySQL Safe Update Mode

Related Posts