apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: ds
  namespace: system
  labels:
    app.kubernetes.io/component: device-plugin
spec:
  selector:
    matchLabels:
      app.kubernetes.io/component: device-plugin
  template:
    metadata:
      annotations:
        scheduler.alpha.kubernetes.io/critical-pod: ""
      labels:
        app.kubernetes.io/component: device-plugin
    spec:
      tolerations:
      # Allow this pod to be rescheduled while the node is in "critical add-ons only" mode.
      # This, along with the annotation above marks this pod as a critical add-on.
      - key: CriticalAddonsOnly
        operator: Exists
      containers:
      - image: k8s-hostpath-device-plugin
        imagePullPolicy: IfNotPresent
        name: ctr
        args: 
        - deviceplugin
        - --debug
        volumeMounts:
        - name: device-plugin
          mountPath: /var/lib/kubelet/device-plugins
        - name: config
          mountPath: /k8s-hostpath-device-plugin
          readOnly: true
        - name: hostpath-sample
          mountPath: /sample
      volumes:
      - name: device-plugin
        hostPath:
          path: /var/lib/kubelet/device-plugins
      - name: config
        configMap:
          name: hostpath-sample-device-config
      - name: hostpath-sample
        hostPath: 
          path: /sample
          type: Directory
