--- title: Kubernetes collection: docker-k8s-fundamentals author: Akash Kadlag updated: 2026-11-18 source: https://docs.chaicode.com/docker-k8s-fundamentals/kubernetes --- # Kubernetes ## **Kubernetes** for Dummies Why it exists, the one idea behind it, and the basic shape — nothing more tonight. **Kubernetes** for Dummies This is the second half of the evening: we have containers, now who runs a fleet of them? Thirteen minutes, basics only. The goal is that Kubernetes stops sounding like magic and the YAML stops looking scary. We will keep coming back to one loop. Everything else is built on it. ## The conductor plays **nothing** The conductor plays **nothing** An orchestra has 60 musicians; the conductor decides who plays what, and when. Which server has room? → Scheduling Who restarts it at 3 AM? → Self-healing Who starts more copies? → Scaling How do we update with zero downtime? → Rolling updates How do services find each other? → Service discovery A container orchestrator does what the conductor does: it runs no app itself, but decides where every container goes and when. Each of its jobs answers one of the five questions from the last slide. Options exist: Kubernetes, Docker Swarm, Nomad, Amazon ECS. Kubernetes became the industry standard, so that is the one we look at. ## Born at **Google**, given to everyone Born at **Google**, given to everyone 2014: Open-sourced by Google, based on its internal system Borg CNCF: Now run by the Cloud Native Computing Foundation, not by Google K8s: K + 8 letters + s. Greek for helmsman - the one who steers the ship Docker + K8s: Docker is the container; Kubernetes steers the ship Google had this pain years before the rest of us, because they were already running containers at huge scale. Kubernetes is what they learned from Borg, given to everyone in 2014. Today it is run by the CNCF. The name is Greek for helmsman. Docker is the container; Kubernetes is the one steering the ship. ## Desired state: a loop that **never** stops Desired state: a loop that **never** stops You declare the goal. Kubernetes keeps making it true. You declare: I want 3 copies of web:1.0. Kubernetes observes 2 running, compares, finds 1 missing, and starts 1. Then it checks again. Forever. Analogy: an AC thermostat. You set 24°C, and it keeps checking and adjusting. You never tell it when to switch the compressor on. If you remember one thing about Kubernetes from tonight, remember this loop. Everything else is built on it. ## Imperative orders vs a **declared** goal Two ways to ask Imperative orders vs a **declared** goal Imperative (old) Start a container. Start another. Watch it. Restart it if it dies. Declarative (K8s) replicas: 3 You describe the goal. Kubernetes keeps making it true. No 3 AM pager for you. The imperative way is a list of orders: start one, start another, watch, restart if it dies. You are the loop. The declarative way is one line, replicas: 3. Kubernetes is the loop. That shift — from giving orders to declaring a goal — is the whole point of the previous slide. ## K8S Vocabulary K8S Vocabulary Pod → Smallest unit, 1+ containers, temporary · one running instance Deployment → Keeps N Pods running, handles updates and rollbacks · a manager keeping headcount Service → A stable address in front of changing Pods · the company's main phone number ConfigMap / Secret → Config kept outside the image · the settings file A Pod is the smallest unit: one or more containers. It is temporary — it can die and be replaced at any time. A Deployment keeps N Pods running and handles updates and rollbacks. Think of a manager keeping headcount. A Service is a stable address in front of changing Pods — the company's main phone number, no matter who picks up. ConfigMap and Secret keep configuration outside the image, like a settings file. ## Architecture at a glance Architecture at a glance Control plane on the left; worker nodes on the right. kubectl talks to the API Server - the front door of the cluster The API Server saves the desired state in etcd, the cluster database The Scheduler picks a node with room for each new Pod The kubelet on that node starts and watches the Pod via containerd kube-proxy routes Service traffic to the right Pods; the Controller Manager loops forever Control plane, the brain: API Server (the front door kubectl talks to), etcd (the database of cluster state), Scheduler (picks a node for each new Pod), Controller Manager (runs the fix-the-difference loops). Worker nodes, the muscle: kubelet (an agent that starts and watches Pods), kube-proxy (routes Service traffic to the right Pods), the container runtime containerd, and the Pods — your app. Nobody needs to memorise these tonight. If late, say only: a brain that decides, and muscles that run your containers. Configuration Slides only, no live cluster. Point at three things: replicas: 3 is the desired state; image: is what we built in the demo; the labels app: web connect the Deployment to its Pods. kubectl apply hands the file to the API Server. kubectl get pods shows the three copies. Delete a pod and a new one appears — that is self-healing, the loop in action. Scale to 5 and the loop makes 5 true. I'm not teaching Kubernetes tonight. I just want this file to stop looking scary. ## A **team**, not rivals Docker vs Kubernetes A **team**, not rivals Build and run containers → Manage containers across machines One machine → A cluster Scaling and healing: manual → Scaling and healing: automatic, declared Best for dev, CI, small apps → Best for production at scale Docker builds and runs containers on one machine; Kubernetes manages containers across a cluster. With Docker, scaling and healing are manual. With Kubernetes they are automatic, because you declared them. Docker is best for dev, CI and small apps. Kubernetes is for production at scale. They are a team. ## Workflow Workflow Build: Build the image with Docker Push: Push it to a registry under a name and tag, like yourname/web:1.0 Run: Kubernetes pulls it and keeps the declared number of copies running This is the whole pipeline in one line: build with Docker, push to a registry, Kubernetes runs it. The image line in the YAML, yourname/web:1.0, is exactly the thing we pushed. Nothing about the image changes between the laptop and the cluster — that is the point of containers. ## Kubernetes is an ocean Kubernetes is an ocean Networking and storage Ingress and Helm Autoscaling and security Monitoring and GitOps... Tonight: why it exists and the basic shape. Still ahead: networking, storage, Ingress, Helm, autoscaling, security, monitoring, GitOps, and more. Kubernetes also has a price: it is complex. That is the new pain it leaves behind. So we don't start here. We get Docker solid first, then come back for this ocean. ## You describe the goal. Kubernetes **observes**, compares and acts and never stops checking. The one thing to remember You describe the goal. Kubernetes **observes**, compares and acts and never stops checking. If you remember one thing about Kubernetes from tonight, remember this loop. Everything else — Deployments, Services, scaling, self-healing — is built on it. You set the thermostat; you do not run the compressor. Kubernetes is the thermostat for your containers. Next step: make Docker second nature, then come back for the rest of the ocean. ## Where to read, play and keep learning Where to read, play and keep learning Three places to go after tonight. Read: docs.chaicode.com Play in the browser: labs.chaicode.com Learn DevOps: ChaiCode DevOps Playlist on **YouTube** Read: docs.chaicode.com Play in the browser: labs.chaicode.com Learn DevOps: ChaiCode DevOps Playlist on YouTube Three places to go after tonight. ## Questions? Questions? Ask anything expect relationship advice. Open the floor. Take questions from the chat. ![A photograph of a young man standing outside in front of a red brick house with text overlaid on him.](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/0c9cc53dbad644c16ef65cda47bb8538c9c951e5cc9dfdb311b9a46482cf6732.png) Meme slide — Ab toh "2027 will be my year" bolne ki bhi himaat nahi hai ## Your Next **Tech Partner** Your Next **Tech Partner** This is the line to land the chapter on: Kubernetes as your next tech partner. Pause on the phrase and let it sit before moving on. Keep it simple here — one statement, no detail; the detail comes in the slides that follow.