Development Guide¶
Technology stack required for development¶
- operator-sdk version 1.32.0
- kind version v0.22.0
- git
- go version 1.21+
- kubernetes version v1.25+
- kubectl version v1.25+
Build¶
Run locally¶
You need an active session open to a kubernetes cluster.
Optionally, run kind with local-env-setup
.
Then, run the operator locally
Deploy the operator in a deployment object¶
Deploy the operator using OLM¶
You can deploy the operator using OLM just running a few commands.
No need to build any image. Kuadrant engineering team provides latest
and
released version tagged images. They are available in
the Quay.io/Kuadrant image repository.
Create kind cluster
Deploy OLM system
Deploy the operator using OLM. The make deploy-catalog
target accepts the following variables:
Makefile Variable | Description | Default value |
---|---|---|
CATALOG_IMG |
Catalog image URL | quay.io/kuadrant/limitador-operator-catalog:latest |
Build custom OLM catalog¶
If you want to deploy (using OLM) a custom limitador operator, you need to build your own catalog.
Build operator bundle image¶
The make bundle
target accepts the following variables:
Makefile Variable | Description | Default value | Notes |
---|---|---|---|
IMG |
Operator image URL | quay.io/kuadrant/limitador-operator:latest |
|
VERSION |
Bundle version | 0.0.0 |
|
RELATED_IMAGE_LIMITADOR |
Limitador bundle URL | quay.io/kuadrant/limitador:latest |
LIMITADOR_VERSION var could be use to build this URL providing the tag |
- Build the bundle manifests
make bundle [IMG=quay.io/kuadrant/limitador-operator:latest] \
[VERSION=0.0.0] \
[RELATED_IMAGE_LIMITADOR=quay.io/kuadrant/limitador:latest]
- Build the bundle image from the manifests
Makefile Variable | Description | Default value |
---|---|---|
BUNDLE_IMG |
Operator bundle image URL | quay.io/kuadrant/limitador-operator-bundle:latest |
- Push the bundle image to a registry
Makefile Variable | Description | Default value |
---|---|---|
BUNDLE_IMG |
Operator bundle image URL | quay.io/kuadrant/limitador-operator-bundle:latest |
Build custom catalog¶
The catalog format will be File-based Catalog.
Make sure all the required bundles are pushed to the registry. It is required by the opm
tool.
The make catalog
target accepts the following variables:
Makefile Variable | Description | Default value |
---|---|---|
BUNDLE_IMG |
Operator bundle image URL | quay.io/kuadrant/limitador-operator-bundle:latest |
REPLACES_VERSION |
Previous operator version | 0.0.0-alpha |
CHANNELS |
Catalog channels | preview |
make catalog [BUNDLE_IMG=quay.io/kuadrant/limitador-operator-bundle:latest] \
[REPLACES_VERSION=0.0.0-alpha] \
[CHANNELS=preview]
- Build the catalog image from the manifests
Makefile Variable | Description | Default value |
---|---|---|
CATALOG_IMG |
Operator catalog image URL | quay.io/kuadrant/limitador-operator-catalog:latest |
- Push the catalog image to a registry
You can try out your custom catalog image following the steps of the Deploy the operator using OLM section.
Cleaning up¶
Run tests¶
Unittests¶
Optionally, add TEST_NAME
makefile variable to run specific test
or even subtest
Integration tests¶
You need an active session open to a kubernetes cluster.
Optionally, run local cluster with kind
Run integration tests
All tests¶
You need an active session open to a kubernetes cluster.
Optionally, run local cluster with kind
Run all tests
Lint tests¶
(Un)Install Limitador CRD¶
You need an active session open to a kubernetes cluster.
Remove CRDs