--- apiVersion: apps/v1 kind: {{ ternary "Deployment" "DaemonSet" .Values.service.create }} metadata: name: {{ include "easyhaproxy.fullname" . }} namespace: {{ .Release.Namespace }} labels: {{- include "easyhaproxy.labels" . | nindent 4 }} spec: selector: matchLabels: {{- include "easyhaproxy.selectorLabels" . | nindent 6 }} template: metadata: labels: {{- include "easyhaproxy.selectorLabels" . | nindent 8 }} spec: affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: {{ .Values.masterNode.label }} operator: In values: {{- toYaml .Values.masterNode.values | nindent 18 }} serviceAccountName: {{ include "easyhaproxy.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: http containerPort: 80 {{ if not .Values.service.create }}hostPort: {{ .Values.binding.ports.http }}{{ end }} - name: https containerPort: 443 {{ if not .Values.service.create }}hostPort: {{ .Values.binding.ports.https }}{{ end }} - name: stats containerPort: 1936 {{ if not .Values.service.create }}hostPort: {{ .Values.binding.ports.stats }}{{ end }} {{- range $port := .Values.binding.additionalPorts }} - name: extra{{ $port }} containerPort: {{ $port }} {{ if not $.Values.service.create }}hostPort: {{ $port }}{{ end }} {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} env: - name: EASYHAPROXY_DISCOVER value: kubernetes - name: HAPROXY_USERNAME value: {{ .Values.easyhaproxy.stats.username }} - name: HAPROXY_PASSWORD value: {{ .Values.easyhaproxy.stats.password }} - name: EASYHAPROXY_REFRESH_CONF value: {{ .Values.easyhaproxy.refresh | quote }} - name: HAPROXY_CUSTOMERRORS value: {{ .Values.easyhaproxy.customErrors | quote}} - name: EASYHAPROXY_SSL_MODE value: {{ .Values.easyhaproxy.sslMode }} - name: EASYHAPROXY_LOG_LEVEL value: {{ .Values.easyhaproxy.logLevel.easyhaproxy }} - name: HAPROXY_LOG_LEVEL value: {{ .Values.easyhaproxy.logLevel.haproxy }} - name: CERTBOT_LOG_LEVEL value: {{ .Values.easyhaproxy.logLevel.certbot }}