Kubernetes Setup Guide

You can install the Intel GPU plugin in a Kubernetes cluster in several ways. This guide describes the two most common approaches.

While following these procedures:

  • Replace <RELEASE_VERSION> in the commands with the desired release tag, or use main to deploy development images.

  • Add --dry-run=client -o yaml to the kubectl commands to preview the generated YAML before you apply the configuration to the cluster.

Installation with Node Feature Discovery

Deploy the Intel GPU plugin using Node Feature Discovery (NFD). NFD detects Intel GPUs on cluster nodes and applies the appropriate node labels. The Intel GPU plugin is configured with a node selector that targets nodes labeled by NFD.

  1. Deploy NFD if it is not present in the cluster.

    $ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd?ref=<RELEASE_VERSION>'
    
  2. Create NodeFeatureRules to detect Intel GPUs.

    $ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/nfd/overlays/node-feature-rules?ref=<RELEASE_VERSION>'
    
  3. Deploy the Intel GPU plugin DaemonSet.

    $ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/gpu_plugin/overlays/nfd_labeled_nodes?ref=<RELEASE_VERSION>'
    
  4. Confirm that the NFD master and worker pods are running.

    $ kubectl get pods -n node-feature-discovery
    NAME                          READY   STATUS    RESTARTS   AGE
    nfd-master-599c58dffc-9wql4   1/1     Running   0          25h
    nfd-worker-qqq4h              1/1     Running   0          25h
    
  5. Wait approximately one minute for NFD to detect the rules and apply the node labels.

  6. Confirm that NFD applied the expected node labels, such as intel.feature.node.kubernetes.io/dlb for Intel DLB devices.

    $ kubectl get no -o json | jq .items[].metadata.labels | grep intel.feature.node.kubernetes.io/dlb
      "intel.feature.node.kubernetes.io/dlb": "true",
    
  7. Review the full list of supported labels in the deployments/operator/samples directory.

    $ grep -r feature.node.kubernetes.io/ deployments/operator/samples/
    deployments/operator/samples/deviceplugin_v1_dlbdeviceplugin.yaml:    intel.feature.node.kubernetes.io/dlb: 'true'
    deployments/operator/samples/deviceplugin_v1_qatdeviceplugin.yaml:    intel.feature.node.kubernetes.io/qat: 'true'
    deployments/operator/samples/deviceplugin_v1_sgxdeviceplugin.yaml:    intel.feature.node.kubernetes.io/sgx: 'true'
    deployments/operator/samples/deviceplugin_v1_gpudeviceplugin.yaml:    intel.feature.node.kubernetes.io/gpu: "true"
    deployments/operator/samples/deviceplugin_v1_fpgadeviceplugin.yaml:    intel.feature.node.kubernetes.io/fpga-arria10: 'true'
    deployments/operator/samples/deviceplugin_v1_dsadeviceplugin.yaml:    intel.feature.node.kubernetes.io/dsa: 'true'
    

Installation with Intel Device Plugin Operator

Install the Intel GPU plugin using the Intel Device Plugin Operator. It allows you to configure the Intel GPU plugin without customizing the deployment files.

  1. Ensure that cert-manager is installed and running in the cluster. The default deployment for the Intel Device Plugin Operator uses self-signed certificates; for a production cluster, configure a proper certificate issuer instead.

  2. Verify that all pods in the cert-manager namespace are running.

    $ kubectl get pods -n cert-manager
    NAME                                      READY   STATUS    RESTARTS   AGE
    cert-manager-7747db9d88-bd2nl             1/1     Running   0          21d
    cert-manager-cainjector-87c85c6ff-59sb5   1/1     Running   0          21d
    cert-manager-webhook-64dc9fff44-29cfc     1/1     Running   0          21d
    
  3. Deploy the Intel Device Plugin Operator.

    $ kubectl apply -k 'https://github.com/intel/intel-device-plugins-for-kubernetes/deployments/operator/default?ref=<RELEASE_VERSION>'
    
  4. Deploy device plugins by creating the corresponding custom resources (CRs). Sample custom resources are available in the upstream repository.

  5. Deploy the GPU plugin by applying its custom resource, for example GpuDevicePlugin.

    $ kubectl apply -f https://raw.githubusercontent.com/intel/intel-device-plugins-for-kubernetes/main/deployments/operator/samples/deviceplugin_v1_gpudeviceplugin.yaml
    
  6. Verify that the resource is running.

    $ kubectl get GpuDevicePlugin
    NAME                     DESIRED   READY   NODE SELECTOR   AGE
    gpudeviceplugin-sample   1         1                       5s
    

Intel Device Plugin Operator supports multiple custom resources for each device type, such as QAT and DSA. With multiple custom resources and different node selectors, you can customize the device plugin configuration per node or per group of nodes.

Verification

Verify that the plugin is running on the expected nodes by checking that the GPU resources appear in each node’s allocatable resources.

$ kubectl get nodes -o=jsonpath="{range .items[*]}{.metadata.name}{'\n'}{' i915: '}{.status.allocatable.gpu\.intel\.com/i915}{'\n'}"
master
 i915: 1