Installing OKD Virtualization

Install OKD Virtualization to add virtualization functionality to your OKD cluster.

If you install OKD Virtualization in a restricted environment with no internet connectivity, you must configure Operator Lifecycle Manager (OLM) for restricted networks.

If you have limited internet connectivity, you can configure proxy support in OLM to access the OperatorHub.

Installing the OKD Virtualization Operator

Install the OKD Virtualization Operator by using the OKD web console or the command line.

Installing the OKD Virtualization Operator by using the web console

You can deploy the OKD Virtualization Operator by using the OKD web console.

Prerequisites

  • Install OKD 4 on your cluster.

  • Log in to the OKD web console as a user with cluster-admin permissions.

Procedure

  1. From the Administrator perspective, click OperatorsOperatorHub.

  2. In the Filter by keyword field, type Virtualization.

  3. Select the KubeVirt HyperConverged Cluster Operator tile with the Red Hat source label.

  4. Read the information about the Operator and click Install.

  5. On the Install Operator page:

    1. Select stable from the list of available Update Channel options. This ensures that you install the version of OKD Virtualization that is compatible with your OKD version.

    2. For Installed Namespace, ensure that the Operator recommended namespace option is selected. This installs the Operator in the mandatory kubevirt-hyperconverged namespace, which is automatically created if it does not exist.

      Attempting to install the OKD Virtualization Operator in a namespace other than kubevirt-hyperconverged causes the installation to fail.

    3. For Approval Strategy, it is highly recommended that you select Automatic, which is the default value, so that OKD Virtualization automatically updates when a new version is available in the stable update channel.

      While it is possible to select the Manual approval strategy, this is inadvisable because of the high risk that it presents to the supportability and functionality of your cluster. Only select Manual if you fully understand these risks and cannot use Automatic.

      Because OKD Virtualization is only supported when used with the corresponding OKD version, missing OKD Virtualization updates can cause your cluster to become unsupported.

  6. Click Install to make the Operator available to the kubevirt-hyperconverged namespace.

  7. When the Operator installs successfully, click Create HyperConverged.

  8. Optional: Configure Infra and Workloads node placement options for OKD Virtualization components.

  9. Click Create to launch OKD Virtualization.

Verification

  • Navigate to the WorkloadsPods page and monitor the OKD Virtualization pods until they are all Running. After all the pods display the Running state, you can use OKD Virtualization.

Installing the OKD Virtualization Operator by using the command line

Subscribe to the OKD Virtualization catalog and install the OKD Virtualization Operator by applying manifests to your cluster.

Subscribing to the OKD Virtualization catalog by using the CLI

Before you install OKD Virtualization, you must subscribe to the OKD Virtualization catalog. Subscribing gives the kubevirt-hyperconverged namespace access to the OKD Virtualization Operators.

To subscribe, configure Namespace, OperatorGroup, and Subscription objects by applying a single manifest to your cluster.

Prerequisites

  • Install OKD 4 on your cluster.

  • Install the OpenShift CLI (oc).

  • Log in as a user with cluster-admin privileges.

Procedure

  1. Create a YAML file that contains the following manifest:

    1. apiVersion: v1
    2. kind: Namespace
    3. metadata:
    4. name: kubevirt-hyperconverged
    5. ---
    6. apiVersion: operators.coreos.com/v1
    7. kind: OperatorGroup
    8. metadata:
    9. name: kubevirt-hyperconverged-group
    10. namespace: kubevirt-hyperconverged
    11. spec: {}
    12. ---
    13. apiVersion: operators.coreos.com/v1alpha1
    14. kind: Subscription
    15. metadata:
    16. name: hco-operatorhub
    17. namespace: kubevirt-hyperconverged
    18. spec:
    19. source: community-operators
    20. sourceNamespace: openshift-marketplace
    21. name: community-kubevirt-hyperconverged
    22. startingCSV: kubevirt-hyperconverged-operator.v4.14.0
    23. channel: "stable" (1)
    1Using the stable channel ensures that you install the version of OKD Virtualization that is compatible with your OKD version.
  2. Create the required Namespace, OperatorGroup, and Subscription objects for OKD Virtualization by running the following command:

    1. $ oc apply -f <file name>.yaml

You can configure certificate rotation parameters in the YAML file.

Deploying the OKD Virtualization Operator by using the CLI

You can deploy the OKD Virtualization Operator by using the oc CLI.

Prerequisites

  • An active subscription to the OKD Virtualization catalog in the kubevirt-hyperconverged namespace.

Procedure

  1. Create a YAML file that contains the following manifest:

    1. apiVersion: hco.kubevirt.io/v1beta1
    2. kind: HyperConverged
    3. metadata:
    4. name: kubevirt-hyperconverged
    5. namespace: kubevirt-hyperconverged
    6. spec:
  2. Deploy the OKD Virtualization Operator by running the following command:

    1. $ oc apply -f <file_name>.yaml

Verification

  • Ensure that OKD Virtualization deployed successfully by watching the PHASE of the cluster service version (CSV) in the kubevirt-hyperconverged namespace. Run the following command:

    1. $ watch oc get csv -n kubevirt-hyperconverged

    The following output displays if deployment was successful:

    Example output

    1. NAME DISPLAY VERSION REPLACES PHASE
    2. kubevirt-hyperconverged-operator.v4.14.0 OKD Virtualization 4.14.0 Succeeded

Next steps

  • The hostpath provisioner is a local storage provisioner designed for OKD Virtualization. If you want to configure local storage for virtual machines, you must enable the hostpath provisioner first.