The goal of the hyperconverged-cluster-operator (HCO) is to provide a single entrypoint for multiple operators - kubevirt, cdi, networking, ect... - where users can deploy and configure them in a single object. This operator is sometimes referred to as a "meta operator" or an "operator for operators". Most importantly, this operator doesn't replace or interfere with OLM. It only creates operator CRs, which is the user's prerogative.
NOTE OLM is not a requirement to test. Once we publish operators through Marketplace|operatorhub.io, it will be.
NOTE Until we publish (and consume) the HCO and component operators through Marketplace|operatorhub.io, this is a means to demonstrate the HCO workflow without OLM.
Run the following script to apply the HCO operator:
$ curl https://raw.githubusercontent.com/kubevirt/hyperconverged-cluster-operator/master/deploy/deploy.sh | bash
NOTE
Until we publish (and consume) the HCO and component operators through
Marketplace|operatorhub.io, this is a means to demonstrate the HCO workflow
without OLM. Replace <docker_org>
with your Docker organization
as official operator-registry images for HCO will not be provided.
Build and push the converged HCO operator-registry image.
export REGISTRY_NAMESPACE=<container_org>
make bundleRegistry CONTAINER_TAG=example
Create the namespace for the HCO.
kubectl create ns kubevirt-hyperconverged
Create an OperatorGroup.
cat <<EOF | kubectl create -f -
apiVersion: operators.coreos.com/v1alpha2
kind: OperatorGroup
metadata:
name: hco-operatorgroup
namespace: kubevirt-hyperconverged
EOF
Create a Catalog Source.
cat <<EOF | kubectl create -f -
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: hco-catalogsource
namespace: openshift-operator-lifecycle-manager
spec:
sourceType: grpc
image: docker.io/$REGISTRY_NAMESPACE/hco-registry:example
displayName: KubeVirt HyperConverged
publisher: Red Hat
EOF
Create a subscription.
cat <<EOF | kubectl create -f -
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: hco-subscription
namespace: kubevirt-hyperconverged
spec:
channel: alpha
name: kubevirt-hyperconverged
source: hco-catalogsource
sourceNamespace: openshift-operator-lifecycle-manager
EOF
Create an HCO CustomResource, which creates the KubeVirt CR, launching KubeVirt.
kubectl create -f deploy/converged/crds/hco.cr.yaml
Lunch the HCO locally for testing, experimenting and developing.
NOTE: no need to install any type of kubenetes cluster as a prerequisite.
- Navigate to the project's directory
$ cd <path>/hyperconverged-cluster-opertor
- Remove an old cluster
$ make cluster-down
- Create a new cluster
$ make cluster-up
- Clean previous HCO deployment and re-deploy HCO
(When making a change, execute only this command - no need to repeat steps 1-3)
$ make cluster-sync
Use ./cluster/kubectl.sh
as the command-line tool. for example:
$ ./cluster/kubectl.sh get pods --all-namespaces