diff --git a/README.md b/README.md index a53098c2..eb012d2c 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ An [Ansible AWX](https://github.com/ansible/awx) operator for Kubernetes built w * [Testing](#testing) * [Testing in Docker](#testing-in-docker) * [Testing in Minikube](#testing-in-minikube) + * [Generating a bundle](#generating-a-bundle) * [Release Process](#release-process) * [Build a new release](#build-a-new-release) * [Build a new version of the operator yaml file](#build-a-new-version-of-the-operator-yaml-file) @@ -417,6 +418,55 @@ Alternatively, you can also update the service `awx-service` in your namespace t #> minikube service -n --url ``` +### Generating a bundle + +> :warning: operator-sdk version 0.19.4 is needed to run the following commands + +If one has the Operator Lifecycle Manager (OLM) installed, the following steps is the process to generate the bundle that would nicely display in the OLM interface. + +At the root of this directory: + +1. Build and publish the operator + +``` +#> operator-sdk build registry.example.com/ansible/awx-operator:mytag +#> podman push registry.example.com/ansible/awx-operator:mytag +``` + +2. Build and publish the bundle + +``` +#> podman build . -f bundle.Dockerfile -t registry.example.com/ansible/awx-operator-bundle:mytag +#> podman push registry.example.com/ansible/awx-operator-bundle:mytag +``` + +3. Build and publish an index with your bundle in it + +``` +#> opm index add --bundles registry.example.com/ansible/awx-operator-bundle:mytag --tag registry.example.com/ansible/awx-operator-catalog:mytag +#> podman push registry.example.com/ansible/awx-operator-catalog:mytag +``` + +4. In your Kubernetes create a new CatalogSource pointing to `registry.example.com/ansible/awx-operator-catalog:mytag` + +``` +--- +apiVersion: operators.coreos.com/v1alpha1 +kind: CatalogSource +metadata: + name: + namespace: +spec: + displayName: 'myoperatorhub' + image: registry.example.com/ansible/awx-operator-catalog:mytag + publisher: 'myoperatorhub' + sourceType: grpc +``` + +Applying this template will do it. Once the CatalogSource is in a READY state, the bundle should be available on the OperatorHub tab (as part of the custom CatalogSource that just got added) + +5. Enjoy + ## Release Process There are a few moving parts to this project: diff --git a/bundle.Dockerfile b/bundle.Dockerfile new file mode 100644 index 00000000..f78084ba --- /dev/null +++ b/bundle.Dockerfile @@ -0,0 +1,14 @@ +FROM scratch + +LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1 +LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/ +LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/ +LABEL operators.operatorframework.io.bundle.package.v1=awx-operator +LABEL operators.operatorframework.io.bundle.channels.v1=alpha +LABEL operators.operatorframework.io.bundle.channel.default.v1=alpha +LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1 +LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v0.19.4 +LABEL operators.operatorframework.io.metrics.project_layout=ansible + +COPY deploy/olm-catalog/awx-operator/manifests /manifests/ +COPY deploy/olm-catalog/awx-operator/metadata /metadata/