improwised-charts/mailhog/templates/deployment.yaml

88 lines
2.7 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "mailhog.fullname" . }}
labels:
app.kubernetes.io/name: {{ include "mailhog.name" . }}
helm.sh/chart: {{ include "mailhog.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
selector:
matchLabels:
app.kubernetes.io/name: {{ include "mailhog.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ include "mailhog.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.securityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ template "mailhog.name" . }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
env:
- name: MH_HOSTNAME
valueFrom:
fieldRef:
fieldPath: metadata.name
{{- if .Values.auth.enabled }}
- name: MH_AUTH_FILE
value: /authdir/{{ .Values.auth.fileName }}
{{- end }}
{{- with .Values.extraEnv }}
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: 8025
protocol: TCP
- name: tcp-smtp
containerPort: 1025
protocol: TCP
livenessProbe:
tcpSocket:
port: tcp-smtp
initialDelaySeconds: 10
timeoutSeconds: 1
readinessProbe:
tcpSocket:
port: tcp-smtp
{{- if .Values.auth.enabled }}
volumeMounts:
- name: authdir
mountPath: /authdir
readOnly: true
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
{{- if .Values.auth.enabled }}
- name: authdir
secret:
secretName: {{ template "mailhog.authFileSecret" . }}
{{- end }}