104 lines
4.4 KiB
YAML
104 lines
4.4 KiB
YAML
---
|
|
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:
|
|
{{- if .Values.service.create }}
|
|
replicas: {{ .Values.replicaCount | default 1 }}
|
|
{{- end }}
|
|
selector:
|
|
matchLabels:
|
|
{{- include "easyhaproxy.selectorLabels" . | nindent 6 }}
|
|
template:
|
|
metadata:
|
|
labels:
|
|
{{- include "easyhaproxy.selectorLabels" . | nindent 8 }}
|
|
spec:
|
|
{{- if not .Values.service.create }}
|
|
affinity:
|
|
nodeAffinity:
|
|
requiredDuringSchedulingIgnoredDuringExecution:
|
|
nodeSelectorTerms:
|
|
- matchExpressions:
|
|
- key: {{ .Values.masterNode.label }}
|
|
operator: In
|
|
values:
|
|
{{- toYaml .Values.masterNode.values | nindent 18 }}
|
|
{{- end }}
|
|
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 }}
|
|
- name: dashboard
|
|
containerPort: 11936
|
|
{{ if not .Values.service.create }}hostPort: {{ .Values.binding.ports.dashboard }}{{ 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 }}
|
|
{{- if .Values.easyhaproxy.stats.corsOrigin }}
|
|
- name: HAPROXY_STATS_CORS_ORIGIN
|
|
value: {{ .Values.easyhaproxy.stats.corsOrigin | quote }}
|
|
{{- end }}
|
|
- 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 }}
|
|
{{- if .Values.easyhaproxy.certbot.email }}
|
|
- name: EASYHAPROXY_CERTBOT_EMAIL
|
|
value: {{ .Values.easyhaproxy.certbot.email }}
|
|
{{- end }}
|
|
- name: POD_NAMESPACE
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.namespace
|
|
- name: EASYHAPROXY_UPDATE_INGRESS_STATUS
|
|
value: {{ .Values.ingressStatus.enabled | quote }}
|
|
- name: EASYHAPROXY_DEPLOYMENT_MODE
|
|
value: {{ .Values.ingressStatus.deploymentMode | quote }}
|
|
{{- if .Values.ingressStatus.externalHostname }}
|
|
- name: EASYHAPROXY_EXTERNAL_HOSTNAME
|
|
value: {{ .Values.ingressStatus.externalHostname | quote }}
|
|
{{- end }}
|
|
- name: EASYHAPROXY_STATUS_UPDATE_INTERVAL
|
|
value: {{ .Values.ingressStatus.updateInterval | quote }}
|
|
{{- with .Values.extraEnv }}
|
|
{{- toYaml . | nindent 12 }}
|
|
{{- end }}
|