On this page
What Is Kubernetes and Why Does My App Need It?
Kubernetes schedules and runs containerized apps across many machines, handling scaling and self-healing. Learn what it does and when you don't need it.
Quick answer
- Kubernetes is a system that runs containerized applications across many machines and keeps them running.
- You describe the desired state (how many copies, what image, what ports), and Kubernetes makes the cluster match it.
- For a single small app, it is usually overkill; its value appears with scale, multiple services, and high availability.
What is Kubernetes?
Kubernetes (often “k8s”) is an open-source container orchestrator originally built at Google. It schedules containers onto a cluster of machines, restarts them when they fail, balances traffic, and scales them up or down. You submit a declarative description of what you want running, and a control loop continuously reconciles the cluster to match that description.
How does Kubernetes work?
The basic units are a pod (one or more containers that share a network and storage), a node (a machine that runs pods), and a cluster (a set of nodes). A Deployment object declares how many replicas of a pod you want and which container image to run; a Service exposes those pods to the network. The control plane watches these objects and constantly drives the real state toward the desired state — the same reconciliation idea behind GitOps.
Why does Kubernetes matter?
Kubernetes gives you self-healing (failed pods are replaced), horizontal scaling (add replicas under load), and rolling updates (new versions replace old ones without downtime). It also standardizes deployment across clouds. Those benefits come at a real cost: an entire control plane and a steep learning curve that a single small app rarely justifies.
Where this bites vibecoders
The vibecoder failure mode is adopting Kubernetes before the app needs it — “the AI suggested it, so I ran it” — and then paying for a managed cluster plus an afternoon of YAML debugging to serve a few requests per day. The right question is not “how do I run Kubernetes?” but “do I need it at all?” A managed container service or even a single VM often serves an early product better.
Where AI coding assistants get this wrong
- Generating
latestimage tags so rolling updates can’t be reliably reproduced or rolled back. - Writing Deployments with no resource requests and limits, so one pod can starve the node.
- Exposing services with wrong selectors or ports, producing a “deployed but unreachable” mystery.
- Skipping readiness probes, so traffic is sent to pods that haven’t finished starting.
Checklist
- Justify Kubernetes before adopting it; don’t reach for it by default.
- Always pin container image tags, never
latest. - Set CPU/memory requests and limits on every container.
- Add liveness and readiness probes to every workload.
- Expose pods only through Services, never by pod IP directly.
FAQ
What is a pod?
A pod is the smallest deployable unit in Kubernetes: one or more containers that share a network namespace and storage, and are scheduled together on the same node. Most pods run a single container.
Do I need Kubernetes for a small app?
Usually not. For one service with modest traffic, a managed container service or a virtual machine is simpler and cheaper. Kubernetes earns its keep with multiple services, scaling, or the need to run identically across environments.
What is the difference between Docker and Kubernetes?
Docker builds and runs individual containers on one machine. Kubernetes orchestrates many containers across many machines — scheduling, networking, and healing them. They solve different problems and are often used together. See Docker vs Podman.
Related topics
- How to Deploy Your First App to Kubernetes
- Docker vs Podman: What’s the Difference?
- What Is a Service Mesh?
- What Is GitOps?