apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: mig-operator-daemon
spec:
  selector:
    matchLabels:
      name: mig-operator-daemon
  template:
    metadata:
      labels:
        name: mig-operator-daemon
    spec:
      hostPID: true
      hostIPC: true
      
      serviceAccountName: k8s-mig-operator-daemonset-sa

      nodeSelector:
        nvidia.com/gpu.product: "A100-SXM4-40GB"

      containers:
      
      - image: riskfuel/mig-operator:v0.0.1
        imagePullPolicy: Always
        name: mig-operator
        securityContext:
          privileged: true
        env:
        - name: PYTHONUNBUFFERED
          value: "0"
        - name: ALLOW_NODE_RESET
          value: "True"
        - name: DRY_RUN
          value: "False"
        - name: NVIDIA_MIG_MONITOR_DEVICES
          value: all
        - name: ANSIBLE_HOST_KEY_CHECKING
          value: "False"
        volumeMounts:
          - name: dmi-product-name
            mountPath: "/sys/class/dmi/id/product_name"
          - mountPath: "/var/app-secret"
            name: ssh-key
            readOnly: true
      volumes:
        - name: dmi-product-name
          hostPath:
            path: "/sys/class/dmi/id/product_name"
        - name: ssh-key
          secret:
            secretName: migoperator-secret
