--- apiVersion: apps/v1 kind: Deployment metadata: name: {{ .Release.Name }}-haproxy labels: app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} spec: replicas: 2 selector: matchLabels: app: {{ .Release.Name }}-haproxy template: metadata: labels: app: {{ .Release.Name }}-haproxy annotations: checksum/config: {{ include (print $.Template.BasePath "/haproxy/configmap.yaml") . | sha256sum }} spec: affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 1 podAffinityTerm: labelSelector: matchExpressions: - key: app operator: In values: - {{ .Release.Name }}-haproxy topologyKey: kubernetes.io/hostname containers: - image: haproxy:latest name: haproxy ports: - containerPort: 8080 name: http volumeMounts: - mountPath: /usr/local/etc/haproxy name: config volumes: - configMap: name: {{ .Release.Name }}-haproxy name: config