It’s been almost a year since I first started out on my SRE journey. Having only a vague idea about clusters and Kubernetes in general, I started in the role. And the very first word that hit me was, “Operator”. This is an attempt at capturing the thoughts I had upon hearing that word.

What I thought was an Operator

Operator is like your Robot, it waits for your instructions and does things on a cluster. It changes things on a cluster and lets you know whether the changes were successful or not.

What an Operator really is

An operator is like a watcher. It sits there and periodically looks for a resource in the cluster. Based on the existence or state of the resource, the operator may or may not take certain actions. This idea can get quite expansive and an operator can run upgrades for a cluster, recover things when they crash and make sure the cluster is up and running.

How do Operators do what they do?

Think of Cron Jobs. They periodically run and execute some commands. The commands can be trivial or complex. There can be decision making involved in the script that the Cron Job runs. Operators are kind of the same. They query the Kube API and analyze the results. Based on the results, they execute certain parts of the code.