← All pathways

How Modern Software Really Runs on a CPU

From machine code to Kubernetes — the same problem, solved again at every altitude.

You write code, deploy it with kubectl apply, and a container starts somewhere. This pathway is what actually happens in between — from the CPU executing machine instructions, through the OS process model and Linux isolation primitives, to how Kubernetes decides where your workload runs and how much CPU it's allowed to use.

Every layer in this stack solves the same problem again: who gets the CPU, and for how long? An operating system answers it for processes on one machine. Kubernetes answers it for containers across a fleet. This route follows that question from the fetch-execute cycle inside a single core to the scheduler deciding which node your Pod lands on — so the YAML field you fill in without thinking has a mechanism behind it, not just documentation.

16 steps live · 5 sites

What you'll be able to do

  • Trace a running program from CPU instructions to a Kubernetes Pod, in one continuous chain.
  • Explain what a process, a thread, and a container actually are — by mechanism, not analogy.
  • Read resources.requests and resources.limits as what they really are: cgroup CPU shares and memory limits.
  • Diagnose CPU throttling and OOMKilled Pods from first principles, not guesswork.
01

The Machine Underneath

1

What Actually Happens When Your Code Runs

Computer Science · Essentials

Before anything else here makes sense: the CPU doesn't run Python. It runs this.

A CPU executes exactly one language: machine code, opcodes read one at a time in a fetch-decode-execute loop. Every abstraction in every language you write eventually reduces to this tiny vocabulary — demonstrated here with a real compiled function and its disassembly across six languages.

2

Compilers vs. Interpreters

Computer Science · Efficiency

How the code you actually wrote turns into the instructions from step one.

"Python is interpreted, Go is compiled" is why Go starts instantly and Python spins up a virtual machine first. Covers what a compiler and an interpreter actually do to your source before a single instruction from step one ever runs.

3

The Stack, the Heap, and Virtual Memory

Computer Science · Essentials

Every process believes it owns all the RAM. Here's the lie, and who's telling it.

Every process believes it owns all the RAM on the machine, starting at zero — a fiction the OS maintains via the MMU and page tables, translating each process's private addresses to real physical RAM. That translation is the actual mechanism behind process isolation, and the reason a stack overflow has a hard, fixed ceiling.

4

Operating System Basics

Computer Science · Efficiency

Kernel mode, user mode, and the syscall that separates them.

CPU privilege rings, not politeness, are what stop your code from touching hardware directly — user-space code reaches the kernel only through the single, audited door of a system call. A real strace walkthrough shows what that boundary costs, and why buffering writes instead of calling one at a time is measurable advice, not folklore.

5

Processes and Threads

Computer Science · Efficiency

The unit the OS actually schedules — and what it costs to switch between them.

A process is fully isolated and expensive to create; a thread shares its process's memory and is cheap — that one difference is the entire trade between them. Context switching is what makes many of them look simultaneous on too few cores, and it isn't free either.

6

How the OS Scheduler Actually Decides

Computer Science · Efficiency

Thousands of processes, one CPU. The algorithm that decides who runs next.

Linux's CFS scheduler always runs whichever runnable thread has received the least CPU time so far — a real, checkable value called vruntime, not a vague priority suggestion. This is the exact shape of problem Kubernetes solves again a few steps later, across a fleet of machines instead of one core.

02

One Kernel, Many Machines

04

Who Decides Which CPU

11

Kubernetes Architecture

Kubernetes · Essentials

Who's actually deciding anything, across a fleet of these machines.

A working mental model of a cluster: the control plane that decides, the nodes that run your Pods, and the reconcile loop tying them together — just enough machinery to make the rest of this pathway's Kubernetes steps precise.

12

The CRI: How kubelet Talks to Container Runtimes

Kubernetes · Efficiency

The exact handoff from kubelet to the container runtime underneath.

kubelet never talks to containerd or CRI-O directly — it goes through the Container Runtime Interface, a deliberate abstraction that is why "Docker support removed" never actually broke anything. The full chain from kubectl apply to a running Linux process, named end to end.

13

The Kubernetes Scheduler

Kubernetes · Efficiency

The same problem as step 6, at cluster scale: which machine runs this next?

Every unscheduled Pod goes through filtering (which Nodes even qualify) then scoring (which qualifying Node is best) — the same shape of problem as the OS scheduler a few steps back, solved across a fleet instead of one CPU. Taints, tolerations, and node affinity are how you shape that decision on purpose.

14

Resource Requests and Limits

Kubernetes · Essentials

Close the loop: this YAML field is a cgroup CPU quota.

The payoff for the whole pathway: resources.limits.cpu and resources.limits.memory are a cgroup CPU quota and memory ceiling in a YAML costume, the exact Linux mechanisms from earlier steps. Includes the specific reason a Pod gets CPU-throttled while its usage graph looks perfectly calm.

15

Diagnosing Pod Failure States

Kubernetes · Essentials

When placement or limits go wrong, this is what it looks like from the outside.

CrashLoopBackOff, Pending, ImagePullBackOff, and OOMKilled each point to a different failure — different subsystems, different fixes — and kubectl describe pod's Events section almost always names the exact cause directly, once you know where to look.

06

Go Deeper

17

Diagnosing CPU Throttling and OOMKills in Production

coming soonKubernetes · Mastery

The theory pays off here: reading a throttled or OOMKilled Pod like a systems engineer.

Reading a throttled or OOMKilled Pod like a systems engineer, using every mechanism this pathway covered end to end. Reserved for the paid Mastery tier — coming soon.