apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: azure-cni-installer-agent
spec:
  selector:
    matchLabels:
      acn: cni-installer
  template:
    metadata:
      labels:
        acn: cni-installer
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: node-role.kubernetes.io/agent
                    operator: Exists
      tolerations:
        - effect: NoSchedule
          key: node-role.kubernetes.io/master
          operator: Exists
      hostNetwork: true
      imagePullSecrets:
        - name: acndev.azurecr.io-key
      containers:
        - name: azure-cni-installer
          image: acndev.azurecr.io/azure-cni-installer:07f84fcdbef4
          env:
            - name: CNI_OS
              value: linux
            - name: CNI_TYPE
              value: singletenancy
            - name: CNI_IPAM_TYPE
              value: azure-cns
            - name: CNI_EXCEMPT_BINS
              value: azure-vnet-telemetry,azure-vnet-telemetry.config
          securityContext:
            privileged: true
          volumeMounts:
            - name: cni-bin
              mountPath: /opt/cni/bin
            - name: cni-conflist
              mountPath: /etc/cni/net.d
      restartPolicy: Always
      volumes:
        - name: cni-bin
          hostPath:
            path: /opt/cni/bin
            type: Directory
        - name: cni-conflist
          hostPath:
            path: /etc/cni/net.d
            type: Directory
