Skip to content

Latest commit

 

History

History
121 lines (80 loc) · 3.22 KB

installation.md

File metadata and controls

121 lines (80 loc) · 3.22 KB

Installation

The below guidelines will explain how to build and install the operator on a remote cluster.

Prerequisites

  • go version v1.25+
  • operator SDK v1.9.0+ (Note: This version may need updating for current OCP versions)
  • opm v1.15.1+
  • yq
  • docker or podman
  • quay credentials
  • Add your valid quay pull-secret.yaml file in hack/prereqs/pull-secret.yaml

Declare Required Variables

export DOCKER_USER=<DOCKER_USER>
export DOCKER_PASS=<DOCKER_PASS>

It is also recommended to set a unique version label

export VERSION=<A_UNIQUE_VERSION>

Install Options

There are 3 ways to install the operator:

1. Run as a Deployment inside the cluster

make -f Makefile.dev prereqs subscriptions
make manifests generate
make docker-build docker-push deploy

OR

make -f Makefile.dev full-dev-install

This will

  1. Apply necessary prereqs. (Namespace, operatorgroup)
  2. Update manifests via kubebuilder
  3. Applies community operator subscriptions for dependencies
  4. Builds and pushes MCH Operator dev image
  5. Deploys operator via kustomize from config/manager

Note: For podman users, use make -f Makefile.dev podman-full-dev-install instead.

2. Run locally outside the cluster

This method is preferred during development cycle to deploy and test faster. LeaderElectionNamespace line in main.go must be uncommented. POD_NAMESPACE must be set.

make run

This will

  1. Run the go application from main.go directly against targetting cluster

3. Build and deploy catalog image to deploy operator via subscription

OLM will manage creation of most resources required to run the operator. This method builds and pushes an actual index image.

make manifests generate bundle bundle-build bundle-push catalog-build catalog-push
make -f Makefile.dev prereqs subscriptions catalog

OR

make -f Makefile.dev full-catalog-install

This will

  1. Update manifests via kubebuilder
  2. Bundle the operator
  3. Build and push the bundle image
  4. Build and push the catalog image
  5. Apply prereqs (Namespace, operatorgroup)
  6. Applies community operator subscriptions for dependencies
  7. Deploys Operator by deploying Catalogsource and subscription

Note: For podman users, use podman-bundle-build, podman-bundle-push instead of the docker equivalents.

Deploy MultiClusterHub instance

Once the operator is installed in the cluster, initiate an installation by creating an instance of MultiClusterHub. To create a default instance of MultiClusterHub:

make -f Makefile.dev cr

To customize the instance, first modify the spec in config/samples/operator_v1_multiclusterhub.yaml.

Cleanup

Delete multiclusterhub instance if it exists

kubectl delete mch --all

Clean up the operator and its resources:

make undeploy

If not all resources are properly cleaned up, follow the uninstall instructions at https://github.com/stolostron/deploy to manually clean up remaining resources.