apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: azure-ip-masq-agent
  namespace: kube-system
  labels:
    component: azure-ip-masq-agent
    kubernetes.io/cluster-service: "true"
    tier: node
spec:
  updateStrategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 50%
  selector:
    matchLabels:
      k8s-app: azure-ip-masq-agent
      tier: node
  template:
    metadata:
      labels:
        k8s-app: azure-ip-masq-agent
        tier: node
      annotations:
        cluster-autoscaler.kubernetes.io/daemonset-pod: "true"
    spec:
      priorityClassName: system-node-critical
      hostNetwork: true
      nodeSelector:
        kubernetes.io/os: linux
      tolerations:
        - key: CriticalAddonsOnly
          operator: Exists
        - key: node-role.kubernetes.io/master
          operator: Equal
          value: "true"
          effect: NoSchedule
        - operator: "Exists"
          effect: NoExecute
        - operator: "Exists"
          effect: NoSchedule
      containers:
        - name: azure-ip-masq-agent
          image: mcr.microsoft.com/oss/kubernetes/ip-masq-agent:v2.5.0
          imagePullPolicy: IfNotPresent
          args:
            - --enable-ipv6=false
          securityContext:
            privileged: true
          volumeMounts:
            - name: azure-ip-masq-agent-config-volume
              mountPath: /etc/config
          resources:
            requests:
              cpu: 50m
              memory: 50Mi
            limits:
              cpu: 50m
              memory: 250Mi
      volumes:
        - name: azure-ip-masq-agent-config-volume
          configMap:
            name: azure-ip-masq-agent-config
