Introduction to Kubernetes
Learn what Kubernetes is, why it exists, and how it solves container orchestration at scale with real-world examples.
What Is Kubernetes?
Kubernetes, often shortened to K8s, is an open source platform for running and managing containers across a cluster of machines. It helps you deploy applications, keep them healthy, scale them up or down, and roll out changes without logging into every server by hand.
Think of it like a city traffic control system for containers. Instead of every car choosing roads randomly, Kubernetes coordinates where things go, how they recover from problems, and how traffic keeps moving.
Why Kubernetes Exists
Running one container on one machine is easy. Running hundreds of containers across many machines is where things get messy.
Kubernetes solves problems like:
- Scheduling containers onto available machines
- Restarting failed workloads automatically
- Scaling replicas when demand changes
- Service discovery so apps can find each other
- Rolling updates without long downtime
- Declarative management so you describe the desired state and Kubernetes works toward it
A Real-World Example
Imagine an online store with a web app, API, payment service, and database. During a sale, traffic spikes fast. Without orchestration, an engineer may manually start more containers and rewire networking. With Kubernetes, you define the desired state once and let the platform handle placement, restarts, and networking.
Kubernetes vs Docker Compose
Docker Compose is great for local multi-container development. Kubernetes is built for cluster-scale operations.
| Topic | Docker Compose | Kubernetes |
|---|---|---|
| Typical use | Local dev and small setups | Production and large environments |
| Scaling | Basic manual scaling | Rich autoscaling and self-healing |
| Networking | Simple service network | Cluster-wide service discovery |
| Scheduling | Single host | Multi-node cluster |
| Rollouts | Limited | Built-in rolling updates and rollbacks |
| Health checks | Basic | Probes, controllers, and reconciliation |
When to Use Which
Use Docker Compose when you want to start a few related containers on one machine.
Use Kubernetes when you need resilience, scaling, repeatable deployments, and multi-node coordination.
Core Kubernetes Terms
Cluster
A cluster is the full Kubernetes environment: control plane plus worker nodes.
Node
A node is a machine in the cluster. It can be a VM or a physical server.
Pod
A pod is the smallest deployable unit in Kubernetes. It usually holds one container, but it can hold more.
Deployment
A Deployment manages a desired number of pod replicas and supports rolling updates.
Service
A Service gives pods a stable network identity so other workloads can reach them even when pod IPs change.
High-Level Architecture
At a high level, Kubernetes splits responsibility between the control plane and worker nodes.
- The control plane decides what should run and where
- The worker nodes actually run your containers
Control Plane
API Server
Entry point for all requests
etcd
Cluster state store
Scheduler
Assigns pods to nodes
Controller Manager
Reconciles desired state
Cloud Controller Manager
Integrates with cloud providers (AWS, GCP, Azure)
Worker Nodes
Node 1
kubelet
Node agent
kube-proxy
Network rules
Container Runtime
containerd / CRI-O
Pod
Pod
Node 2
kubelet
Node agent
kube-proxy
Network rules
Container Runtime
containerd / CRI-O
Pod
Pod
Node 3
kubelet
Node agent
kube-proxy
Network rules
Container Runtime
containerd / CRI-O
Pod
Pod
Why This Split Matters
The control plane acts like the brain. Worker nodes act like the muscles. Separating those roles makes Kubernetes easier to scale and operate.
Companies That Use Kubernetes
Kubernetes is widely used by companies that need reliable, repeatable infrastructure at scale.
| Company | Common reason for using Kubernetes |
|---|---|
| Large-scale workload orchestration | |
| Spotify | Microservices deployment and automation |
| Airbnb | Standardized platform operations |
| Shopify | Scaling production services during traffic spikes |
| CERN | Running large scientific workloads |
That does not mean Kubernetes is only for giant companies. Small teams also use it to standardize environments and reduce manual ops work.
What You Should Remember
Kubernetes is not just a way to run containers. It is a platform for managing the full lifecycle of containerized applications in a reliable, declarative way.
It becomes valuable when you care about:
- uptime
- repeatability
- scaling
- recovery from failure
- safe application updates
Kubernetes Purpose
What problem is Kubernetes mainly designed to solve?
Compose vs Kubernetes
Why do many teams move from Docker Compose to Kubernetes in production?