KubeVirt Installation for On-Premise Platforms

This section provides instructions on installing the KubeVirt environment on a local Intel® Gaudi® 2 AI accelerator cluster. KubeVirt provides a unified development platform where developers can build, modify, and deploy applications residing in both application containers as well as virtual machines in a common, shared environment.

Prerequisites

Before installing the KubeVirt environment, follow the below steps:

  1. Enable virtualization in BIOS.

  2. Prepare host platform for PCIe passthrough.

  3. Confirm that the system is capable of running hardware accelerated KVM virtual machines (ie, possesses virtualization technology).

  4. Verify input–output memory management unit (IOMMU) is loaded. To ensure the groups are valid, confirm that the various PCI devices are mapped to IOMMU groups.

  5. Install container runtimes. KubeVirt is currently supported on the following container runtimes: containerd and CRI-O (with runv).

  6. Set up a Kubernetes cluster.

Installing KubeVirt

  1. Point to the latest KubeVirt release:

    export RELEASE=$(curl https://storage.googleapis.com/kubevirt-prow/release/kubevirt/kubevirt/stable.txt)
    
  2. Deploy the KubeVirt operator:

    kubectl apply -f https://github.com/kubevirt/kubevirt/releases/download/${RELEASE}/kubevirt-operator.yaml
    

    Note

    kubectl requires access to a Kubernetes cluster to implement its commands. To check the access to kubectl command, run $ kubectl get pod -A.

  3. Create the KubeVirt CR (instance deployment request) which triggers the actual installation:

    kubectl apply -f https://github.com/kubevirt/kubevirt/releases/download/${RELEASE}/kubevirt-cr.yaml
    
  4. Wait until all KubeVirt components are running and execute the below kubectl command:

    kubectl -n kubevirt wait kv kubevirt --for condition=Available
    

For further details on the above steps, refer to KubeVirt user guide.

Setting up and Executing .yaml File

  1. Run the following command to create the .yaml file and use it to add the permitted host devices:

    cat << EOF | sudo ~/permittedHostDevices.yaml
    apiVersion: kubevirt.io/v1
    kind: KubeVirt
    metadata:
      name: kubevirt
      namespace: kubevirt
    spec:
      imagePullPolicy: IfNotPresent
      certificateRotateStrategy: {}
      configuration:
        permittedHostDevices:
          pciHostDevices:
            - pciVendorSelector: "1da3:1020"
          resourceName: "habana.ai/gaudi2"
    EOF
    
  2. Apply the file:

    kubectl apply -f ~/permittedHostDevices.yaml
    

For additional information, refer to the KubeVirt documentation.