apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: label-nodes-daemon
  namespace: kube-system
spec:
  selector:
    matchLabels:
      name: label-nodes-daemon
  template:
    metadata:
      labels:
        name: label-nodes-daemon
    spec:
      tolerations:
      - operator: "Exists"
        key: nvidia.com/gpu
      hostNetwork: true
      containers:
      - name: label-nodes-daemon
        image: python:3.10
        command:
        - bash
        - -c
        - |
          pip install kubernetes
          python -u /scripts/label-nodes-daemon.py
        volumeMounts:
        - name: scripts-volume
          mountPath: /scripts
      volumes:
      - name: scripts-volume
        configMap:
          name: topology-scheduler-scripts
      serviceAccount: topology-scheduler
