
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: intel-gpu-plugin
  namespace: kube-system
  labels:
    app: intel-gpu-plugin
spec:
  selector:
    matchLabels:
      app: intel-gpu-plugin
  template:
    metadata:
      labels:
        app: intel-gpu-plugin
    spec:
      nodeSelector:
        feature.node.kubernetes.io/pci-0300_8086.present: "true"
      # initContainers:
      # - name: intel-gpu-initcontainer
      #   image: intel/intel-gpu-initcontainer:0.20.0
      #   imagePullPolicy: IfNotPresent
      #   securityContext:
      #     readOnlyRootFilesystem: true
      #   volumeMounts:
      #   - mountPath: /etc/kubernetes/node-feature-discovery/source.d/
      #     name: nfd-source-hooks
      containers:
      - name: intel-gpu-plugin
        env:
          - name: NODE_NAME
            valueFrom:
              fieldRef:
                fieldPath: spec.nodeName
        image: intel/intel-gpu-plugin:0.20.0
        imagePullPolicy: IfNotPresent
        securityContext:
          readOnlyRootFilesystem: true
        volumeMounts:
        - name: devfs
          mountPath: /dev/dri
          readOnly: true
        - name: sysfs
          mountPath: /sys/class/drm
          readOnly: true
        - name: kubeletsockets
          mountPath: /var/lib/kubelet/device-plugins
      volumes:
      - name: devfs
        hostPath:
          path: /dev/dri
      - name: sysfs
        hostPath:
          path: /sys/class/drm
      - name: kubeletsockets
        hostPath:
          path: /var/lib/kubelet/device-plugins
      # - name: nfd-source-hooks
      #   hostPath:
      #     path: /etc/kubernetes/node-feature-discovery/source.d/
      #     type: DirectoryOrCreate
      # nodeSelector:
      #   kubernetes.io/arch: amd64