apiVersion: apps/v1
kind: DaemonSet
metadata:
  labels:
    addonmanager.kubernetes.io/mode: Reconcile
    k8s-app: konnectivity-agent
  name: konnectivity-agent
  namespace: {{ .Release.Namespace }}
spec:
  selector:
    matchLabels:
      k8s-app: konnectivity-agent
  template:
    metadata:
      labels:
        k8s-app: konnectivity-agent
    spec:
      containers:
      - args:
        - --logtostderr=true
        - --proxy-server-host={{ .Values.loadBalancerIP }}
        - --ca-cert=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt
        - --proxy-server-port=8132
        - --admin-server-port=8133
        - --health-server-port={{ .Values.healthServerPort }}
        - --service-account-token-path=/var/run/secrets/tokens/konnectivity-agent-token
        - --agent-identifiers=host=$(HOST_IP)
        - --sync-forever=true
        - --keepalive-time=60m
        - --sync-interval=5s
        - --sync-interval-cap=30s
        - --probe-interval=5s
        - --v=3
        command:
        - /proxy-agent
        env:
        - name: HOST_IP
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: status.hostIP
        image: {{ .Values.image | quote }}
        livenessProbe:
          httpGet:
            path: /healthz
            port: {{ .Values.healthServerPort }}
          initialDelaySeconds: 15
          timeoutSeconds: 15
        name: konnectivity-agent
        resources: {}
        volumeMounts:
        - mountPath: /var/run/secrets/tokens
          name: konnectivity-agent-token
          readOnly: true
      priorityClassName: system-cluster-critical
      serviceAccountName: konnectivity-agent
      tolerations:
      - effect: NoSchedule
        key: node-role.kubernetes.io/master
        operator: Exists
      - effect: NoSchedule
        key: node-role.kubernetes.io/control-plane
        operator: Exists
      - key: CriticalAddonsOnly
        operator: Exists
      - effect: NoExecute
        key: node.kubernetes.io/not-ready
        operator: Exists
      volumes:
      - name: konnectivity-agent-token
        projected:
          sources:
          - serviceAccountToken:
              audience: system:konnectivity-server
              path: konnectivity-agent-token
  updateStrategy: {}
