Skip to content
IJK

The controller-runtime Cache: List, Watch and Where Reads Go

By IJK ·

How the Kubernetes post says a client keeps a local copy current with list and watch, and where it says a controller's reads and writes go.

What a controller does

A controller in Kubernetes lives inside a reconciliation loop: it continuously compares the desired state of an object with the actual state and tries to bring one in line with the other. [1]

How a client keeps a local copy

The standard mechanism works like this: a client takes a snapshot of the slice of the world it cares about once, then subscribes to a stream of changes and keeps a local copy current. [2]

Read from memorya local copy kept currentWrite to the API serverFeedback through a watch
Where does a controller read from, where does it write and how does it hear back?

Where reads and writes go

They are describing the foundation of the entire model: you read from memory, you write to the API server, and you receive feedback through a watch. [3]

Sources

  1. The Kubernetes project source says: A controller in Kubernetes lives inside a reconciliation loop: it continuously compares the desired state of an object with the actual state and tries to bring one in line with the other. How the controller-runtime Cache Actually Works
  2. The Kubernetes project source says: The standard mechanism works like this: a client takes a snapshot of the slice of the world it cares about once, then subscribes to a stream of changes and keeps a local copy current. How the controller-runtime Cache Actually Works
  3. The Kubernetes project source says: They are describing the foundation of the entire model: you read from memory, you write to the API server, and you receive feedback through a watch. How the controller-runtime Cache Actually Works

Editorial (AI-assisted; automatically checked, not human-reviewed). Each statement is linked to its source; check the source before relying on a detail.

  • kubernetes
  • controllers
  • controller runtime
  • operators