Operators to the rescue: Manage your external data and legacy APIs from Kubernetes

A presentation at LunaConf in October 2024 in Rotterdam, Netherlands by Horacio Gonzalez

Slide 1

Slide 1

Operators to the rescue: Manage your external data and legacy APIs from Kubernetes Horacio Gonzalez

Slide 2

Slide 2

Who are we? Introducing myself and introducing Clever Cloud

Slide 3

Slide 3

Horacio Gonzalez @LostInBrittany Spaniard Lost in Brittany

Slide 4

Slide 4

Clever Cloud From Code to Product

Slide 5

Slide 5

Kubernetes operators Helping to tame the complexity of K8s Ops

Slide 6

Slide 6

Taming microservices with Kubernetes

Slide 7

Slide 7

What about complex deployments

Slide 8

Slide 8

Tools like Helm helps with complexity

Slide 9

Slide 9

Helm Charts are configuration Operating is more than installs & upgrades

Slide 10

Slide 10

Kubernetes is about automation How about automating human operators?

Slide 11

Slide 11

Kubernetes Operators A Kubernetes version of the human operator

Slide 12

Slide 12

Building operators Basic K8s elements: Custom Resources & Controllers

Slide 13

Slide 13

Custom Resource Definitions Extending Kubernetes API

Slide 14

Slide 14

Extending Kubernetes API By defining new types of resources, internal or external to the cluster

Slide 15

Slide 15

With a CRD you can create CR in the cluster They are the blueprints of the Custom Resources

Slide 16

Slide 16

Custom Resources are simply data All the logic must be in the Controller

Slide 17

Slide 17

Kubernetes Controllers Keeping an eye on the resources

Slide 18

Slide 18

A reconcile loop Controllers watch the state of the cluster, and make or request changes where needed

Slide 19

Slide 19

Kubernetes Operator Automating operations

Slide 20

Slide 20

What’s a Kubernetes Operator?

Slide 21

Slide 21

Example: databases Things like adding an instance to a pool, doing a backup, sharding…

Slide 22

Slide 22

Knowledge encoded in CRDs and Controllers

Slide 23

Slide 23

Custom Controllers for Custom Resources Operators implement and manage Custom Resources using custom reconciliation logic

Slide 24

Slide 24

Operator Capability Model Gauging the operator maturity

Slide 25

Slide 25

Operators aren’t limited to K8s They can be used to pilot external APIs, i.e. non K8s software

Slide 26

Slide 26

Don’t put everything into Kubernetes

Slide 27

Slide 27

Operators simplify Kubernetes integration

Slide 28

Slide 28

A real, open-source example The Clever Operator

Slide 29

Slide 29

Available on Operator Hub & GitHub https://operatorhub.io/operator/clever-operator https://github.com/CleverCloud/clever-operator

Slide 30

Slide 30

Exposing Clever Cloud resources as CRD Allowing your apps to use our DBs as if they were in K8s

Slide 31

Slide 31

Many possible use-cases ● ● ● ● ● ● ● ● External Service Health Monitor Operator External API Token Rotation Operator Database Synchronization Operator Legacy System Configuration Management Operator File Transfer Operator (FTP/SFTP Automation) Cloud Billing/Cost Monitoring Operator DNS Management Operator …

Slide 32

Slide 32

How can we write Operators? Which language? Any framework?

Slide 33

Slide 33

They are simply pods and manifests You can simply call Kubernetes APIs or use a compatible client

Slide 34

Slide 34

The Operator Framework Open source framework to accelerate the development of an Operator

Slide 35

Slide 35

Hey Devoxx Morocco, operators ❤ Java

Slide 36

Slide 36

Let’s build an operator together Why? Because we can!

Slide 37

Slide 37

Let’s choose a use-case External Service Health Monitor Operator

Slide 38

Slide 38

Exposing Clever Cloud resources as CRD Allowing your apps to use our DBs as if they were in K8s

Slide 39

Slide 39

Let’s look at a real operator Dealing with external databases

Slide 40

Slide 40

Clever Cloud operator Allowing your apps to use our DBs as if they were in K8s

Slide 41

Slide 41

Operators can get lots of options Should devs need to know all of them?

Slide 42

Slide 42

Operators simplify Kubernetes integration

Slide 43

Slide 43

So you have a bunch of operators… Too many options again…

Slide 44

Slide 44

So many things to learn…

Slide 45

Slide 45

Managing the self-service commodity

Slide 46

Slide 46

Shift left and Cognitive Load

Slide 47

Slide 47

How about an operator to operate operators? One operator to rule them all

Slide 48

Slide 48

How about a Platform Engineering framework?

Slide 49

Slide 49

How about using an internal developer portal? Platform Stakeholders Developers Dev Manager VP Engineering DevOps CISO Internal developer portal

Slide 50

Slide 50

Portal’s main pillars Dashboards Software Catalog Scorecards Self-service RBAC Workflow automations