Skip to content

Desired and observed

Apply returns, and nothing has happened

The first thing to unlearn: a successful apply is a successful write to a database, and that is all it is.

about 8 minutes

What apply actually did

You apply this and immediately read the Deployment back. What does `status.readyReplicas` say?

The number that says whether anybody noticed

metadata.generation increments every time you change the spec. status.observedGeneration is the generation a controller has actually acted on. When they differ, your change has been written down and not yet picked up.

That pair is the most useful two fields in Kubernetes and almost nobody reads them. A rollout that appears stuck is either one where observedGeneration has not caught up — nothing has looked yet — or one where it has, and the controller looked and could not proceed. Those are completely different problems and the fields tell them apart.

Try this
apiVersion: apps/v1
kind: Deployment
metadata:
  name: checkout
spec:
  replicas: 5
  selector:
    matchLabels:
      app: checkout
  template:
    metadata:
      labels:
        app: checkout
    spec:
      containers:
      - name: api
        image: checkout:v1
The two numbers, and the gap between them closing.
0ms simulated

Pods — in creation order

No pods. Nothing has been asked for, or nothing has acted yet.

Events — in the order the cluster produced them

No events yet.

Everything you do here stays in this browser.Part of liter8.sh