Free sample lesson ยท Exploring Kubernetes Namespaces

Cluster Basics

What if one computer system could run thousands of apps without them tripping over each other?

Lesson 1 of the Wondering course Exploring Kubernetes Namespaces

Who decides where each app runs?

Imagine a small company with three apps: a website, a payment service and a reporting tool.

Instead of buying one server per app, it pools three machines into one shared system. All three apps must run smoothly without fighting over space.

Three apps sharing a pool of three machines

Notice that the three apps sit above one shared pool of machines, with no machine reserved for any single app.

So who decides which machine runs which app?

And what keeps three apps on the same few machines from tripping over each other?

To answer that, we first need to question a common picture of how apps live on computers.

Does every app need its own machine?

Many newcomers picture one app per computer. It feels safe: if each app has its own box, nothing can collide.

But our company did not buy three servers for three apps. It pooled three machines and let all the apps share them.

Two pictures of where apps live
  • Common belief
  • Shared cluster

In a cluster, apps share machines, so separate hardware is not what keeps them safe or organized.

So if hardware is not doing the organizing, what is?

Every cluster has a decision-maker

That pooled setup is a Kubernetes cluster: a set of machines, called nodes, that work together to run containerized apps.

Worker nodes provide the CPU and memory. App containers run there, grouped into units called Pods.

The control plane tracks what should run and watches for changes. It is the decision-maker that picks a node for each workload.

  • Kubernetes cluster: Machines working together
  • Control plane: Decides where each workload runs
  • Worker nodes: Provide CPU and memory
  • Pods: Groups of app containers

Picking a node is called scheduling. But how does it choose?

The cluster places copies where there is room

Suppose the team asks for 2 copies of the website, 2 of the payment service and 1 of the reporting tool.

What the team asks for
  • Website: 2
  • Payment service: 2
  • Reporting tool: 1

The team does not say which machine gets which copy. It only describes what it wants.

The control plane checks how much free capacity each of the three machines has, then spreads the 5 copies across them.

Teams say what they want, and the cluster works out where it runs.

But machines can break. What happens then?

A failed machine does not stop the apps

Now imagine one of the three machines fails. Its copies disappear.

The control plane notices the missing copies. It starts replacements on the other two machines, so the system matches what was asked for again.

How the control plane keeps apps running
  • Know what was asked: 5 copies should be running.
  • Watch for changes: It keeps an eye on every machine.
  • Notice missing copies: A failed machine leaves copies gone.
  • Restart elsewhere: Replacements start on the other two machines.

The control plane moves apps off a failed machine automatically, so no app is tied to one box.

This sharing uses machines fully. But all 5 copies now live in one pool, which raises a new problem.

Sharing one pool creates collisions

When many teams, projects or environments use the same pool, their resources share one space.

Without a way to group, name and separate them, things get messy fast.

Two teams might pick the same name for an app. One project might use more than its share of capacity. Someone might change resources that belong to someone else.

What goes wrong in one shared space
  • Without separation
  • Name clash: Two teams pick the same app name.
  • Capacity grab: One project uses more than its share.
  • Accidental change: Someone edits resources that belong to someone else.

Shared machines need software rules that group, name and separate workloads.

So what does that mean for our three apps?

Software keeps shared apps organized

Back to the small company. Who decides where each app runs? The control plane, which places copies on whichever machine has room.

What keeps them from tripping over each other? Not separate hardware, since all three apps share the same three machines.

Organization has to come from software, which divides one physical cluster into organized, logical sections.

That is why clusters need a way to label and separate what runs inside them.

How would you split this cluster?

Check yourself

A shop moves its online store, chat app and inventory tool onto one shared Kubernetes cluster. To keep these apps organized and separated, the shop should rely on _____

  • software that groups and labels the apps inside the cluster
  • giving each app its own separate machine in the cluster

Answer: software that groups and labels the apps inside the cluster

In a cluster, apps share a pool of machines, and the control plane moves them wherever there is room. That means organization has to come from software. The idea of giving each app its own machine is the old one-app-per-computer habit, and it gives up the benefit of pooling machines.

In a Kubernetes cluster, the _____ decides where each workload goes. The _____ provide the CPU and memory, and app containers run on them grouped into units called _____.

Answer: In a Kubernetes cluster, the control plane decides where each workload goes. The worker nodes provide the CPU and memory, and app containers run on them grouped into units called Pods.

The control plane makes the placement decisions. Worker nodes supply the computing power. Containers run there inside units called Pods.

Imagine a school runs four apps on one Kubernetes cluster with five machines. A teacher asks for 3 copies of the grading app. Which part of the cluster decides which machine each copy runs on?

  • The control plane
  • The worker node with the most memory
  • The grading app itself
  • The teacher who asked for the copies

Answer: The control plane

The control plane is the cluster's decision-maker. It tracks what should run and picks a node for each workload, which is called scheduling. Worker nodes only provide the CPU and memory where the copies run.

Keep going

This is lesson 1 of 12 in Exploring Kubernetes Namespaces. Next up:

  1. Why Namespaces
  2. Default Namespaces
  3. Creating Namespaces
  4. Switching Context
  5. Scoped Resources

Start this course free

Wondering turns any topic into short lessons you can read, watch, or listen to, with practice questions and an AI tutor.