---
apiVersion: v1
kind: Pod
metadata:
  name: haproxy
  namespace: kube-system
  labels:
    addonmanager.kubernetes.io/mode: Reconcile
    k8s-app: kube-haproxy
  annotations:
    cfg-checksum: "{{ .cfg_md5.stdout }}"
spec:
  hostNetwork: true
  dnsPolicy: ClusterFirstWithHostNet
  nodeSelector:
    kubernetes.io/os: linux
  priorityClassName: system-node-critical
  containers:
    - name: haproxy
      image: {{ .kubernetes.haproxy.image }}
      imagePullPolicy: IfNotPresent
      resources:
        requests:
          cpu: 25m
          memory: 32M
      livenessProbe:
        httpGet:
          path: /healthz
          port: {{ .kubernetes.haproxy.health_port }}
      readinessProbe:
        httpGet:
          path: /healthz
          port: {{ .kubernetes.haproxy.health_port }}
      volumeMounts:
        - mountPath: /usr/local/etc/haproxy/
          name: etc-haproxy
          readOnly: true
  volumes:
    - name: etc-haproxy
      hostPath:
        path: /etc/kubekey/haproxy
