Operator that deploys resources for KubeVirt
The operator deploys and manages resources needed by these six components:
- Common Instancetypes and Preferences Bundle
- Common Templates Bundle
- VM Console Proxy
- KubeVirt Tekton Tasks
- Template Validator
- Metrics rules - Currently it is only a single Prometheus rule containing the count of all running VMs.
The ssp-operator requires an Openshift cluster to run properly.
The following resource types and CRDs are needed by ssp-operator when deployed on an OpenShift environment:
| Resource type / CRD | Needed by |
|---|---|
dataimportcrons.cdi.kubevirt.io |
data-sources operand (Kind DataImportCron) |
datavolumes.cdi.kubevirt.io/v1beta1 |
data-sources operand (Kind DataVolume and DataVolumeSource) |
datasources.cdi.kubevirt.io/v1beta1 |
data-sources operand (Kind DataSource) |
prometheusrules.monitoring.coreos.com |
metrics operand (Kind PrometheusRule) |
template.openshift.io/v1 |
common-templates operand (Kind Template) |
virtualmachineclusterinstancetypes.instancetypes.kubevirt.io/v1alpha2 |
common-instancetypes operand (Kind VirtualMachineClusterInstancetype) |
virtualmachineclusterpreferences.instancetypes.kubevirt.io/v1alpha2 |
common-instancetypes operand (Kind VirtualMachineClusterPreference) |
pipelines.tekton.dev |
tekton-pipelines operand (Kind Pipeline) |
tasks.tekton.dev |
tekton-tasks operand (Kind Task) |
The following resource types and CRDs are needed by ssp-operator when deployed on a vanilla k8s environment:
| Resource type / CRD | Needed by |
|---|---|
virtualmachineclusterinstancetypes.instancetypes.kubevirt.io/v1alpha2 |
common-instancetypes operand (Kind VirtualMachineClusterInstancetype) |
virtualmachineclusterpreferences.instancetypes.kubevirt.io/v1alpha2 |
common-instancetypes operand (Kind VirtualMachineClusterPreference) |
pipelines.tekton.dev |
tekton-pipelines operand (Kind Pipeline) |
tasks.tekton.dev |
tekton-tasks operand (Kind Task) |
virtualMachine.kubevirt.io |
vm-controller operand (Kind VirtualMachine) |
The Hyperconverged Cluster Operator automatically installs the SSP operator when deploying.
The operator can be installed manually by applying the file ssp-operator.yaml from GitHub releases:
oc apply -f ssp-operator.yamlTo install the latest released version, the following commands can be used:
export SSP_VERSION=$(curl https://api.github.com/repos/kubevirt/ssp-operator/releases/latest | jq '.name' | tr -d '"')
oc apply -f https://github.com/kubevirt/ssp-operator/releases/download/${SSP_VERSION}/ssp-operator.yamlTo activate the operator, a CR needs to be created. An example is in config/samples/ssp_v1beta2_ssp.yaml.
The Make will try to install kustomize, however if it is already installed it will not reinstall it. In case of an error, make sure you are using at least v3 of kustomize, available here: https://kustomize.io/
To build the container image run:
make container-buildTo upload the image to the default repository run:
make container-pushThe repository and image name and tag can be changed with these variables:
export IMG_REPOSITORY=<registry>/<image_name> # for example: export IMG_REPOSITORY=quay.io/kubevirt/ssp-operator
export IMG_TAG=<image_tag> # for example: export IMG_TAG=latestAfter the image is pushed to the repository, manifests and the operator can be deployed using:
make deployPlease note that building and deploying the Template Validator requires a separate process
To build the container image run:
make build-template-validator-containerTo upload the image to the default repository run:
make push-template-validator-containerThe repository and image name and tag can be changed with these variables:
export VALIDATOR_REPOSITORY=<registry>/<image_name> # for example: export VALIDATOR_REPOSITORY=quay.io/kubevirt/kubevirt-template-validator
export VALIDATOR_IMG_TAG=<image_tag> # for example: export VALIDATOR_IMG_TAG=latestYou should also edit the deployment to pull the image you want, for example you can use this command:
oc set env deployment/ssp-operator VALIDATOR_IMAGE=$VALIDATOR_IMGThe reconciliation can be paused by adding the following
annotation to the SSP resource:
kubevirt.io/operator.paused: "true"The operator will not react to any changes to the SSP resource
or any of the watched resources. If a paused SSP resource is deleted,
the operator will still cleanup all the dependent resources.