apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: antman-local-coordinator
spec:
  selector:
    matchLabels:
      name: antman-local-coordinator
  template:
    metadata:
      labels:
        name: antman-local-coordinator
    spec:
      hostPID: true
      # hostIPC: true
      hostNetwork: true
      containers:
      - name: antman-local-coordinator
        # securityContext:
        #   privileged: true
        env:
          - name: NVIDIA_VISIBLE_DEVICES
            value: all
          - name: NODE_NAME
            valueFrom:
              fieldRef:
                fieldPath: spec.nodeName
        image: registry.cn-zhangjiakou.aliyuncs.com/pai-image/antman:test
        workingDir: /workspace
        command:
          - "python"
          - "local_coordinator.py"
        resources:
          limits:
            memory: 2048Mi
          requests:
            cpu: 400m
            memory: 2048Mi
        volumeMounts:
        - name: varlog
          mountPath: /var/log
        - name: varlibdockercontainers
          mountPath: /var/lib/docker/containers
          readOnly: true
        - name: etcdpem
          mountPath: /etc/kubernetes/pki/etcd
          readOnly: true
        - name: antman
          mountPath: /tmp/antman
      # terminationGracePeriodSeconds: 30
      volumes:
      - name: varlog
        hostPath:
          path: /var/log
      - name: varlibdockercontainers
        hostPath:
          path: /var/lib/docker/containers
      - name: etcdpem
        hostPath:
          path: /etc/kubernetes/pki/etcd
      - name: antman
        hostPath:
          path: /tmp/antman
