Skip to content
Open Sourcebeginner

What is Kubernetes?

Updated Nov 30, 20263 min readBased on official documentation
What is Kubernetes?

In short

Kubernetes is an open source platform that runs and manages containerized applications across a group of machines. It restarts failed containers, spreads traffic between them, scales them up or down, and rolls out new versions with control. Google open sourced it in 2014.

The problem Kubernetes solves

A container is a package that holds an application together with everything it needs to run. Containers are easy to create and move around. Running many of them in production is harder. Someone has to start them, watch them, replace the ones that fail, and send users to the right place.

Kubernetes takes on that work. You describe how your application should look, and Kubernetes keeps the running system close to that description. If a container stops, Kubernetes starts another one. If traffic grows, it can spread the load across more copies.

The name comes from Greek and means helmsman or pilot. People often shorten it to K8s, because there are eight letters between the "K" and the "s". Google open sourced the project in 2014. It builds on many years of Google's experience running large production workloads.

How it works

You give Kubernetes a cluster, which is a set of machines called nodes. You then tell it what you want to run. Kubernetes places the containers on the nodes, using the CPU and memory limits you set for each one.

The key idea is desired state. You write down the state you want, such as "three copies of this web app are running." Kubernetes compares that with what is actually running and makes changes until the two match. It does this continuously, not just once.

Kubernetes offers a range of built-in features:

  • Service discovery and load balancing, so containers can be reached by a DNS name or an IP address, with traffic shared between them.
  • Storage orchestration, so you can attach a storage system of your choice, such as local disks or a public cloud service.
  • Automated rollouts and rollbacks, so new versions replace old ones at a controlled pace.
  • Self-healing, so failed containers are restarted and containers that do not pass your health check are replaced.
  • Secret and configuration management, so passwords and keys can be stored apart from your container images.
  • Horizontal scaling, so you can add or remove copies with a single command or automatically based on CPU use.

Why containers needed a system like this

The way applications have been run has changed over time. First, applications ran on physical servers, but one busy application could starve the others. Running each app on its own server wasted resources and cost a lot. Virtual machines helped by splitting one physical server into several isolated machines. Each virtual machine, though, carries a full operating system, which makes it heavy.

Containers share the host operating system while keeping their own filesystem, processes, and resource limits. That makes them lightweight and portable across clouds and operating systems. Once you have many containers, though, you need a way to manage them. That is the gap Kubernetes fills.

What Kubernetes is not

Kubernetes is not a complete platform-as-a-service that builds your code and handles everything for you. It works at the container level. It does not build your application, and it does not provide databases, message buses, or caches as built-in services. Those can run on Kubernetes or be reached from it, but you choose and install them.

It also does not decide how you do logging, monitoring, or alerting. It offers some integrations and ways to collect metrics, and you can plug in the tools you prefer.

Kubernetes is more than a simple orchestration tool. Classic orchestration follows a fixed script: do A, then B, then C. Kubernetes instead runs many small control loops that each push the system toward the desired state. This makes it flexible and more resilient when things go wrong. If you want to learn more, see our page on Docker for background on containers.

Common mistakes for beginners

Beginners often expect Kubernetes to replace all their tooling. It does not. You still need to build container images and decide how code gets deployed. Another common mistake is skipping resource requests and limits. Without them, Kubernetes cannot place containers well, and one busy container can still crowd out the others.

A third mistake is treating Kubernetes as a single product. It is better to see it as a platform with many parts. The official overview suggests starting with the Kubernetes components, the Kubernetes API, the kubectl command line tool, and the cluster architecture.

Alternatives and next steps

If you only run one small app on one machine, Kubernetes may be more than you need. Simpler options, such as running a single container directly or using a managed service from a cloud provider, can be enough. Kubernetes shines when you run many services that must stay up and scale with demand.

To get started, read the official overview at https://kubernetes.io/docs/concepts/overview/ and then look at kubectl, the main command line tool for working with a cluster.

FAQ

Is Kubernetes the same as Docker?

No. Docker is a tool for building and running containers on a single machine. Kubernetes manages many containers across a cluster of machines and can run containers created by different tools.

Do I need Kubernetes for a small website?

Usually not. A single server or a simple managed hosting service is often enough. Kubernetes becomes useful when you run many services that need to scale and recover automatically.

Why is it called K8s?

K8s is a short form. It counts the eight letters between the K and the s in Kubernetes.

Who created Kubernetes?

Google started the project and open sourced it in 2014. It draws on Google's experience running production workloads at large scale.

What does Kubernetes do when a container fails?

It restarts the failed container or replaces it. It also stops sending traffic to containers that do not pass the health checks you define.

Sources

This page is based on the official documentation below. Read it for full detail.

Kubernetes — official documentation ↗

Kubernetes in the news

blozhikDeveloper news from across the web, explained. Every story links to its original sources.