Skip to content

Instantly share code, notes, and snippets.

@vishnuhd
Last active September 3, 2019 07:28
Show Gist options
  • Save vishnuhd/8222fbb7a64e5a6493d0c8cb3f04976c to your computer and use it in GitHub Desktop.
Save vishnuhd/8222fbb7a64e5a6493d0c8cb3f04976c to your computer and use it in GitHub Desktop.
Controller | Custom Controller | Operator

Since CoreOS coined the term "Operator", their article is the authority on what they mean by that:

An Operator is an application-specific controller that extends the Kubernetes API to create, configure and manage instances of complex stateful applications on behalf of a Kubernetes user. It builds upon the basic Kubernetes resource and controller concepts, but also includes domain or application-specific knowledge to automate common tasks better managed by computers.

We use Operators because managing stateful applications, like databases, caches and monitoring systems, is a big challenge, especially at massive scale. These systems require human operational knowledge to correctly scale, upgrade and reconfigure while at the same time protecting against data loss and unavailability.

To paraphrase: All Operators use the controller pattern, but not all controllers are Operators. It's only an Operator if it's got: controller pattern + API extension + single-app focus.

TfJob is a good example of an Operator, because it's a custom controller + CRD that's focused only on running one particular app (TensorFlow). Things like BlueGreenDeployment or IndexedJob implement general patterns that apply abstractly to "whatever it is you're running", so although they are also custom controllers + CRDs, they are not Operators.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment