What happens when you run kubectl apply
Kubernetes: why one server is not enough to keep an app online
An app runs on one server. If the server stops, the app stops too. If it stops on a Sunday night, the website stays down until somebody wakes up. Kubernetes was built for this problem.
-
1
Take one small app: the menu page of a café.
-
2
You built it for Rono, who runs the café. It lives on a server, a computer that stays on day and night.
-
3
One Sunday, the server stops, and your app with it. Miva, a regular, opens the menu on her phone and gets an error.
-
4
So you run 3 copies on 3 servers, and when one stops, the others keep the menu online. But someone must start a new copy, at any hour: you.
-
5
Kubernetes is software made for that job. It runs on a group of servers, and you only say how many copies you want.
-
6
When a server stops, Kubernetes sees 2 copies where you asked for 3 and starts a new one elsewhere. Nobody wakes you up.
-
7
One thing is still open: your app never runs alone. It needs other software, and each server would need it too.
-
Quick check
Rono expects a big crowd this week.
Show the answer
It starts 2 more copies. Kubernetes keeps the number you ask for, whether a server stops or you change the number.
-
Go further
Where the name comes from, and a word for that Sunday.