# istio_istio-cni_tolerations.golden.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
  labels:
    app.kubernetes.io/instance: istio
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: istio-cni
    app.kubernetes.io/part-of: istio
    app.kubernetes.io/version: 1.0.0
    helm.sh/chart: cni-1.0.0
    install.operator.istio.io/owning-resource: unknown
    istio.io/rev: default
    k8s-app: istio-cni-node
    operator.istio.io/component: Cni
    release: istio
  name: istio-cni-node
  namespace: istio-system
spec:
  selector:
    matchLabels:
      k8s-app: istio-cni-node
  template:
    metadata:
      annotations:
        container.apparmor.security.beta.kubernetes.io/install-cni: unconfined
        prometheus.io/path: /metrics
        prometheus.io/port: "15014"
        prometheus.io/scrape: "true"
        sidecar.istio.io/inject: "false"
      labels:
        app.kubernetes.io/instance: istio
        app.kubernetes.io/managed-by: Helm
        app.kubernetes.io/name: istio-cni
        app.kubernetes.io/part-of: istio
        app.kubernetes.io/version: 1.0.0
        helm.sh/chart: cni-1.0.0
        istio.io/dataplane-mode: none
        k8s-app: istio-cni-node
        sidecar.istio.io/inject: "false"
    spec:
      containers:
      - args:
        - --log_output_level=info
        command:
        - install-cni
        env:
        - name: REPAIR_NODE_NAME
          valueFrom:
            fieldRef:
              fieldPath: spec.nodeName
        - name: REPAIR_RUN_AS_DAEMON
          value: "true"
        - name: REPAIR_SIDECAR_ANNOTATION
          value: sidecar.istio.io/status
        - name: ALLOW_SWITCH_TO_HOST_NS
          value: "true"
        - name: NODE_NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: spec.nodeName
        - name: GOMEMLIMIT
          valueFrom:
            resourceFieldRef:
              divisor: "1"
              resource: limits.memory
        - name: GOMAXPROCS
          valueFrom:
            resourceFieldRef:
              divisor: "1"
              resource: limits.cpu
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: POD_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        envFrom:
        - configMapRef:
            name: istio-cni-config
        image: registry.istio.io/testing/install-cni:latest
        name: install-cni
        ports:
        - containerPort: 15014
          name: metrics
          protocol: TCP
        readinessProbe:
          httpGet:
            path: /readyz
            port: 8000
        resources:
          requests:
            cpu: 100m
            memory: 100Mi
        securityContext:
          capabilities:
            add:
            - NET_ADMIN
            - NET_RAW
            - SYS_PTRACE
            - SYS_ADMIN
            - DAC_OVERRIDE
            drop:
            - ALL
          privileged: false
          runAsGroup: 0
          runAsNonRoot: false
          runAsUser: 0
        volumeMounts:
        - mountPath: /host/opt/cni/bin
          name: cni-bin-dir
        - mountPath: /host/proc
          name: cni-host-procfs
          readOnly: true
        - mountPath: /host/etc/cni/net.d
          name: cni-net-dir
        - mountPath: /var/run/istio-cni
          name: cni-socket-dir
      nodeSelector:
        kubernetes.io/os: linux
      priorityClassName: system-node-critical
      serviceAccountName: istio-cni
      terminationGracePeriodSeconds: 30
      tolerations:
      - effect: NoSchedule
        key: example-key
        operator: Exists
      volumes:
      - hostPath:
          path: /opt/cni/bin
        name: cni-bin-dir
      - hostPath:
          path: /proc
          type: Directory
        name: cni-host-procfs
      - hostPath:
          path: /etc/cni/net.d
        name: cni-net-dir
      - hostPath:
          path: /var/run/istio-cni
        name: cni-socket-dir
      - hostPath:
          path: /var/run/netns
          type: DirectoryOrCreate
        name: cni-netns-dir
  updateStrategy:
    rollingUpdate:
      maxUnavailable: 1
    type: RollingUpdate