What Is Kubernetes
What You Will Learn
- What Kubernetes is and why it exists
- How it relates to running game servers
The Problem Kubernetes Solves
Imagine you are running a multiplayer game. You have one server. Players connect. It works. Then the game gets popular. One server is not enough. Now you need ten servers. You need to decide which server each player connects to. If a server crashes, you need to move players to another one. If you update the game, you need to update all ten servers without kicking everyone off.
That is exactly the problem Kubernetes solves, but for web applications instead of game sessions.
Kubernetes Is a Container Orchestrator
Kubernetes (often shortened to K8s) takes your containers and runs them across multiple machines. It handles:
| Responsibility | What It Does | Game Server Equivalent |
|---|---|---|
| Scheduling | Decides which machine runs each container | Matchmaker assigning players to servers |
| Scaling | Runs more copies when demand increases | Spinning up more game servers at peak hours |
| Self-healing | Restarts containers that crash | Auto-restarting a crashed game server |
| Load balancing | Distributes traffic across copies | Spreading players across available servers |
| Rolling updates | Updates containers without downtime | Patching servers one at a time while others stay online |
The Cluster
A Kubernetes cluster is a group of machines (called nodes) working together. Junovy has one production cluster called dds-prod-de-fsn1. It runs on Hetzner Cloud servers in Falkenstein, Germany. All nodes use the ARM64 architecture.
You do not manage individual servers. You tell Kubernetes what you want (run 3 copies of this app), and it figures out where and how.
You Talk to Kubernetes with YAML
Kubernetes uses YAML files to define what should run. You write a file that says "run this container image, give it this much memory, expose it on this port." Kubernetes reads the file and makes it happen.
You will see a lot of YAML in this book. Here is the good news: the structure is predictable, and you will learn the patterns quickly.
The Key Idea
You describe the desired state ("I want 3 copies of my app running"). Kubernetes continuously works to make the actual state match the desired state. If a container crashes, Kubernetes starts a new one. You do not need to babysit it.
Key Takeaways
- Kubernetes runs containers across multiple machines and manages them automatically
- Think of it as a game server manager that handles scheduling, scaling, and recovery
- You describe what you want in YAML, and Kubernetes makes it happen
What Is Next
Next up: Pods and Deployments where you will learn about the two most important Kubernetes objects and read your first YAML.