Understand Kubernetes Controller

Kubernetes runs a group of controllers that take care of routine tasks to ensure the desired state of the cluster matches the observed state. For example, Replica Sets maintains a correct number of pods running in the cluster. Node Controller looks up the state of servers and responds when servers go down. Basically, each controller is responsible for a particular resource in the Kubernetes world. For users to manage their cluster, it is important that users understand the role of each controller in Kubernetes. However, have you ever thought about how the Kubernetes controllers work? Or even more exciting, have you ever thought about writing your own custom controller?

This serie has two posts, in the first one I would like to give an overview of the internals of a Kubernetes controller, its essential components and how it works. In the second post, I will guide you through a practice on how to write your own controller to build a simple notification system for your cluster.

What will you learn?

  • Understand the elements involved in a Kubernetes controller
  • An example of how to write a custom controller

List of tutorials