Project challenges / verified progress
Beacon: give it somewhere to live

The engineering notebook

Run the image

How does Kubernetes keep Beacon running and roll it forward without hand-starting containers?

Loading statusStage 3 of 10

  • Workspace not ready
  • Agent not ready
Focus25:00
A small focus ritual

0 focus sessions completed. Every fourth session offers a longer break. Start each phase when you are ready.

Study time never unlocks verified lesson progress.

Loading...

Loading verified progress...

Loading GitHub account...
Phase 1 — Learn the control plane

Step 01 of 06

Learn the concept

A single container can look healthy right up until the laptop sleeps. A Deployment is the first Kubernetes object that says, in writing, that Beacon should keep existing after one process disappears.

A ROLLING UPDATE MOVESreplicasOld set2 pods serveSurge podnew image startsmaxSurge 1Ready gatenew pod passesOld pod gonecapacity restored
A Deployment changes Pods through a ReplicaSet. With `maxSurge: 1` and `maxUnavailable: 0`, Kubernetes creates one new Pod before deleting an old one, so capacity does not drop during the rollout.
Step 01

The ideas this is made of

A Pod is the schedulable unit

Kubernetes does not schedule individual containers. It schedules Pods: one or more containers sharing a network namespace, volumes and lifecycle. Beacon usually needs one container per Pod. That still matters because the Pod receives the IP address, probes, volume mounts and restart policy. If the Pod dies, a controller must create another Pod; the same Pod is not healed in place.

You almost never create Pods directly

A naked Pod is useful for a quick diagnostic, not for a service. If its node dies, Kubernetes has no higher-level desired state telling it to create a replacement. A Deployment owns a ReplicaSet, and the ReplicaSet owns Pods. That chain is what turns replicas: 2 into two current Pods, even after failure.

Deployment rollouts are versioned changes

When a Deployment's Pod template changes, Kubernetes creates a new ReplicaSet and scales it while scaling the old one down. kubectl rollout status follows that process. kubectl rollout undo moves the Deployment back to a previous template. The rollback is not magic; it is another desired-state change to an earlier ReplicaSet.

Strategy numbers encode risk appetite

maxUnavailable: 0 says never reduce ready capacity during an update. maxSurge: 1 allows one extra Pod temporarily, which costs a little more CPU and memory. For two replicas, that means Kubernetes may run three Pods during the rollout. A cluster without spare capacity turns that careful strategy into Pending.

A library does not shelve one book by hand
desired: 5 copies of the new edition
observed: 5 old copies
policy: never have fewer than 5 total
action: place 1 new, remove 1 old, repeat

The librarian tracks editions and shelf count. A Deployment tracks Pod templates and ready replicas. Nobody fondly names the individual copies.

Pod, ReplicaSet and Deployment

ObjectJobDo you edit it?

Pod

Runs the container now

No, it is disposable

ReplicaSet

Keeps N matching Pods

Rarely; Deployment owns it

Deployment

Manages rollouts and history

Yes

Strategy

Controls update shape

Yes, with intent

Rollout history

Records templates

Read during rollback

What these are called on the job

  • Pod — The smallest unit Kubernetes schedules; one IP, one lifecycle, one or more containers.

  • ReplicaSet — A controller-owned object that keeps a requested number of matching Pods alive.

  • Deployment — A higher-level controller for ReplicaSets, rollouts and rollback history.

  • Rollout — The transition from one Pod template revision to another.