-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docs and sample generated bundle
Add a generated bundle for kubernetes platform. Add docs on the bundle generation tool and on bundle geration for kubernetes. Signed-off-by: Nikhil Thomas <[email protected]>
- Loading branch information
1 parent
9429adc
commit 32edae6
Showing
40 changed files
with
284 additions
and
1,510 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
# Required for bundle generation to work. | ||
# TODO: add scorecard tests plugins. | ||
# eg: https://github.com/operator-framework/operator-sdk/tree/master/testdata/go/v3/memcached-operator/config/scorecard | ||
apiVersion: scorecard.operatorframework.io/v1alpha3 | ||
kind: Configuration | ||
metadata: | ||
name: config | ||
stages: | ||
- parallel: true | ||
tests: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
resources: | ||
- bases/config.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,68 @@ | ||
# Generating Bundles (release artifact) for OperatorHub | ||
|
||
1. From project root run: | ||
We can use [bundle.py](./tools/bundle.py) tool to generate operator bundles. The tool takes in | ||
a list of Kubernetes resource definitions (Deployment, Role, Rolebinding, ConfigMaps ...) and | ||
some metadata (bundle description, release channels, bundle icon graphic... ) and outputs operator bundle. | ||
|
||
## Quick Links | ||
|
||
1. [Generating Operator Bundle for Kubernetes](./kubernetes/README.md) | ||
1. [Generating Operator Bundle for OpenShift](./openshift/README.md) | ||
|
||
## Concepts | ||
|
||
### Bundle Generation "Strategies" | ||
|
||
The bundle generation strategy specifies how the tool accumulates input (list of kubernetes resources). | ||
Two strategies are supported: | ||
|
||
1. **release-manifest**: input files are collected from a pre-existing release.yaml file. This release.yaml | ||
could be from an already existing github release or from the result of `ko resolve cofig`. | ||
|
||
2. **local:** All input files are gathered in realtime from local repository extensive usage of `kustomize`. | ||
|
||
### Update Strategies | ||
|
||
An update strategy defines the update relations of the current bundle with the previous releases (bundles). | ||
The bundle generation tool supports 2 update strategies. | ||
|
||
1. **semver**: OLM will upgrade opertor to a bundle with higher semver version, in the current subscription channel | ||
2. **replaces**: OLM will follow explict `spec.replaces: <previous version>` filed specification | ||
|
||
more details: [semver-mode, replaces mode](https://k8s-operatorhub.github.io/community-operators/packaging-operator/) | ||
|
||
|
||
## Conventions | ||
|
||
The tool expects the following directory structure and a config.yaml for each platform. | ||
|
||
```bash | ||
export BUNDLE_ARGS="--workspace=operatorhub/kubernetes --operator-release-version=1.1.1 --channels=a,b --default-channel=a --fetch-strategy-local --upgrade-strategy-semver" | ||
make bundle | ||
kubernetes | ||
├── config.yaml | ||
├── manifests | ||
│ ├── bases | ||
│ │ └── tektoncd-operator.clusterserviceversion.template.yaml | ||
│ ├── fetch-strategy-local | ||
│ │ └── kustomization.yaml | ||
│ └── fetch-strategy-release-manifest | ||
│ └── kustomization.yaml | ||
``` | ||
|
||
## CLI flags | ||
|
||
[bundle.py cli flags](./tools/bundle-too-cli-flags.md) | ||
|
||
## Specifying Image Overrides using config.yaml | ||
|
||
[bunele generation config.yaml](./tools/CONFIG-DEFINITION.md) | ||
|
||
## Operator LifeCycle Manager Concepts | ||
|
||
- [Operator Bundle](https://operator-sdk.netlify.app/docs/olm-integration/quickstart-bundle/) | ||
- [ClusterServiceVersion CRD](https://olm.operatorframework.io/docs/concepts/crds/clusterserviceversion/) | ||
|
||
# References | ||
|
||
2. [Operator Lifecycle Manager (OLM) Documentation](https://olm.operatorframework.io/docs/) | ||
3. [Operator SDK OLM Integration Documentation](https://operator-sdk.netlify.app/docs/olm-integration/) | ||
4. [OperatorHub (Community Operators) Documentation](https://k8s-operatorhub.github.io/community-operators/packaging-operator/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# How to generate Operator Bundles for OpenShift | ||
|
||
For Kubernetes Platform ([operatorhub.io](https://operatorhub.io)) release we generate the | ||
bundle for using `release-manifest` strategy. | ||
|
||
## Steps to generate bundles from an existing release.yaml | ||
|
||
**Note:** The input release.yaml could be a github release or the result of `ko resolve config` | ||
|
||
1. Make sure that we have the release manifest file ready | ||
eg: | ||
```bash | ||
curl -L -o tektoncd-operaotr-0.49.0 https://github.com/tektoncd/operator/releases/download/v0.49.0/release.notags.yaml | ||
``` | ||
|
||
2. From the project root (tektoncd/operator) run | ||
|
||
```bash | ||
export BUNDLE_ARGS='--workspace operatorhub/kubernetes --operator-release-version 0.49.0 --channels alpha --default-channel alpha --fetch-strategy-release-manifest --release-manifest tektoncd-operaotr-0.49.0 --upgrade-strategy-semver' | ||
make operator-bundle | ||
``` | ||
|
||
**CLI flags explained** | ||
|
||
Flag | Description | ||
--------------------------------------------- | ----------- | ||
`--workspace operatorhub/kubernetes` | the working directory where the operator bundle should be assembled | ||
`--operator-release-version 0.49.0` | version of the release (version of bundle) | ||
`--channels alpha` | target release channel(s) (eg: stabe,preview) | ||
`--default-channel alpha` | set default channel of the operator | ||
`--fetch-strategy-release-manifest` | gather input kubernetes resources from a list of yaml manifests instead of using local files | ||
`--release-manifest tektoncd-operaotr-0.49.0` | specify release manifest file | ||
`--upgrade-strategy-semver` | specify update strategy (use `replaces` or `semver`) | ||
```` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
operatorhub/kubernetes/release-artifacts/bundle/tests/scorecard/config.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: scorecard.operatorframework.io/v1alpha3 | ||
kind: Configuration | ||
metadata: | ||
name: config | ||
stages: | ||
- parallel: true | ||
tests: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# How to generate Operator Bundles for OpenShift | ||
|
||
`TBD` |
Oops, something went wrong.