Skip to content
SeeItFlow
Interactive guide · 9 chapters · ~28 min read

Kubernetes Fundamentals

Docker solved packaging a single container. Kubernetes solves the harder problem that shows up once you have dozens of them: scheduling onto machines, restarting what crashes, routing traffic to whichever instance is healthy, and rolling out changes without downtime. This guide covers the cluster, control plane, Pods, Deployments, and Services — the objects that make that automation possible.

Mangesh MandlikLast updated:
01 · Foundations

What Is Kubernetes?

Kubernetes is a system for running and managing containerized applications across a group of machines, automatically keeping them in the state you asked for.

Docker solves how to package and run one container on one machine. Kubernetes solves a different, harder problem: given hundreds of containers that need to run across dozens of machines, how do you decide where each one runs, keep them running when things fail, route traffic to them, and roll out new versions safely — all without a human manually managing every container by hand.

Swipe to pan
Control PlaneAPI Serveretcdstate storeSchedulerControllersWorker NodesNode 1kubeletPods
A Kubernetes cluster: a control plane that makes decisions, and worker nodes that run workloads.

The core building blocks

Cluster

A set of machines (nodes) working together, managed as a single unit by Kubernetes.

Control Plane

The brain of the cluster — makes scheduling and reconciliation decisions, but doesn't run application workloads itself.

Worker Node

A machine that actually runs application Pods, managed by an agent called the kubelet.

Pod

The smallest deployable unit in Kubernetes — one or more tightly-coupled containers that share networking and storage.

Interactive

Visual Learning

Watch one Kubernetes cluster handle deployment, scheduling, self-healing, scaling, rollouts, configuration, storage, traffic routing, and node failure as a single continuous system — not sixteen separate explanations.

Chapter 02

Kubernetes Architecture Diagram

Kubernetes architecture splits every cluster into a control plane that makes decisions and worker nodes that run your application Pods, as the diagram under “What Is Kubernetes?” above shows. The control plane holds the API Server, etcd, the Scheduler, and the Controller Manager. Each worker node runs a kubelet that starts and watches the containers on that machine. The “Cluster Architecture” chapter later in this guide covers each component.

02 · Motivation

Why Orchestration Exists

Docker gave us portable, isolated processes. Kubernetes answers the next question: how do you run thousands of them reliably, at scale, across machines that will inevitably fail?

A single Docker host with a restart policy can recover a crashed container. But it can't recover from the host itself dying, can't intelligently decide which of 50 machines has room for a new container, can't roll out a new version without downtime, and can't automatically add capacity when traffic spikes. These are exactly the problems an orchestrator is built to solve.

Key takeaways
  1. 01Kubernetes doesn't replace Docker — it orchestrates containers (built with Docker or any OCI-compatible tool) across a cluster of machines.
  2. 02The core value is automation of things a human would otherwise do by hand: scheduling, healing, scaling, rolling updates.
  3. 03Kubernetes is declarative — you state desired outcomes, not step-by-step instructions.
03 · The machinery

Cluster Architecture: Control Plane vs Worker Nodes

Every Kubernetes cluster splits cleanly into two halves: a control plane that decides, and worker nodes that execute.

The control plane runs a handful of specialized processes — none of which run your application code. The API Server is the front door: every request, from kubectl, from a CI pipeline, from an internal controller, goes through it and nowhere else. etcd is a distributed key-value store holding the entire cluster's desired state. The Scheduler decides which node a new Pod should run on. Controllers (collectively the Controller Manager) continuously watch for drift between desired and actual state and correct it.

API Server

The only component that talks to etcd directly. Validates and processes all REST requests, and is the single source of truth for "what does the cluster currently think should be running."

etcd

A distributed, consistent key-value store. If etcd is lost, the cluster loses all memory of its desired state — this is why etcd backups are critical in production.

Scheduler

Watches for Pods with no assigned node, filters out nodes that can't run them, scores the rest, and binds the Pod to the best candidate.

Controller Manager

Runs many independent control loops (ReplicaSet controller, node controller, endpoint controller, etc.), each watching one part of the cluster's state and reconciling it toward the desired state.

04 · What actually runs

Pods, Deployments & ReplicaSets

You almost never create a Pod directly in production — you create a Deployment, and Kubernetes manages the Pods for you through a ReplicaSet.

Swipe to pan
Deploymentdesired: v2ReplicaSetreplicas: 3Pod 1Pod 2Pod 3
Deployment → ReplicaSet → Pods: each layer has one job.

Pod

One or more containers that are always scheduled together, share a network namespace (same IP, can talk via localhost), and share storage volumes. Most Pods run exactly one container.

ReplicaSet

Ensures a specified number of identical Pod replicas are running at all times — if one disappears, it creates a replacement.

Deployment

Manages ReplicaSets on your behalf, adding versioned rollouts and rollbacks. Changing a Deployment's Pod template creates a new ReplicaSet and gradually shifts traffic to it.

05 · How things find each other

Services & Networking

Pods are ephemeral and their IPs change constantly — a Service gives applications one stable address to depend on.

Swipe to pan
Clientapp-svc:80ServiceClusterIPPod 1readyPod 2readyPod 3not readyexcluded (not ready)
A Service maintains a live list of ready Pod IPs and load-balances across them.

A Service selects Pods by label (e.g. app: web) and maintains a continuously-updated list of their IPs, called Endpoints. Clients connect to the Service's stable ClusterIP and DNS name; Kubernetes' networking layer (kube-proxy) transparently routes that connection to one of the healthy backing Pods.

ClusterIP

The default Service type — a virtual IP reachable only from inside the cluster, used for internal service-to-service communication.

Labels & Selectors

Arbitrary key-value pairs attached to objects (e.g. Pods). Services, and much of Kubernetes, use label selectors to dynamically decide which objects they apply to.

Service Discovery

The mechanism by which one component finds another's current address — in Kubernetes this is DNS-based: every Service gets a predictable in-cluster DNS name.

06 · Staying up automatically

Self-Healing & Scaling

Kubernetes doesn't just start your application once — it continuously watches and corrects, and can grow or shrink capacity automatically.

If a container inside a Pod crashes, the kubelet on that node restarts it in place according to the Pod's restartPolicy (the Pod object stays). If a Pod itself is lost — its node fails or it is evicted — the ReplicaSet controlling it notices the mismatch between desired count and current count, and creates a replacement, usually on a different node. If an entire node goes down, every Pod on it is eventually rescheduled elsewhere. If CPU load rises, the Horizontal Pod Autoscaler (HPA) can increase the replica count automatically, and scale back down once load subsides.

Swipe to pan
PodsCPU metricsMetrics APIHPA ControllerDeploymentreplica countcontinuous loop: observe → decide → scale → observe again
The HPA continuously compares observed metrics against a target and adjusts replica count.
07 · Configuration & state

Configuration & Persistent Storage

The same container image should run in every environment — configuration differences and durable data are handled through dedicated Kubernetes objects, not baked into the image.

ConfigMap

Stores non-sensitive configuration (feature flags, URLs, log levels) as key-value pairs, injected into Pods as environment variables or mounted files.

Secret

Stores sensitive values (passwords, tokens, keys) similarly to a ConfigMap, but with values base64-encoded in the API object (encoding, not encryption; etcd stores them unencrypted unless encryption at rest is configured) and access-controlled separately via RBAC.

PersistentVolumeClaim (PVC)

A request for durable storage that a Pod can mount — its lifecycle is independent of any single Pod, so data survives Pod recreation.

08 · Letting the outside world in

Ingress & External Traffic

A Service alone gives you internal, IP-based access — Ingress adds HTTP-aware routing (hostnames, paths, TLS) for traffic coming from outside the cluster.

Swipe to pan
UserHTTP requestIngress/api rulesServicePods
Ingress routes based on host/path, then hands off to a Service, which load-balances to Pods.

An Ingress resource defines rules like "requests to /api go to the app-svc Service" or "requests to admin.example.com go to the admin-svc Service." An Ingress Controller (a piece of software running in the cluster) watches these rules and configures a reverse proxy or load balancer accordingly.

Key takeaways
  1. 01Kubernetes orchestrates containers across many machines, adding scheduling, self-healing, scaling and rollouts on top of what Docker alone provides.
  2. 02The control plane (API Server, etcd, Scheduler, Controllers) makes decisions; worker nodes actually run Pods via the kubelet.
  3. 03Deployments manage ReplicaSets, which manage Pods — each layer has one clear job.
  4. 04Services give applications a stable address despite constantly-changing Pod IPs; Ingress adds HTTP-level routing for external traffic.
  5. 05Configuration and secrets are injected, not baked into images; persistent storage is explicitly requested via PVCs so data outlives any single Pod.