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

Who are we? Introducing myself and introducing Clever Cloud

Horacio Gonzalez @LostInBrittany Spaniard Lost in Brittany

Clever Cloud From Code to Product

Kubernetes operators Helping to tame the complexity of K8s Ops

Taming microservices with Kubernetes

What about complex deployments

Tools like Helm helps with complexity

Helm Charts are configuration Operating is more than installs & upgrades

Kubernetes is about automation How about automating human operators?

Kubernetes Operators A Kubernetes version of the human operator

Building operators Basic K8s elements: Custom Resources & Controllers

Custom Resource Definitions Extending Kubernetes API

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

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

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

Kubernetes Controllers Keeping an eye on the resources

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

Kubernetes Operator Automating operations

What’s a Kubernetes Operator?

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

Knowledge encoded in CRDs and Controllers

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

Operator Capability Model Gauging the operator maturity

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

Don’t put everything into Kubernetes

Operators simplify Kubernetes integration

A real, open-source example The Clever Operator

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

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

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 …

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

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

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

Hey Devoxx Morocco, operators ❤ Java

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

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

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

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

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

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

Operators simplify Kubernetes integration

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

So many things to learn…

Managing the self-service commodity

Shift left and Cognitive Load

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

How about a Platform Engineering framework?

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

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