Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HowTo release Authorino Operator #173

Merged
merged 3 commits into from
Feb 21, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# How to release Authorino Operator

## Process

To release a version _“v0.W.Z”_ of Authorino Operator in GitHub and Quay.io, follow these steps:

1. Pick a stable (released) version _“v0.X.Y”_ of the operand known to be compatible with operator’s image for _“v0.W.Z_”;
if needed, [make a release of the operand first](https://github.com/Kuadrant/authorino/blob/main/RELEASE.md).

2. Run the GHA [Release operator](https://github.com/Kuadrant/authorino-operator/actions/workflows/release.yaml); make
sure to fill all the fields:

* Branch containing the release workflow file – default: `main`
* Commit SHA or branch name of the operator to release – usually: `main`
* Operator version to release (without prefix) – i.e. `0.W.Z`
* Authorino version the operator enables installations of (without prefix) – i.e. `0.X.Y`
* If the release is a prerelease
* Bundle and catalog channels (comma-separated) – usually: `stable`

3. Run the GHA [Build and push images](https://github.com/Kuadrant/authorino-operator/actions/workflows/build-images.yaml)
for the _“v0.W.Z”_ tag, specifying ‘Authorino version’ equals to _“0.X.Y”_ (without the leading “v”). This will cause the
new images (bundle and catalog included) to be built and pushed to the corresponding repos in
[quay.io/kuadrant](https://quay.io/organization/kuadrant).


### Publishing the Operator in OpenShift Community Operators
Open a PR in the [OpenShift Community Operators repo](http://github.com/redhat-openshift-ecosystem/community-operators-prod)
([example](https://github.com/redhat-openshift-ecosystem/community-operators-prod/pull/1595) |
[docs](https://redhat-openshift-ecosystem.github.io/community-operators-prod/operator-release-process/)).

The usual steps are:

1. Start a new branch named `authorino-operator-v0.W.Z`

2. Create a new directory `operators/authorino-operator/0.W.Z` containing:

* Copy the bundle files from `github.com/kuadrant/authorino-operator/tree/v0.W.Z/bundle`
* Copy `github.com/kuadrant/authorino-operator/tree/v0.W.Z/bundle.Dockerfile` with the proper fix to the COPY commands
(i.e. remove /bundle from the paths)

### Publishing the Operator in Kubernetes Community Operators (OperatorHub.io)

1. Open a PR in the [Kubernetes Community Operators repo](https://github.com/k8s-operatorhub/community-operators)
([example](https://github.com/k8s-operatorhub/community-operators/pull/1655) | [docs](https://operatorhub.io/contribute)).

2. The usual steps are the same as for the
[OpenShift Community Operators](https://docs.google.com/document/d/1tLveyv8Zwe0wKyfUTWOlEnFeMB5aVGqIVDUjVYWax0U/edit#heading=h.b5tapxn4sbk5)
hub.


## Notes on Authorino Operator’s automated builds and references to the Authorino manifests and default version

* PRs merged to the main branch of Authorino Operator cause a new image to be built (GH Action) and pushed automatically
to `quay.io/kuadrant/authorino-operator:<git-ref>` – the `quay.io/kuadrant/authorino-operator:latest` tag is also moved
to match the latest <git-ref>.

* Authorino Operator owns the manifests required by the operator, i.e. Authorino CRD + role definitions, and hosts a copy
didierofrivia marked this conversation as resolved.
Show resolved Hide resolved
of the operand’s manifests (CRD+roles), merged together with the deploy and bundle manifests:
didierofrivia marked this conversation as resolved.
Show resolved Hide resolved

* Stored in `config/deploy/manifests.yaml` file that gathers resources of both operator (CRD, RBAC, Deployment, Service)
and operand (CRD, role definitions)
didierofrivia marked this conversation as resolved.
Show resolved Hide resolved
* Committing this file allows to install all the manifests and deploy an instance of the operator from a single
didierofrivia marked this conversation as resolved.
Show resolved Hide resolved
`kubectl apply` command
* Tons of docs in the Authorino repo relying on that
didierofrivia marked this conversation as resolved.
Show resolved Hide resolved
* Make target manifests is used to generate the compiled version of all manifests (operator’s and operand’s).
didierofrivia marked this conversation as resolved.
Show resolved Hide resolved
It accepts as parameters:

* `VERSION`: sets the version of the manifests of the operator generated by the operator-sdk command and image tag of
the deployment added to `config/deploy/manifests.yaml` (default: latest)
* `AUTHORINO_VERSION`: sets the operand’s branch that sources the manifests (CRD, role definitions) that are appended
to `config/deploy/manifests.yaml` (default: latest)

* Changes in the operand’s CRD/role definitions out date the `config/deploy/manifests.yaml` file, thus requiring a PR to
the operator repo ([example](https://github.com/Kuadrant/authorino-operator/pull/68))

* A make target `verify-manifests` verifies consistency of the manifests
didierofrivia marked this conversation as resolved.
Show resolved Hide resolved
* Triggered in the CI tests
* Causes all PRs in the Operator repo to break whenever there’s a change in the operand’s API committed to the main
branch → requires immediate update of the copy of operand’s manifests in the main branch of the operator and rebase of all PRs

* Apart from the operand’s manifests pinned to a specific or latest version in the copy committed to
`config/deploy/manifests.yaml`, the Operator’s code contains hard-coded references to the default version of the operand
to install:
* See `v1beta1.DefaultAuthorinoImage` (`api/v1beta1/authorino_types.go`)
didierofrivia marked this conversation as resolved.
Show resolved Hide resolved
* It can be overwritten in the Authorino CR → good for dev/test/staging workflows
* Set to "latest" in the main branch
Loading