
Kubernetes, Part 1: What It Is, How It Differs from Docker Compose, and When You Really Need It
🌐 Machine-translated from Russian. Show original
In this part:
In simple terms#
- A container is an application with all dependencies, packaged in an image. You already know this from Docker.
- Docker Compose — describes multiple containers on one server in a single YAML file.
- Kubernetes (k8s) is an "operating system for a group of servers": you describe what should work ("3 copies of the application available at app.example.kz address"), and Kubernetes decides where to start containers, restarts the downed ones, moves them from the failed server, and updates without downtime.
The key idea is declarativeness: you store the desired state in YAML, and Kubernetes constantly brings reality to it.
How a cluster is structured#
| Part | What does |
|---|---|
| Control plane | API server, scheduler, controllers, state store**, etc** |
| Worker nodes | run containers: kubelet, container runtime environment, network proxy, |
| kubectl | console client: all commands go through the |
| CNI | network between pods at different nodes |
| CSI | connecting disks and storage |
| Ingress / Gateway | HTTP(S) traffic input from outside |
Docker Compose or Kubernetes#
| Docker Compose | Kubernetes | |
|---|---|---|
| Servers | one | from one to hundreds of |
| Server failure | application lies idle until | containers move to other nodes (if there are several nodes) |
| Updating without downtime | manually, scripts | built-in: rolling update, rollback with a single command |
| Scaling | manually | a single command or automatically by load |
| Entry threshold | evening | week to confidently operate |
| Resources for "binding" | almost zero | 0.5–1 GB of RAM per node for service components |
| Who is suitable | 1–2 servers, a small team, | many services, multiple servers, availability requirements, |
When Kubernetes is not needed#
- One or two apps on one server, and 10-minute downtime during updates doesn't bother anyone.
- There is no one who will understand the cluster and be responsible for it. Kubernetes without a host is worse than Compose with a host.
- The main system is 1C, AD, and file servers. They live in virtual machines, not containers.
- Databases "because everything is in k8s." A DBMS in Kubernetes is possible (part 4), but requires experience; a standalone VM with PostgreSQL is often easier — see the "PostgreSQL for Administrator" series.
When Kubernetes is justified#
- A dozen or more services, each with its own versions and updates.
- Work without downtime is needed when the server fails and when new versions are uploaded.
- Multiple development teams share a single infrastructure.
- I want a single way to deploy: test, pre-product, and prod are described the same way and lie in Git.
Which Kubernetes to Choose#
| Variant | What is | When to take |
|---|---|---|
| k3s | a lightweight certified distribution, one binary, set by one command | learning, one server, small clusters, branches — we take this series |
| kubeadm | the official vanilla-cluster building tool | want to understand every component, large clusters, |
| RKE2, Talos, other distributions, | ready-made builds focused on security or immutable OS | production once you have mastered the basics of |
| Managed Kubernetes in the cloud | control plane is served by a provider | no desire to serve management nodes (part 6) |
| minikube, kind | cluster on a laptop | only for development and experimentation |
k3s is full-fledged Kubernetes: the same manifests, the same kubectl, the same Helm. Everything you learn on it works in any other cluster.
What you'll need for the series#
- Server or VM with Ubuntu Server 24.04: minimum 2 vCPUs, 4 GB RAM, 40 GB SSD (k3s itself requires at least 2 cores and 2 GB, the rest for applications). Installing Ubuntu is in the "Linux Server and KVM" series.
- For part 5 — another 2–4 such VMs.
- Knowledge of Docker: images, registry, environment variables, volumes.
- For HTTPS — a domain and the ability to create a DNS record.
Series Dictionary#
| Object | Analog in Docker Compose |
|---|---|
| Pod | one or more containers running together |
| Deployment | service with replicas and update rules |
| Service | a permanent name and address within the cluster (as a service name in a compose network) |
| Ingress | reverse proxy (nginx/Traefik) before |
| ConfigMap / Secret | environment: and configuration files / secrets |
| PersistentVolumeClaim | named volume volumes: |
| Namespace | a separate compose project |
Comments · 0
No comments yet.Sign in to comment, rate and see all comments.