5 min read
Illustration of a ship helm wheel with a red hub
Image credits · Illustration: Global Pulse Daily

What Is Kubernetes? A Plain-English Guide for Beginners

Kubernetes places containers on machines, restarts them when they fail and rolls out updates, so you declare the result you want and the system works to keep it.

In short

Kubernetes is an open source system that runs and manages containers across many machines. You declare the state you want, such as three copies of an app, and Kubernetes schedules them, restarts failures, balances traffic and rolls out updates to keep reality matching that declaration.

Table of contents 7 sections
Key takeaways
  • Kubernetes is an open source system that schedules and manages containers across a cluster of machines.
  • You declare the desired state, and controllers keep working to make the real state match it.
  • A cluster has a control plane that makes decisions and worker nodes that run Pods, the smallest deployable units.
  • Deployments update apps with rolling updates that, by default, keep at least 75 percent of the desired Pods up.
  • It suits many services and teams, but a single app on one server usually needs something simpler.

What is Kubernetes? It is an open source system that runs containers across a group of machines and keeps them in the state you asked for, restarting what fails, spreading the load and rolling out new versions without taking an application offline. A container is an application packaged with everything it needs to run, and Kubernetes, often written K8s, is the manager that decides where all those containers live.

What is Kubernetes and where did it come from?

Google open sourced the project in 2014. The Kubernetes documentation says it combines more than 15 years of Google's experience running production workloads at scale with ideas from the wider community. The name comes from the Greek word for helmsman or pilot, and K8s is shorthand for the eight letters between the K and the s.

The project joined the Cloud Native Computing Foundation in 2016 and reached its highest maturity level, graduated, in March 2018. Because no single company owns it, the big cloud providers all sell managed versions of it.

What problem does Kubernetes solve?

Running one container on a laptop is simple. Running hundreds across dozens of servers is not. Someone has to decide which machine has spare capacity, replace whatever fails overnight, ship new versions without downtime and route each request to a healthy copy of the service.

Kubernetes automates those jobs. Its documentation lists service discovery and load balancing, automated rollouts and rollbacks, self-healing, secret management and automatic bin packing, which means fitting containers onto machines so that capacity is used well. For the power side of running that hardware, see our look at data center energy demand.

How does a Kubernetes cluster work?

A cluster consists of a control plane and one or more worker nodes. The control plane makes decisions. The nodes, which can be physical or virtual machines, run the workloads. The main parts are:

  • API server: the front door; every command and every component talks to the cluster through it.
  • etcd: a consistent key-value store that holds the cluster's data.
  • Scheduler: assigns each new Pod to a suitable node.
  • Controller manager: runs the controllers that push the cluster toward the state you declared.
  • Kubelet: an agent on each node that makes sure the Pods assigned to it are running.

Each node also runs a container runtime, the software that actually starts containers, and, in most clusters, kube-proxy, which maintains the network rules that let Services work. Kubernetes talks to runtimes through a standard interface, so containerd and CRI-O are both common choices.

A Pod is the smallest deployable unit: one or more containers that share storage and network resources. You rarely create Pods directly. You describe them inside a higher-level object instead.

What does desired state mean?

You do not tell Kubernetes to start a container. You declare an outcome, usually in a YAML file, such as "run three copies of this image." Controllers then compare what exists with what you declared and act on any gap. If a node dies and takes a Pod with it, the missing copy shows up as a difference and a replacement is scheduled elsewhere.

A handful of objects cover most beginner needs:

  • Deployment: keeps a set number of identical Pods running and manages updates.
  • Service: gives a group of Pods one stable address and spreads traffic across them.
  • ConfigMap and Secret: hold settings and sensitive values outside the container image.
  • Namespace: splits one cluster into separate areas for teams or environments.

How does Kubernetes update an app without downtime?

Changing the image in a Deployment triggers a rolling update. By default, the Deployment documentation explains, Kubernetes keeps at least 75 percent of the desired Pods up and allows at most 125 percent to exist at once. That is a 25 percent limit on both missing and surplus Pods, so a few Pods are swapped at a time while the rest keep serving traffic.

A rollout whose new Pods never become healthy stalls instead of replacing everything, and the previous version can be restored with the kubectl rollout undo command. Rolling updates only work well if each Pod reports honestly when it is ready, so health checks deserve as much care as the application code.

Scaling works the same declarative way. Change the number of replicas in the Deployment, or let an autoscaler adjust it based on CPU use, and the controllers add or remove Pods until the count matches.

What is Kubernetes not suited for?

It is built for many services, several teams, and workloads that must scale and recover without a human. For one application on one server it adds more machinery than it saves. The documentation is explicit that Kubernetes is not a traditional all-inclusive platform as a service: it does not build your application, and it does not ship databases, caches or message buses as built-in services.

Simpler options exist. You can run Docker Compose on a single host, or use a managed platform of the kind compared in IaaS vs PaaS vs SaaS. If you do want Kubernetes without running the control plane yourself, Amazon EKS, Google Kubernetes Engine and Azure Kubernetes Service run the control plane for you.

How to start learning Kubernetes safely

  1. Learn containers first: build an image, run it locally and understand what a registry is.
  2. Create a local practice cluster with a tool such as minikube or kind, so a mistake costs nothing.
  3. Write a Deployment and a Service, apply them with kubectl apply, then delete a Pod by hand and watch the replacement appear.
  4. Try an update and a rollback to see rolling updates in action.
  5. For anything real, prefer a managed service, restrict who can reach the API server, and protect the cloud account that controls the cluster with two-factor authentication.
  6. Remember that Secrets are stored unencrypted in etcd by default, so enable encryption at rest and limit who can read them.

Decide by pain, not by fashion. If deployments, scaling and recovery are already causing trouble, Kubernetes is worth the learning curve. If they are not, wait.

Frequently asked

Sources
  1. Overview: What is Kubernetes? — Kubernetes Documentation
  2. Kubernetes Components — Kubernetes Documentation
  3. Deployments — Kubernetes Documentation
  4. Kubernetes project page — Cloud Native Computing Foundation
Written by Said Dulevic

Our international desk covers the infrastructure, policy and people behind the technology shaping the world. Tips and corrections: newsroom@globalpulsedaily.com

More from this author

0 comments

Never published.
A quick check that you are not a script.
Comments are moderated. Links, contact details and abuse are removed.

No comments yet — be the first.