This project contains Kubernetes operator samples that demonstrate best practices how to develop operators with Golang, Operator SDK including Kubebuilder and the Operator Lifecycle Manager Framework.
The repo contains two operators:
- Application operator: Deploys and manages a front-end micro-service application which provides a simple web UI.
- Database operator: Deploys and manages a simple database. Used by the front-end application.
Additionally the repo contains four more application components:
- simple-microservice - A front end web application, written in Java using Quarkus
- database-service - A simple database application deployed by the database operator, written in Java using Quarkus
- operator-database-backup - A Go application to query the database and upload the data to cloud object storage. This container is launched on a schedule by the database operator
- operator-application-scaler - A Go application used to make autoscaling decisions for the front-end. It queries Prometheus metrics exposed by the simple-microservice, and if necessary, modifies the custom resource which defines the size of the front-end deployment. This container is launched on a schedule by the application operator
Scripts are provided to automate build and deployment:
- scripts - Automation to verify workstation prerequisites, build all container images and deploy to a Kubernetes or OpenShift cluster. Alternatively, the scripts can deploy pre-built 'golden' container images.
Check out this 1-minute demo video of the operators
Extended documentation can be found in this repo: https://ibm.github.io/operator-sample-go-documentation/
This project has been created by IBM Build Labs. We provide a service to selected IBM Business Partners (ISVs) looking to automate the operations of their solutions to meet the demands of clients, and open new routes to market using Red Hat OpenShift on any cloud/platform.
Introduction to IBM Build Labs
Our 40-minute masterclass video provides a useful inroduction to operators and why to use them