A presentation at Nantes JUG in December 2024 in Nantes, France by Horacio Gonzalez
Demystifying Kubernetes Operators in Java with Quarkus 2024-12-17 - Nantes JUG Horacio Gonzalez
Who are we? Introducing myself and introducing Clever Cloud
Horacio Gonzalez @LostInBrittany Spaniard Lost in Brittany
Clever Cloud Our mission: give more speed to your teams and better quality to your projects
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 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
Let’s build an operator together Why? Because we can!
Let’s choose a use-case External Service Health Monitor Operator
Code available on GitHub https://github.com/sebi-and-horacio/external-health-monitor-operator