---
apiVersion: batch/v1
kind: Job
metadata:
  annotations:
    helm.sh/hook: post-delete
    helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded
  labels:
    app.kubernetes.io/instance: amd-gpu-operator
    app.kubernetes.io/name: node-feature-discovery
    app.kubernetes.io/version: v0.16.1
  name: amd-gpu-operator-node-feature-discovery-prune
  namespace: kube-amd-gpu
spec:
  template:
    metadata:
      labels:
        app.kubernetes.io/instance: amd-gpu-operator
        app.kubernetes.io/name: node-feature-discovery
        app.kubernetes.io/version: v0.16.1
        role: prune
    spec:
      affinity:
        nodeAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
            - preference:
                matchExpressions:
                  - key: node-role.kubernetes.io/master
                    operator: In
                    values:
                      - ""
              weight: 1
            - preference:
                matchExpressions:
                  - key: node-role.kubernetes.io/control-plane
                    operator: In
                    values:
                      - ""
              weight: 1
      containers:
        - args:
            - -prune
          command:
            - nfd-master
          image: registry.k8s.io/nfd/node-feature-discovery@sha256:0bd331dc6acf082d3353a7ddad6b5725a13cd141b60b31e97a1cd4cf90da0d99 # Original tag: v0.16.1
          imagePullPolicy: IfNotPresent
          name: nfd-master
          securityContext:
            allowPrivilegeEscalation: false
            capabilities:
              drop:
                - ALL
            readOnlyRootFilesystem: true
            runAsNonRoot: true
      restartPolicy: Never
      serviceAccountName: amd-gpu-operator-node-feature-discovery-prune
      tolerations:
        - effect: NoSchedule
          key: node-role.kubernetes.io/master
          operator: Equal
          value: ""
        - effect: NoSchedule
          key: node-role.kubernetes.io/control-plane
          operator: Equal
          value: ""