The document discusses the operator pattern in Kubernetes for managing stateful services. It describes how operators define custom APIs using CustomResourceDefinitions and create controllers that react to changes in the API to manage applications and infrastructure. Operators allow automating tasks like backups, scaling, healing and configuration that are difficult to do at the application level alone. Some examples of using operators for services like Kafka and Elasticsearch are provided.
1 of 24
Downloaded 81 times
More Related Content
The Kubernetes Operator Pattern - ContainerConf Nov 2017
17. 17
Are we reinventing the Wheel?
Helm?
Mesos Frameworks?
Nomad Custom Scheduler?
Docker Swarm Plugins?
Take a step back
18. 18
Helm itself a Operator (somewhat, working on it
https://github.com/kubernetes/helm/issues/3089) )
Controllers
Operator = Controller + CRD
Operator = External Software
Controller = Internal
Only do operators if you cant solve it with Helm.
Operators vs Helm vs Controller
19. 19
Create API Spec
Generate some Objects needed by Informer etc (Since 1.8)
See: https://blog.openshift.com/kubernetes-deep-dive-code-generation-
customresources/ (Excellent, by sttts)
Generator Controller
Informer
Main
Code!
20. 20
Microservices, single Deployment
Stateless, use CRD for States
Operations should be Idempotent
Leverage K8S Objects as most as possible
CRD should be versioned, backwards compatible
Best Practice Operators
23. 23
Task Mesos Kuberentes
Custom Resource Placement Write a framework Write a custom scheduler
Special resource init Write a framework Initializer
API access Every Framework has its own API Unified API
Special lifecyle Write a framework Kubernetes Operator
Custom execution Write a framework + executioner CRI Interface + Scheduler
Comparison