che-operator/olm
che-bot 5de237a873
Copy 7.24.0 csv to master (#615)
Signed-off-by: Mykhailo Kuznietsov <mkuznets@redhat.com>

Co-authored-by: Mykhailo Kuznietsov <mkuznets@redhat.com>
2021-01-08 16:07:15 +02:00
..
eclipse-che-preview-kubernetes Copy 7.24.0 csv to master (#615) 2021-01-08 16:07:15 +02:00
eclipse-che-preview-openshift Copy 7.24.0 csv to master (#615) 2021-01-08 16:07:15 +02:00
README.md Use test operator image in the CSV. (#594) 2020-12-22 20:10:46 +02:00
addDigests.sh update example for addDigests.sh so it... (#528) 2020-11-13 10:35:47 +02:00
buildAndPushInitialBundle.sh feat: Remove old olm format nightly files (#435) 2020-09-14 10:18:57 +03:00
buildDigestMap.sh Exclude next images. (#338) 2020-07-13 12:15:51 +03:00
check-yq.sh CRW-579 add three new scripts for adding digests, building map of digests in registries, and introspecting containers (including scratch ones) to extract files (#202) 2020-03-19 18:53:51 +02:00
digestExcludeList Add quay.io/eclipse/che-machine-exec to digestExcludeList (#393) 2020-08-07 11:10:08 +03:00
docker-run.sh Use operator sdk 0.17.2 (#545) 2020-11-20 13:57:06 +02:00
dockerContainerExtract.sh CRW-563 improve generation of digests from tags in registries and operator (#206) 2020-03-26 10:43:12 +02:00
force-pulling-olm-images-job.yaml Use new opm bundle format. (#423) 2020-09-10 10:33:24 +03:00
images.sh update example for addDigests.sh so it... (#528) 2020-11-13 10:35:47 +02:00
incrementNightlyBundles.sh Add commit new nightly bundle github action. (#498) 2020-10-20 17:46:41 +03:00
minikube-registry-addon.sh Use new opm bundle format. (#423) 2020-09-10 10:33:24 +03:00
olm.sh Refactoring test scripts (#557) 2020-12-04 17:20:49 +02:00
prepare-community-operators-update.sh remove -o flag (don't open a browser for the PR); don't copy the commit comment twice (#593) 2020-12-22 16:11:31 +02:00
push-olm-files-to-quay.sh prevent spurious warnings about diff files (#568) 2020-12-07 09:19:47 +02:00
release-olm-files.sh set preserveUnknownFields: false for nighlty bundle (#509) 2020-10-30 10:27:20 +02:00
testCatalogSource.sh Use test operator image in the CSV. (#594) 2020-12-22 20:10:46 +02:00
testUpdate.sh feat: Remove old olm format nightly files (#435) 2020-09-14 10:18:57 +03:00
update-crd-files.sh Use operator sdk 0.17.2 (#545) 2020-11-20 13:57:06 +02:00
update-nightly-bundle.sh Remove operator-local.yaml (#599) 2020-12-30 13:30:29 +02:00

README.md

Operator lifecycle manager

Prerequisites

OLM packages scripts are using some required dependencies that need to be installed

WARNING: Please make sure to use the precise v0.17.2 version of the operator-sdk.

If these dependencies are not installed, docker-run.sh can be used as a container bootstrap to run a given script with the appropriate dependencies, for instance:

$ docker-run.sh olm/update-nightly-bundle.sh

Eclipse Che OLM bundles

OLM (operator lifecycle manager) provides ways of installing operators. One of the convenient way how to achieve it is by using OLM bundles. See more about the format: https://github.com/openshift/enhancements/blob/master/enhancements/olm/operator-bundle.md. There two "nightly" platform-specific OLM bundles for Сhe operator:

  • deploy/olm-catalog/eclipse-che-preview-kubernetes/manifests
  • deploy/olm-catalog/eclipse-che-preview-openshift/manifests

Each bundle consists of a cluster service version file (CSV) and a custom resource definition file (CRD). CRD file describes checlusters Kubernetes api resource object(object fields name, format, description and so on). Kubernetes api needs this information to correctly store a custom resource object "checluster". Custom resource object users could modify to change Eclipse Che configuration. Che operator watches checlusters object and re-deploy Che with desired configuration. The CSV file contains all "deploy" and "permission" specific information, which OLM needs to install Eclipse Che operator.

Test Eclipse Che using Application registry (Deprecated)

Notice: it is doesn't work on Openshift >= 4.6

To test stable versions of Che operator you have to use Eclipse Che application registry. To test the latest stable Che launch test script in the olm folder:

$ ./testCatalogSource.sh ${platform} "stable" ${namespace} "Marketplace"

To test migration from one stable version to another one:

$ ./testUpdate.sh ${platform} "stable" ${namespace}

Testing custom CatalogSource and nightly bundle images

To test nightly Che operator you have to use the OLM CatalogSource(index) image. CatalogSource image stores in the internal database information about OLM bundles with different versions of the Eclipse Che. For nightly channel (dependent on platform) Eclipse Che provides two CatalogSource images:

  • quay.io/eclipse/eclipse-che-kubernetes-opm-catalog:preview for Kubernetes platform;
  • quay.io/eclipse/eclipse-che-openshift-opm-catalog:preview for Openshift platform;

For each new nightly version Eclipse Che provides nightly bundle image with name pattern:

quay.io/eclipse/eclipse-che-<openshift|kubernetes>-opm-bundles:<CHE_VERSION>-<INCREMENTAL_VERSION>.nightly

For example:

quay.io/eclipse/eclipse-che-kubernetes-opm-bundles:7.18.0-1.nightly
quay.io/eclipse/eclipse-che-openshift-opm-bundles:7.19.0-5.nightly

Build custom nightly OLM images

For test purpose you can build your own "nightly" CatalogSource and bundle images with your latest development changes and use it in the test scripts. To build these images you can use script olm/buildAndPushInitialBundle.sh:

$ export IMAGE_REGISTRY_USER_NAME=<IMAGE_REGISTRY_USER_NAME> && \
  export IMAGE_REGISTRY_HOST=<IMAGE_REGISTRY_HOST> && \
  ./buildAndPushInitialBundle.sh <openshift|kubernentes> [FROM-INDEX-IMAGE]

This script will build and push for you two images: CatalogSource(index) and bundle one:

  • ${IMAGE_REGISTRY_HOST}/${IMAGE_REGISTRY_USER_NAME}/eclipse-che-<openshift|kubernetes>-opm-bundles:<CHE_VERSION>-<INCREMENTAL_VERSION>.nightly
  • ${IMAGE_REGISTRY_HOST}/${IMAGE_REGISTRY_USER_NAME}/eclipse-che-<openshift|kubernetes>-opm-catalog:preview

CatalogSource images are additive. It's mean that you can re-use bundles from another CatalogSource image and include them to your custom CatalogSource image. For this purpose you can specify the argument FROM-INDEX-IMAGE. For example:

$ export IMAGE_REGISTRY_USER_NAME=<IMAGE_REGISTRY_USER_NAME> && \
  export IMAGE_REGISTRY_HOST=<IMAGE_REGISTRY_HOST> && \
  ./buildAndPushInitialBundle.sh openshift "quay.io/eclipse/eclipse-che-openshift-opm-catalog:preview"

Testing custom CatalogSource and bundle images on the Openshift

To test the latest custom "nightly" bundle:

$ ./testCatalogSource.sh "openshift" "nightly" <ECLIPSE_CHE_NAMESPACE> "catalog"

If your CatalogSource image contains few bundles, you can test migration from previous bundle to the latest:

$ export IMAGE_REGISTRY_USER_NAME=<IMAGE_REGISTRY_USER_NAME> && \
  export IMAGE_REGISTRY_HOST=<IMAGE_REGISTRY_HOST> && \
  ./testUpdate.sh "openshift" "nightly" <ECLIPSE_CHE_NAMESPACE>

Testing custom CatalogSource and bundle images on the Kubernetes

To test your custom CatalogSource and bundle images on the Kubernetes you need to use public image registry. For "docker.io" you don't need any extra steps with pre-creation image repositories. But for "quay.io" you should pre-create the bundle and and catalog image repositories manually and make them publicly visible. If you want to save repositories "private", then it is not necessary to pre-create them, but you need to provide an image pull secret to the cluster to prevent image pull 'unauthorized' error.

To test the latest custom "nightly" bundle:

$ export IMAGE_REGISTRY_USER_NAME=<IMAGE_REGISTRY_USER_NAME> && \
  export IMAGE_REGISTRY_HOST=<IMAGE_REGISTRY_HOST> && \
 ./testCatalogSource.sh "kubernetes" "nightly" <ECLIPSE_CHE_NAMESPACE> "catalog"

If your CatalogSource image contains few bundles, you can test migration from previous bundle to the latest:

$ export IMAGE_REGISTRY_USER_NAME=<IMAGE_REGISTRY_USER_NAME> && \
  export IMAGE_REGISTRY_HOST=<IMAGE_REGISTRY_HOST> && \
  ./testUpdate.sh "kubernetes" "nightly" <ECLIPSE_CHE_NAMESPACE>

Also you can test your changes without a public registry. You can use the minikube cluster and enable the minikube "registry" addon. For this purpose use the script:

$ olm/minikube-registry-addon.sh

This script creates port forward to minikube private registry: 127.0.0.1:5000. Should be launched before test execution in the separated terminal. To stop this script you can use Ctrl+C. You can check that private registry was forwarded to the localhost:

$ curl -X GET localhost:5000/v2/_catalog
{"repositories":[]}

With this private registry you can test Che operator from development bundle:

$ export IMAGE_REGISTRY_HOST="127.0.0.1:5000" && \
  export IMAGE_REGISTRY_USER_NAME="" && \
  ./testCatalogSource.sh "kubernetes" "nightly" <ECLIPSE_CHE_NAMESPACE> "catalog"

Tips: If minikube was installed locally (driver 'none', local installation minikube), then registry is available on the host 0.0.0.0 without port forwarding but it requires sudo.