Lab and demo using the new Operator SDK 1.0.0

I know it sounds like a terrible title for an article about Operators, too close to a typical gaming YouTube channel video, but I’m very excited… Why?

Well, I started developing “demo/dummy” operators for research first, then to answer customers’ doubts and guide them through the process of developing operators, and finally because I like the subject. In any case, I started somewhere around February 2019 and since then till some days ago all versions of the Operator SDK were 0.x … not anymore the Operator SDK 1.0.0 is here and it comes with a lot of changes!.

For a thorough explanation of those changes, I suggest you to go [here](https://www.openshift.com/blog/operator-sdk-reaches-v1.0).

Among of those changes I’d like to highlight:

  • Makefile including a bunch of useful targets that will make your life easier especially at the beginning.
  • Use of kubebuilder to define RBAC rules (role/role binding) which means RBAC is in your Controller code and defined in the same way as validations and Form UI tweaks in Types, etc.
  • Operator metadata format now defaults to Bundle instead of PackageManifests
  • Use of [kustomize](https://github.com/kubernetes-sigs/kustomize) to generate manifests, deployment descriptors, etc.

So to celebrate v1.0.0 I decided to dust off my Gramola Operator code that I had developed 6 months ago. Ok, ok, not that much dust had settled… ok, again, I wasn’t exactly celebrating I had to migrate my code… But It was very rewarding, I have improved the code, and also it was the best way to see the value of the changes introduced.

Gramola and Gramola Operator you say? Bear with me, it’s just a demo app and the operator to deploy it. An excuse to explain how to develop an operator and upgrade it using the Operator Lifecycle Manager or OLM.

Gramola is a simple application that shows a list of (musical) Events (hence the name of the app). It comprises:

  • frontend: NodeJS/Angular application
  • gateway: Quarkus simple API gateway
  • events: Quarkus simple API
  • events-database: PostgreSQL 10 Database

The operator deploys all the components, creates tables, Ingress rules or OpenShift Routes, etc. it also upgrades the database schema and migrates data if needed… BUT it’s just a sample operator to, somewhat, open your eyes to the possibilities the Operator Framework offers…

Here you have a screenshot showing the end result and ultimate goal of the operator.

Image for post

Nice Carlos… you’re excited.

Image for post

Ok, ok, TL;DR I guess.

#operators #operator-sdk #kubernetes

Lab and demo using the new Operator SDK 1.0.0
2.20 GEEK