Cloud & Data Centers

Kubernetes Explained for Non-Operators

Get a plain picture of what Kubernetes does, the words your engineers use, what it costs to run and when you don't need it.

Key takeaways

  • Kubernetes automates placing, restarting, scaling and updating containers across many machines.
  • You describe the desired state, and software loops continually work to make reality match it.
  • The core ideas are clusters, nodes, pods, deployments and services.
  • It brings real resilience and consistency, but it also demands skills, upkeep and attention to cost.
  • Small or simple applications are often better served by a managed platform or a few virtual machines.

Kubernetes is open-source software that runs containers across a group of machines and keeps them in the state you asked for. You declare something like "run three copies of this web service," and Kubernetes places them, restarts any that fail and replaces them when you ship a new version.

If you manage, fund or work alongside a team that uses it, you don't need to memorize commands. You need a mental model, enough vocabulary to follow a discussion and a sense of the costs. That's what this guide gives you.

The problem it solves

A container packages one application with what it needs to run, as covered in virtual machines vs. containers. Running one container on one server is easy. Running two hundred across thirty servers raises questions fast. Which server has room? What restarts a crashed copy at three in the morning? How do other services find a container whose address keeps changing? How do you release a new version without an outage?

You could answer each with custom scripts. Kubernetes is a shared, standard answer. It started from work at Google and is now maintained as an open project under the Cloud Native Computing Foundation. People often shorten the name to K8s.

Desired state: the central idea

Most older tooling is imperative: do this, then do that. Kubernetes is mainly declarative. You write down what should exist, usually in a text format called YAML, and submit it. Components inside the system compare the desired state with the actual state and act on any difference. This repeats continuously.

So if a machine dies and takes two copies of your service with it, nobody has to issue a command. The system notices that it wants three copies and has one, and it starts two more on healthy machines.

The reconciliation loop
Act Start, stop or replace containers to close the gap. Compare Any gap between wanted and actual is identified. Declare A person or pipeline states what should be running. Observe Controllers check what is actually running. 1 2 3 4 Declare A person or pipeline states what should be running. 1 Observe Controllers check what is actually running. 2 Compare Any gap between wanted and actual is identified. 3 Act Start, stop or replace containers to close the gap. 4

Many controllers run loops like this at once.

The vocabulary you'll hear

Cluster. The whole system: a set of machines managed together.

Node. One machine in the cluster, physical or virtual. Worker nodes run your applications.

Control plane. The management components that accept your instructions, store the desired state, decide where things run and run the controllers.

Pod. The smallest unit Kubernetes schedules. A pod holds one container, or a few that must live together and share networking. Pods are disposable.

Deployment. A description of how many identical pods should run and which image they use. It handles gradual rollouts and rollbacks.

Service. A stable name and address in front of a changing set of pods, so other programs can reach them.

Ingress or Gateway. Rules for letting web traffic from outside reach services inside.

Namespace. A way to divide a cluster into named areas, for example by team or environment.

ConfigMap and Secret. Settings and sensitive values supplied to applications at run time. Secrets need extra protection; by default their values are only encoded, which isn't the same as encrypted.

Persistent volume. Storage that outlives any particular pod.

From cluster down to your code
Cluster Control plane plus worker machines, managed as one system. Node A single machine that offers processor, memory and storage. Pod The scheduled unit, usually wrapping one container. Container Your application and its libraries, built from an image. Cluster Control plane plus worker machines, managed as one system. Node A single machine that offers processor, memory and storage. Pod The scheduled unit, usually wrapping one container. Container Your application and its libraries, built from an image.

What happens during a release

Say your team has built version two of a checkout service. They update the deployment to point at the new image. Kubernetes starts a new pod, waits for it to report that it's ready, adds it to the service and then removes an old pod. It continues until all copies run the new version. If new pods keep failing their health checks, the rollout stalls instead of replacing everything, and the team can roll back.

This only works as well as the health checks. If an application reports "ready" before it can really handle requests, users will see errors during releases. Database changes need separate care too, because old and new versions run side by side for a while.

Scaling and self-healing, with limits

Kubernetes can add pods when load rises and remove them when it falls. With a cloud provider, it can also add and remove nodes. It restarts containers that crash and reschedules pods from failed machines.

It can't fix a bug, make a slow database faster or protect you from a bad configuration that it faithfully applies. If a program crashes every time it starts, Kubernetes will keep restarting it, with growing pauses between attempts. Engineers call that state a crash loop. Scaling out also helps only when the application is designed so that copies can share work, as discussed in scaling up vs. scaling out.

What it costs

The software is free. Running it isn't.

  • Infrastructure. Nodes cost money whether pods use them fully or not, and some capacity is held in reserve for failures and rollouts.
  • Management fees. Cloud providers offer managed Kubernetes that runs the control plane for you, often with a charge per cluster plus the underlying resources.
  • Skills. Someone must understand networking, permissions, storage, upgrades and troubleshooting.
  • Upgrades. New versions arrive regularly and older ones lose support, so upgrading is a recurring task.
  • Add-ons. Monitoring, logging, certificates and security tools each need choosing and maintaining.

A managed service removes much of the hardest work but not all of it. Your team still owns application configuration, resource limits, access rules and node settings to varying degrees. Understanding a cloud bill helps when cluster costs look larger than expected.

When you probably don't need it

Consider simpler options if you run only a handful of services, have no one with time to learn it, see steady and modest traffic or mostly need to host a website. A managed application platform, a serverless service or a couple of virtual machines behind a load balancer may do the job with far less to learn.

It starts to earn its keep when many teams deploy many services, releases happen often, you want one consistent way of operating across environments or your software vendors already ship their products for it.

How traffic reaches your application

It helps to trace one visitor's request. The browser looks up your domain name and gets the address of a load balancer, usually one supplied by the cloud provider. The load balancer passes the connection to an entry point inside the cluster, where ingress or gateway rules decide which service should handle it based on the hostname and path. The service then picks one of the healthy pods, and your code answers.

Each hop can fail in its own way. A wrong rule produces a "not found" page even though the application runs fine. A service that matches no pods leads to gateway errors. This is why engineers troubleshooting an outage often work along the path one step at a time, and why a problem described as "the site is down" may have nothing to do with your code.

Resource requests and limits

Each pod can state how much processor time and memory it expects to need, called a request, and the most it may use, called a limit. The scheduler uses requests to decide where a pod fits. Limits stop one greedy program from crowding out the rest.

These two numbers have a large effect on both reliability and money. Requests set too high leave nodes looking full while sitting mostly idle, so you pay for capacity nobody uses. Requests set too low pack machines too tightly, and applications slow down or get terminated when memory runs short. A container that exceeds its memory limit is killed and restarted; one that hits its processor limit is slowed.

Good teams measure real usage and adjust these values periodically. If someone proposes cutting the cluster bill, this is often the first place to look, ahead of switching providers or redesigning anything.

Security in brief

A cluster concentrates a lot of power in one place, so access matters. Kubernetes supports role-based access control, which grants each person and program specific permissions. Other sensible measures include limiting which pods may talk to each other with network policies, scanning images for known flaws, keeping the management interface off the open internet where possible and recording who changed what. Defaults are often more permissive than a production system should be, so these protections need to be set up on purpose.

Good questions to ask your team

You can contribute without being technical. These questions tend to surface real risks.

  1. How do we know when something is unhealthy, and who gets alerted?
  2. When did we last practice restoring data and rebuilding the cluster?
  3. Who can change production, and how are those changes reviewed?
  4. How current is our version, and when is the next upgrade scheduled?
  5. What share of the capacity we pay for is actually used?
  6. If the person who knows this best is away, who can handle an incident?

Clear answers are a good sign. Vague ones suggest the platform has outgrown the attention it's getting.

Common questions

Is Kubernetes the same as Docker?

No. Docker is a popular set of tools for building and running containers on a machine. Kubernetes coordinates containers across many machines and works with several compatible container runtimes. Images built with Docker run on it.

Does Kubernetes make an application highly available?

It supplies useful mechanisms. You still need multiple copies, spread across machines or availability zones, and data that survives failures.

Can it avoid cloud lock-in?

It gives you a common layer that exists on many providers and on your own hardware. Storage, networking, identity and managed databases still differ, so moving takes work.

Written for 4Internet with AI writing tools and not reviewed line by line by a person. Check anything you rely on with the maker, provider or standard concerned. Report an error.

Keep reading

All 45 articles in Cloud & Data Centers →

Latest news on this topic