Operator pattern for managing multi-operator products
Operator pattern for managing multi-operator products
A unified operator deploying and controlling KubeVirt and several adjacent operators:
This operator is typically installed from the Operator Lifecycle Manager (OLM), and creates operator CustomResources (CRs) for its underlying operators as can be seen in the diagram below. Use it to obtain an opinionated deployment of KubeVirt and its helper operators.
In the HCO components doc you can get an up-to-date overview of the involved components.
To install the default community HyperConverged Cluster Operator, along with its underlying components, run:
$ curl -L https://api.github.com/repos/kubevirt/hyperconverged-cluster-operator/tarball/main | \
tar --strip-components=1 -xvzf - kubevirt-hyperconverged-cluster-operator-*/deploy/kustomize
$ ./deploy/kustomize/deploy_kustomize.shThe deployment is completed when HCO custom resource reports its condition as Available.
For more explanation and advanced options for HCO deployment using kustomize, refer to kustomize deployment documentation.
As prerequisites, OLM is required. If you wish to use cert-manager for certificates, the script in hack/deploy-cert-manager.sh might be helpful.
To build a custom bundle and index image, with opm installed run:
…This will:
You can then use the index image to deploy HCO via OLM by creating a CatalogSource pointing to your custom index image. Alternatively, you can install the operator via operator-sdk like so:
operator-sdk run bundle -n --timeout=10m Hyperconverged Cluster Operator is publishing the latest bundle to quay.io/kubevirt
before publishing tagged, stable releases to OperatorHub.io.
The latest bundle is quay.io/kubevirt/hyperconverged-cluster-bundle:1.20.0-unstable. It is built and pushed on every merge to
main branch, and contains the most up-to-date manifests, which are pointing to the most recent application images: hyperconverged-cluster-operator
and hyperconverged-cluster-webhook, which are built together with the bundle from the current code at the main branch.
The unreleased bundle can be consumed on a cluster by creating a CatalogSource pointing to the index image that contains
that bundle: quay.io/kubevirt/hyperconverged-cluster-index:1.20.0-unstable.
Make the bundle available in the cluster's packagemanifest by adding the following CatalogSource:
…Create the namespace for the HCO.
$ kubectl create ns kubevirt-hyperconvergedFor the next set of commands, we will use the
operator-sdk CLI tool. Below commands will create a
bundle image, push this image, and finally use that bundle image to install the HyperConverged cluster
Operator on the OLM-enabled cluster.
…Create an HCO CustomResource, which creates the KubeVirt CR, launching KubeVirt, CDI (Containerized Data Importer), Network-addons, VM import, TTO (Tekton Tasks Operator) and SSP (Scheduling, Scale and Performance) Operator.
$ kubectl create -f deploy/hco.cr.yaml -n kubevirt-hyperconverged#For k8s cluster:
$ export KUBEVIRT_PROVIDER="k8s-1.36"#For okd cluster:
$ export KUBEVIRT_PROVIDER="okd-4.1"$ cd /hyperconverged-cluster-operator$ make cluster-down$ make cluster-up$ make cluster-syncUse ./cluster/kubectl.sh as the command-line tool.
For example:
$ ./cluster/kubectl.sh get pods --all-namespacesIn order to use HCO on top of external provider, i.e CRC, use:
export KUBEVIRT_PROVIDER=external
export IMAGE_REGISTRY=
export REGISTRY_NAMESPACE=
make cluster-syncoc binary should exist, and the cluster should be reachable via oc commands.
No open issues yet, or sync has not completed.