employer cover photo
employer logo

x.ai interview question

How would you design the interaction between the Kubernetes API Server and a Kubernetes Controller.

Interview Answer

Anonymous

18 Jan 2025

The kube-apiserver keeps state within etcd, which also sends notifications it whenever configuration changes. These notifications are kept in a ring buffer, one for each type of resource, so that it can be fanned-out to each watch that was registered. Controllers register watches with the kube-apiserver, and as they consume messages, the kube-apiserver advances a pointer along the ring buffer for each watch. If ever a watch falls behind the oldest message in the ring, the watch gets dropped and the controller has to re-register it.