Skip to content
5 min read·Lesson 2 of 10

Why Kubernetes?

Understand the production challenges that containers alone can't solve, and how Kubernetes addresses scheduling, healing, scaling, and service discovery.

Docker made it easy to package and run a single container. But running a real production application means running dozens, hundreds, or thousands of containers across many machines — and keeping them running reliably. That's where container orchestration comes in.

The Problems Docker Alone Doesn't Solve

  • Scheduling: On which machine should this container run? What if that machine runs out of memory?
  • Self-healing: If a container crashes, how do you restart it automatically?
  • Scaling: How do you spin up 10 more copies of a service when traffic spikes?
  • Service discovery: Container IP addresses change constantly. How does Service A always find Service B?
  • Rolling updates: How do you update 50 containers without downtime?
  • Load balancing: How do you distribute traffic across multiple container replicas?
  • Storage: How do stateful applications (databases) persist data across container restarts?

Kubernetes solves all of these problems.

What is Kubernetes?

Kubernetes (often abbreviated K8s) is an open-source container orchestration platform. It automates the deployment, scaling, and management of containerised applications across a cluster of machines.

You declare what you want — "run 3 copies of this container, keep them running, expose them on port 80" — and Kubernetes continuously works to make that reality, even when machines fail.

A Brief History

Google built an internal system called Borg to run its massive containerised infrastructure. In 2014, Google open-sourced a new version called Kubernetes. In 2016, it was donated to the Cloud Native Computing Foundation (CNCF), making it vendor-neutral. Today it's the most widely deployed container orchestration platform in the world.

Key Kubernetes Capabilities

  • Bin packing: Automatically place containers on nodes to optimise resource usage
  • Self-healing: Restart failed containers; replace and reschedule on failed nodes
  • Horizontal scaling: Scale replicas up or down, manually or automatically (HPA)
  • Service discovery and load balancing: DNS-based discovery; distribute traffic across replicas
  • Rolling updates and rollbacks: Deploy new versions with zero downtime; rollback if something goes wrong
  • Secret and config management: Inject configuration and secrets without rebuilding images
  • Storage orchestration: Automatically mount storage from cloud providers or local storage

kubectl — The Kubernetes CLI

kubectl is your primary tool for interacting with Kubernetes clusters:

kubectl version                         # check client/server versions
kubectl cluster-info                    # cluster endpoint info
kubectl get nodes                       # list cluster nodes
kubectl get pods                        # list pods in current namespace
kubectl get pods -n kube-system        # pods in kube-system namespace
kubectl describe pod my-pod             # detailed info about a pod
kubectl logs my-pod                     # view pod logs
kubectl exec -it my-pod -- /bin/bash   # shell into a running pod
kubectl apply -f deployment.yaml       # apply a manifest
kubectl delete -f deployment.yaml      # delete resources

Managed Kubernetes Services

Running Kubernetes yourself (kubeadm, kops) requires managing the control plane — a complex task. Managed services handle this for you:

ServiceProvider
Amazon EKSAWS
Google Kubernetes Engine (GKE)Google Cloud
Azure Kubernetes Service (AKS)Microsoft Azure
DigitalOcean Kubernetes (DOKS)DigitalOcean

With managed services, you provision a cluster, and the provider handles control plane availability, upgrades, and patching. You manage your workloads.

Next: a deep dive into how a Kubernetes cluster is structured — the control plane, worker nodes, and key components.

Key Takeaways

  • Running one container on one machine is easy; running hundreds across many machines requires an orchestrator.
  • Kubernetes automates deployment, scaling, self-healing, and service discovery for containerised apps.
  • Kubernetes was created at Google, open-sourced in 2014, and donated to the CNCF in 2016.
  • kubectl is the primary CLI for interacting with a Kubernetes cluster.
  • Managed services (EKS, GKE, AKS) handle the Kubernetes control plane so you focus on workloads.

Test your knowledge

Try exam-style practice questions to reinforce what you've learned.

Practice Questions →