We can use 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.
The bundle generation strategy specifies how the tool accumulates input (list of kubernetes resources). Two strategies are supported:
-
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. -
local: All input files are gathered in realtime from local repository extensive usage of
kustomize.
An update strategy defines the update relations of the current bundle with the previous releases (bundles). The bundle generation tool supports 2 update strategies.
- semver: OLM will upgrade opertor to a bundle with higher semver version, in the current subscription channel
- replaces: OLM will follow explict
spec.replaces: <previous version>filed specification
more details: semver-mode, replaces mode
The tool expects the following directory structure and a config.yaml for each platform.
kubernetes
├── config.yaml
├── manifests
│ ├── bases
│ │ └── tektoncd-operator.clusterserviceversion.template.yaml
│ ├── fetch-strategy-local
│ │ └── kustomization.yaml
│ └── fetch-strategy-release-manifest
│ └── kustomization.yaml