Skip to content

Commit

Permalink
initial changes to addon-package docs
Browse files Browse the repository at this point in the history
  • Loading branch information
maryfrances01 committed Jul 7, 2023
1 parent b65c64b commit 7f95f77
Showing 1 changed file with 40 additions and 15 deletions.
55 changes: 40 additions & 15 deletions content/en/docs/creating-addons/top-level-operator/addon-package.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ linkTitle: Plug and Play Addon

## Package

For each addon that has `packageOperator` defined in its `spec`, a
ClusterObjectTemplate[https://package-operator.run/docs/getting_started/api-reference/#clusterobjecttemplate].
The average user does not need to interact with the `ClusterObjectTemplate`; they will interact with the resultant
ClusterPackage[https://package-operator.run/docs/getting_started/api-reference/#clusterpackage] that is created.
Each addon that includes a `packageOperator` defined in its `spec`, will have a corresponding
[ClusterObjectTemplate](https://package-operator.run/docs/getting_started/api-reference/#clusterobjecttemplate).
However, regular users typically do not need to directly interact with the `ClusterObjectTemplate`.
Instead, they can interact with the resulting
[ClusterPackage](https://package-operator.run/docs/getting_started/api-reference/#clusterpackage)
manifest that is generated from it.

The `ClusterPackage` manifest will look like this:
Example `ClusterPackage` manifest:

```shell
apiVersion: package-operator.run/v1alpha1
Expand All @@ -32,15 +34,38 @@ spec:
targetNamespace: pko-test-ns-00-req-apy-dsy-pdy
```

The `deadMansSnitchUrl` and the `pagerDutyKey` come from the `configMap`s with the default names in the default
locations
documented in
the [addons deadMansSnitch](https://mt-sre.github.io/docs/creating-addons/monitoring/deadmanssnitch_integration/)
The `deadMansSnitchUrl` and the `pagerDutyKey` are obtained
from the ConfigMaps with their default names and locations,
as documented in the
[addons deadMansSnitch](https://mt-sre.github.io/docs/creating-addons/monitoring/deadmanssnitch_integration/)
and
the [addons pagerDuty documentation](https://mt-sre.github.io/docs/creating-addons/monitoring/pagerduty_integration/)
respectively. *To have these values inject you must maintain the default naming scheme and location of these configMaps*
.
the [addons pagerDuty](https://mt-sre.github.io/docs/creating-addons/monitoring/pagerduty_integration/) documentation.

All the values in `.spec.config.addonsv1` can be injected into the objects contained in your packageImage. See the
[package operator documentation](https://package-operator.run/docs/guides/packaging-an-application/#go-templates) to see
how to do this.
**IMPORTANT:** To successfully inject the `deadMansSnitchUrl` and `pagerDutyKey` values,
you must keep the default naming scheme and location of the corresponding ConfigMaps.

Additionally, all the values present in `.spec.config.addonsv1`
can be injected into the objects within your packageImage.
See the
[package operator](https://package-operator.run/docs/guides/packaging-an-application/#go-templates)
documentation for more information.

## Tenants Onboarding Steps

You can generate the packageImage yourself using the
[package operator](https://package-operator.run/docs/guides/packaging-an-application/#build--validate) documentation.
However, we recommend you use the Managed Tenants Bundles (MTB) facilities.

The following steps are an example of generating the packageImage for the reference-addon package using the MTB flow:

1. In the MTB repository, create a `package` directory and add the `manifests.yaml` inside the `package` directory.
See the following
[merge request](https://gitlab.cee.redhat.com/service/managed-tenants-bundles/-/tree/main/addons/reference-addon/package)
for an example.

2. The MTB CI creates the packageImage and the Operator Lifecycle Manager (OLM) Index Image as part of the team's
[addon folder](https://gitlab.cee.redhat.com/service/managed-tenants-bundles/-/tree/main/addons/reference-addon).

3. The MTB CI creates a merge request to the
[managed-tenants repository](https://gitlab.cee.redhat.com/service/managed-tenants/-/blob/main/addons/reference-addon/addonimagesets/stage/reference-addon.v0.10.1.yaml#L24)
and adds a new AddonImageSet with the PackageImage and OLM Index images.

0 comments on commit 7f95f77

Please sign in to comment.