Slide 1

Slide 1 text

JOSH WOOD OpenShift Developer Advocate Red Hat Kubernetes Operators

Slide 2

Slide 2 text

Any application on any platform must be installed, configured, managed, and upgraded over time. Patching is critical to security Anything that isn’t automated is slowing you down. Operators are automated software managers for Kubernetes clusters: Install and Lifecycle. Why you care about Operators

Slide 3

Slide 3 text

You find a killer new database, perfect match for your project’s requirements You don’t want to become an expert killernewDB DBA Operators make it easier to run foundation services You can use Operators today

Slide 4

Slide 4 text

With the Operator Framework SDK https://github.com/operator-framework/operator-sdk You can build Operators today

Slide 5

Slide 5 text

Scaling stateless apps: Easy

Slide 6

Slide 6 text

ReplicaSet $ kubectl scale depl/staticweb --replicas=3

Slide 7

Slide 7 text

ReplicaSet

Slide 8

Slide 8 text

ReplicaSet

Slide 9

Slide 9 text

What about apps that… store data?

Slide 10

Slide 10 text

Creating a database is easy $ kubectl run db --image=quay.io/my/killernewdb

Slide 11

Slide 11 text

Running a database is harder •Resize/Upgrade - coordination for availability •Reconfigure - tedious generation / templating •Backup - requires coordination among instances •Healing - restore backups, rejoin db cluster

Slide 12

Slide 12 text

How? Extend Kubernetes If only Kubernetes knew…

Slide 13

Slide 13 text

The goal $ cat database-cluster.yaml spec: clusterSize: 3 readReplicas: 2 version: v4.0.1 [...]

Slide 14

Slide 14 text

Application-specific controllers that extend the Kubernetes API to create, configure, and manage instances of complex stateful applications on behalf of a Kubernetes user
 1. Extend the Kubernetes API through the Custom Resources (CR(D)) mechanism
 2. Custom controller to watch CRs, act in response What are Operators?

Slide 15

Slide 15 text

Example: etcd Operator $ cat deployment.yaml spec: clusterSize: 3 version: v3.3.9 [...]

Slide 16

Slide 16 text

etcd Operator

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

Databases
 File, block, and object storage
 Applications with their own notion of “cluster”
 Apps for distribution on Kubernetes What are Operators good for?

Slide 19

Slide 19 text

Use Operators today https://github.com/operator-framework/awesome-operators •Elastisearch •etcd •Prometheus •MySQL •Postgres (crunchy) •“and many more!”

Slide 20

Slide 20 text

https://github.com/operator-framework/operator-sdk An Operator is a custom Kubernetes controller for your app. The SDK makes it easier to build Operators: • High level APIs and abstractions to write operational logic • Scaffolding and code generation to bootstrap new projects • Extensions to cover common Operator use cases Build your Operator

Slide 21

Slide 21 text

Make your app a Kubernetes Native What are Operators good for?

Slide 22

Slide 22 text

Resources • https://coreos.com/operators
 • Operator Framework and SDK on Github
 https://github.com/operator-framework/
 • Awesome Operators!
 https://github.com/operator-framework/awesome-operators
 • Introducing the Operator Framework
 https://coreos.com/blog/introducing-operator-framework
 • Make a Kubernetes Operator in 15 mins with Helm
 https://blog.openshift.com/make-a-kubernetes-operator-in-15-minutes-with-helm/
 • Kubernetes Custom Resources Grow up in v1.10.0
 https://blog.openshift.com/kubernetes-custom-resources-grow-up-in-v1-10/


Slide 23

Slide 23 text

Questions? Comments? [email protected] @joshixisjosh9 Thank you!