# What Kubernetes Does — Kubernetes

Source: https://www.skillbyai.com/en/kubernetes/i-what

> An operating system for a cluster.

## Scheduling, healing, scaling, networking

**Kubernetes** is an open-source system for running containerised applications across a cluster of machines. You declare what should run (images, replica counts, resources, configuration), and Kubernetes **schedules** containers onto nodes, **restarts** failed ones, **replaces** pods on failed nodes, **scales** them, gives them stable **networking** and service discovery, and rolls out new versions gradually. It is powerful but complex; for a single small app, a simpler platform (a managed container service or PaaS) may be a better choice.

## Desired state, continuously enforced

Kubernetes runs containers across machines and keeps reality matching what you declared.

![Three ideas: what Kubernetes does, architecture, declarative objects.](assets/figures/kubernetes/section-1-map.svg) — Figure 1.1 — Purpose, architecture and objects.

## A thermostat

You set the desired temperature; the thermostat keeps measuring and switching the heating on or off to hold it. Kubernetes controllers do the same for your workloads.

## Use a managed cluster

Managed offerings (EKS, GKE, AKS and others) run the control plane for you; self-managing it is a significant operational job.

**Quiz:** What does Kubernetes do when a pod's node fails?

- [ ] Deletes the Deployment
- [ ] Nothing until an admin intervenes
- [x] Creates replacement pods elsewhere to restore the desired count
- [ ] Shuts down the cluster

*Answer:* Creates replacement pods elsewhere to restore the desired count. Controllers reconcile toward desired state.
