Stop 16 · Docker & ContainersTopics · 9/9

Kubernetes Basics (Overview)

Part of the Backend Developer Roadmap

In short

Docker runs containers on one machine. When you have dozens of containers across many machines, something must restart crashed ones and spread the load. That's Kubernetes.

A container orchestration platform for automatically deploying, scaling and managing containerized applications across a cluster of machines — the industry standard for large-scale container deployments.

The blob with a clipboard and whistle waves in a fresh scooter rider to replace one that broke down.

Think of it like this

The delivery fleet manager

A food delivery fleet manager doesn't ride himself. His rule is 'always keep five riders on the road'. A scooter breaks down? He sends a fresh rider at once. Big cricket final tonight? He adds more. Kubernetes manages containers with exactly that kind of rule.

Watch it happen

Inside a small cluster

Cluster
Control plane
Node 1
Node 2
Pod api-1
Pod api-2
Pod api-3

1/5A cluster is a group of machines that Kubernetes treats as one big pool.

The big ideas

What you need to know

Declarative

You don't say 'start a container'. You declare 'I want 3 copies of this image', and Kubernetes keeps it true.

Pods, Deployments, Services

A pod runs containers. A Deployment keeps N pods running. A Service gives them one stable address.

Self-healing and rollouts

Crashed pods are replaced, and new versions roll out a few pods at a time so users don't see downtime.

Often more than you need

For a student project or a small startup, a PaaS or one VM with Compose is simpler. Learn the ideas first.

See it in code

Walk through the code

yaml
1apiVersion: apps/v12kind: Deployment3metadata:4  name: chai-api5spec:6  replicas: 37  selector:8    matchLabels: { app: chai-api }9  template:10    metadata:11      labels: { app: chai-api }12    spec:13      containers:14        - name: api15          image: ghcr.io/riya/chai-api:1.4.016          ports: [{ containerPort: 3000 }]

1/4This object is a Deployment named chai-api.

Apply it with kubectl apply -f deployment.yaml, then kubectl get pods. Delete a pod and watch a new one appear within seconds.

Save yourself the pain

Common mistakes

Oops

Jumping into Kubernetes before you're comfortable with Docker and Compose.

Do this instead

Kubernetes runs containers. Get images, ports, env vars and volumes solid first.

Oops

Treating pods as permanent servers you can log into and patch.

Do this instead

Pods are replaced all the time. Change the YAML or image and let Kubernetes roll it out.

Your mission

A local cluster in 30 minutes

~35 min

Quick check

Your Deployment says replicas: 3 and one pod crashes. What does Kubernetes do?

Go deeper

  1. 1Read a high-level overview of Kubernetes' core objects: Pod, Deployment, Service.
  2. 2Understand Kubernetes solves problems (auto-scaling, self-healing, rolling updates) that a single `docker run` doesn't.
  3. 3Recognize this is a deep topic on its own — early-career backend devs mostly need conceptual familiarity, not deployment expertise.

More topics at this stop

Stuck on this topic? Ask an Insider

Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.

Download
InsideEdge