Kubernetes
- Pronunciation
- KOO-ber-NET-eez
In short
Kubernetes is an open-source system that automates deploying, scaling, and managing containerized applications across a cluster of machines.
What is Kubernetes?
Kubernetes, often shortened to K8s, is a container orchestration platform. When an application runs as many containers across many servers, Kubernetes decides where each container runs, restarts containers that crash, scales them up or down with demand, and routes network traffic to them. It was originally created at Google and is now maintained by the Cloud Native Computing Foundation (CNCF).
Kubernetes is declarative: you describe the desired state in YAML files, such as 'run three copies of this web app', and Kubernetes continuously works to make reality match that description. Its key building blocks are pods (the smallest unit, one or more containers that run together), deployments (which manage copies of pods and roll out updates), and services (stable network addresses for a group of pods).
A good analogy is an orchestra conductor, which is where the word orchestration comes from. The musicians (containers) play the music, while the conductor makes sure the right number are playing, replaces anyone who stops, and keeps everything in sync. Major cloud providers offer managed Kubernetes services, so teams don't have to run the cluster's control plane themselves.
Kubernetes is often compared with Docker, but they solve different problems: Docker builds and runs individual containers, while Kubernetes manages many containers across a cluster. Kubernetes is powerful but complex, so small projects often do fine with simpler options such as Docker Compose, a platform as a service, or serverless hosting.
At a glance
Key takeaways
- Kubernetes orchestrates containers across a cluster of machines.
- You declare the desired state in YAML, and Kubernetes keeps it that way.
- Pods, deployments, and services are its core building blocks.
- It handles scaling, self-healing, rolling updates, and load balancing.
- K8s is short for Kubernetes: a K, eight letters, then an s.
Example
apiVersion: apps/v1
kind: Deployment
metadata:
name: web
spec:
replicas: 3 # keep three copies of the container running at all times
selector:
matchLabels: { app: web }
template:
metadata:
labels: { app: web }
spec:
containers:
- name: web
image: example/web:1.0Readers ask
What is the difference between Docker and Kubernetes?
Docker is used to build container images and run containers, typically on one machine. Kubernetes runs and manages many containers across many machines, handling scheduling, scaling, and recovery, and it can run images built with Docker.
Why is Kubernetes called K8s?
K8s is a numeronym: the 8 stands for the eight letters between the K and the s in Kubernetes. The name itself comes from the Greek word for helmsman or pilot.
Do I need Kubernetes?
Not always. Kubernetes pays off when you run many services that need automated scaling and high availability; for a single small app, a simpler hosting platform or Docker Compose is usually enough.
Often compared
- Docker vs KubernetesDocker builds container images and runs containers on one machine, while Kubernetes runs them across a cluster, handling scheduling, scaling and self-healing.
- Docker Compose vs KubernetesDocker Compose runs a multi-container app on a single machine, while Kubernetes orchestrates containers across a cluster with scaling and self-healing.
See also
- ContainerDevOps & Cloud, p. 12A container is a lightweight, isolated package that bundles an application with its dependencies and runs it on the host's shared operating system kernel.
- DockerDevOps & Cloud, p. 17Docker is an open-source platform for packaging an application and everything it needs into a container that runs the same way on any machine.
- Load BalancerDevOps & Cloud, p. 34A load balancer is a server or service that spreads incoming traffic across several backend servers so no single one is overloaded and the app stays available.
- DevOpsDevOps & Cloud, p. 14DevOps is a set of practices and a culture that brings software development and IT operations together to deliver software faster and more reliably.
- MicroservicesSoftware Architecture, p. 27Microservices are an architectural style where an application is split into small, independently deployable services that communicate over a network.
- CI/CDDevOps & Cloud, p. 9CI/CD is a set of automated practices that build, test, and release code changes frequently, so software can be delivered to users quickly and safely.
- HelmDevOps & Cloud, p. 26Helm is the package manager for Kubernetes: it bundles an app's configuration files into a chart you can install, upgrade and roll back with one command.
- kubectlDevOps & Cloud, p. 31kubectl is the command-line tool for Kubernetes: it sends requests to a cluster's API server to deploy applications, inspect them and change them.
Sources
Spotted a mistake or something missing on this page?Suggest an edit