Skip to content

Script to generate OLM (Operator-LifeCycle-Manager) Bundles for RabbitMQ Kubernetes operators

License

Notifications You must be signed in to change notification settings

rabbitmq/OLM-Package-Repo

Repository files navigation

OLM-Package-Repo-For-RabbitMQ-K8s-Operators

Script to generate OLM (Operator-LifeCycle-Manager) Bundles for RabbitMQ Kubernetes operators

Starting from our operator manifests:

cluster-operator-manifest
messaging-topology-operator-manifest

The script is producing bundles like:

cluster-operator-olm-bundle
messaging-topology-operator-olm-bundle

That can be published to operatorhub/openshift marketplace

This script is mainly used by our operator pipelines:

operator-pipeline

But it can be used for testing/extension ecc...

Basic Guidelines followed:

https://olm.operatorframework.io/docs/tasks/creating-operator-bundle/

How to create, publish and test an OLM Bundle:

https://devopstales.github.io/home/oml/

How to use the script

the project is based on poetry

It can be used in this way:

poetry run generate_bundle ./rabbitmq_olm_package_repo/manifests_crds/cluster-operator.yaml 2.7.0 ./OLM_generated_bundle_example/rabbitmq-cluster-operator
poetry run generate_bundle ./rabbitmq_olm_package_repo/manifests_crds_messaging_topology_operator/messaging-topology-operator-with-certmanager.yaml 1.14.0 ./OLM_generated_bundle_example/rabbitmq-messaging-topology-operator

First parameter is the operator release file like:

cluster-operator-manifest

The second parameter the version of the Bundle we are creating (Same version of the cluster operator)
Third parameter is the output folder where the bundle is generated

How the script works

The script is based on ytt and a set of template files https://carvel.dev/ytt/

From a generator file containing metadata:

cluster-operator-generator-manifest

the script iss applying a set of ytt overlay defined in:

https://github.com/rabbitmq/OLM-Package-Repo/blob/general_clean_up/rabbitmq_olm_package_repo/generators/cluster_operator_generators/

Limitations

The script at the moment doesn't support the detection of new controllers and webhooks in the bundle
This is mainly because the mapping is completely different and at the moment the operators are stable (in the last 3 years just 2 new controllers were added in the messaging topology operator).

In case a new controller needs to be added you need to manually add it in the generator file:
messaging-topology-operator-generator-manifest

In case the controller uses a webhook (like in case of the messaging topology operator), also the webhook needs to be added in:
web-hook mapping

How using OLM is different from the standard installation

When using the OLM packaging to install and use the two RabbitMQ Kubernetes Operators: (RabbitMQ cluster operator and RabbitMQ Messaging Topology Operator) you need to follow the OLM general documentation:

https://olm.operatorframework.io/docs/

Interesting section are about (Installation and Upgrade):

https://docs.openshift.com/container-platform/4.15/operators/admin/olm-upgrading-operators.html

OG and Subscriptions:

https://docs.openshift.com/container-platform/4.15/operators/understanding/olm/olm-understanding-operatorgroups.html

https://olm.operatorframework.io/docs/advanced-tasks/operator-scoping-with-operatorgroups/

https://olm.operatorframework.io/docs/concepts/crds/subscription/

There are a few scenarios like (upgrade, certificate management, volume management) that may be different when using OLM.

In particular a few scenarios that diverge from the standard RabbitMQ operator documentation are:

Run tests

You can run test with:

poetry run pytest

Test are automatically run by our github flow on every PR or merge on main.

About

Script to generate OLM (Operator-LifeCycle-Manager) Bundles for RabbitMQ Kubernetes operators

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •