Create and publish OLM bundle
-
adds facility to create operational OLM bundle (
scripts/olm-bundle.sh) -
add CI jobs for publishing Bundle and Catalog
- for end-users to consume published Bundle and Catalog they need to follow #226 (comment 698219139)
Testing
See #226 (comment 699395470) for more
Prerequisites
-
autodeploy.shscript can be downloaded separately from !220 (merged) -
have a read/write access to some container registry and make sure you're logged into it. For example:
registry.gitlab.com/dmakovey/gitlab-operator-bundle- registry needs to be world-readable as k8s cluster (or more precisely OLM) will be pulling from it.
Process
Current process that works in KinD:
OLM_BUNDLE_SH="scripts/olm_bundle.sh"
AUTODEPLOY_SH="~/work/gitlab-operator.293-automate-gitlab-deployment-with-operator/scripts/autodeploy.sh"
export GITLAB_CHART_DIR=~/work/gitlab # needed for some of the auxilary scripts setting up env
export KIND_CLUSTER_NAME="olm37"
export GITLAB_CR_DEPLOPOY_MODE="ss" # ss - self-signed, cm - Cert Manager
export LOCAL_IP=192.168.3.194 # your local cluster IP, for KinD it's local IP
export GITLAB_OPERATOR_DIR=.
export GITLAB_CHART_VERSION="5.1.5" # make sure that chart version is CHART_VERSIONS
# Initialize infrastructure. Add CertManager
# this could also be achieved manually by creating k8s cluster following developer docs for cluster setup
# https://gitlab.com/gitlab-org/charts/gitlab/-/blob/master/doc/development/environment_setup.md
# autodeploy.sh is just a convenience wrapper:
${AUTODEPLOY_SH} create_cluster install_certmanager
export OSDK_BASE_DIR=".build/operatorsdk37" # we're going to generate our bunlde here
export KIND_CLUSTER_NAME="olm37" # match KIND_CLUSTER_NAME from above
export BUNDLE_IMAGE_TAG="beta37" # image Tag that will be applied to built bundle/catalog
export OPERATOR_TAG="0.1.0" # Operator release to reference (image tag for container)
# create a container registry and log into it prior to testing, for example:
export BUNDLE_REGISTRY="registry.gitlab.com/dmakovey/gitlab-operator-bundle"
${OLM_BUNDLE_SH} build_manifests generate_bundle patch_bundle
${OLM_BUNDLE_SH} validate_bundle compile_and_publish_bundle install_olm compile_and_publish_catalog create_namespace deploy_catalogsource
# wait for packagemanifest to become available:
kubectl get -A packagemanifests | grep gitlab
${OLM_BUNDLE_SH} deploy_operatorgroup deploy_subscription
# Generate CR manifest and deploy it.
# autodeploy.sh is a convenience wrapper that templates the operation
${AUTODEPLOY_SH} deploy_gitlab
Edited by Dmytro Makovey