KubeVirt Installation for On-Premise Platforms

This section defines the steps needed to install 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.

Before installing the KubeVirt environment, the following basic platform steps should be followed:

  1. Enable Virtualization in the 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 crio (with runv).

  6. Set up a Kubernetes cluster.

Installing KubeVirt

Install the KubeVirt software components using the following the steps:

  1. Point at the latest 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
    
  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 https://kubevirt.io/user-guide/operations/installation/.

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: https://kubevirt.io/user-guide/virtual_machines/host-devices/.