apiVersion: apps/v1
kind: DaemonSet
metadata:
  labels:
    app: nfd
  name: nfd-topology-updater
  namespace: node-feature-discovery
spec:
  selector:
    matchLabels:
      app: nfd-topology-updater
  template:
    metadata:
      labels:
        app: nfd-topology-updater
    spec:
      containers:
        - args:
            - -server=nfd-master:8080
            - -kubelet-config-file=/host-var/lib/kubelet/config.yaml
            - -podresources-socket=/host-var/lib/kubelet/pod-resources/kubelet.sock
            - -sleep-interval=10s
          command:
            - nfd-topology-updater
          env:
            - name: NODE_NAME
              valueFrom:
                fieldRef:
                  fieldPath: spec.nodeName
          image: ${NFD_CONTAINER_IMAGE}
          imagePullPolicy: Always
          name: nfd-topology-updater
          securityContext:
            allowPrivilegeEscalation: false
            capabilities:
              drop:
                - ALL
            readOnlyRootFilesystem: true
            runAsUser: 0
          volumeMounts:
            - mountPath: /host-var/lib/kubelet/config.yaml
              name: kubelet-podresources-conf
            - mountPath: /host-var/lib/kubelet/pod-resources/kubelet.sock
              name: kubelet-podresources-sock
            - mountPath: /host-sys
              name: host-sys
      dnsPolicy: ClusterFirstWithHostNet
      serviceAccount: nfd-topology-updater
      volumes:
        - hostPath:
            path: /sys
          name: host-sys
        - hostPath:
            path: /var/lib/kubelet/config.yaml
          name: kubelet-podresources-conf
        - hostPath:
            path: /var/lib/kubelet/pod-resources/kubelet.sock
          name: kubelet-podresources-sock
