Operator — Overview Extensibility model for CR (Custom Resources) Embed automated operations logic for CR lifecycle management Supports the Kubernetes control loop architecture
Operator — Reconciler apiVersion: apps/v1 kind: Deployment metadata: name: myDeployment spec: replicas: 3 … Reconcile apply Desired State Report Status Actual State Knowing the desired state Fetch the actual state Actions to go from actual to desired state
Operator — CRD Custom Resource Definition • Extensions of the Kubernetes API • CRDs enables Kubernetes to store our custom resource in etcd • Manage our custom resources like a built in Kubernetes resource apiVersion: cache.example.com/v1alpha1 kind: KafkaTopic metadata: name: myTopic spec: numPartitions: 5 replicationFactor: 1
Operator-SDK Set of open source tools for building and packaging operators Uses controller-runtime’s Client interface • Controller Go library by the Kubernetes-sig • Kubebuilder compatible Helm, ansible and Go
Operator-SDK with GO Operator-sdk supports the creation of operators in Go • Flexible and powerful Operator-sdk generates most of the needed skeleton code • Custom Resource Definition (CRDs) • A skeleton controller • Custom reconciliation loop to the controller https://blog.deckhouse.io/