Conditionally deploy mailserver

This commit is contained in:
roschaefer 2019-09-18 01:19:50 +02:00
parent c8c345be48
commit 6e0b7c86e1
4 changed files with 56 additions and 0 deletions

View File

@ -10,5 +10,10 @@ data:
SENTRY_DSN_WEBAPP: {{ .Values.sentryDsnWebapp }}
SENTRY_DSN_BACKEND: {{ .Values.sentryDsnBackend }}
COMMIT: {{ .Values.commit }}
{{- if .Values.developmentMailserverDomain }}
SMTP_HOST: {{ .Release.Name }}-mailserver
SMTP_PORT: "25"
{{- else }}
SMTP_HOST: {{ .Values.smtpHost }}
SMTP_PORT: {{ .Values.smtpPort }}
{{- end }}

View File

@ -0,0 +1,34 @@
{{- if .Values.developmentMailserverDomain }}
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{ .Release.Name }}-mailserver
spec:
replicas: 1
minReadySeconds: 15
progressDeadlineSeconds: 60
selector:
matchLabels:
human-connection.org/selector: deployment-mailserver
template:
metadata:
labels:
human-connection.org/selector: deployment-mailserver
name: mailserver
spec:
containers:
- name: mailserver
image: djfarrelly/maildev
imagePullPolicy: {{ .Values.pullPolicy }}
ports:
- containerPort: 80
- containerPort: 25
envFrom:
- configMapRef:
name: {{ .Release.Name }}-configmap
- secretRef:
name: {{ .Release.Name }}-secrets
restartPolicy: Always
terminationGracePeriodSeconds: 30
status: {}
{{- end}}

View File

@ -0,0 +1,16 @@
{{- if .Values.developmentMailserverDomain }}
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-mailserver
spec:
ports:
- name: web
port: 80
targetPort: 80
- name: smtp
port: 25
targetPort: 25
selector:
human-connection.org/selector: deployment-mailserver
{{- end}}

View File

@ -3,6 +3,7 @@ commit: 889a7cdd24dda04a139b2b77d626e984d6db6781
pullPolicy: Always
# configs
developmentMailserverDomain: "nitro-mailserver.human-connection.org"
smtpHost: "mailserver.human-connection"
smtpPort: "25"
smtpUsername: