Interlegis Public Rancher Charts for Kubernetes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

197 lines
6.1 KiB

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "emailleg.fullname" . }}
labels:
{{- include "emailleg.labels" . | nindent 4 }}
spec:
replicas: 1
selector:
matchLabels:
{{- include "emailleg.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "emailleg.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: imap
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.imap.image.repository }}:{{ .Values.imap.image.tag }}"
imagePullPolicy: {{ .Values.imap.image.pullPolicy }}
env:
- name: HOSTNAMES
value: "mail.{{ .Values.mail.domain }}"
- name: DOMAIN
value: {{ .Values.mail.domain }}
- name: POSTMASTER
value: "admin"
ports:
- name: imap
containerPort: 143
protocol: TCP
- name: pop
containerPort: 110
protocol: TCP
livenessProbe:
tcpSocket:
port: 143
initialDelaySeconds: 10
periodSeconds: 5
readinessProbe:
tcpSocket:
port: 143
initialDelaySeconds: 10
periodSeconds: 5
volumeMounts:
- mountPath: /data
subPath: data
name: mailvol
- mountPath: /mail
subPath: mail
name: mailvol
- mountPath: /certs
subPath: certs
name: mailvol
resources:
{{- toYaml .Values.imap.resources | nindent 12 }}
- name: smtp
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.smtp.image.repository }}:{{ .Values.smtp.image.tag }}"
imagePullPolicy: {{ .Values.smtp.image.pullPolicy }}
env:
- name: HOSTNAMES
value: "mail.{{ .Values.mail.domain }}"
- name: DOMAIN
value: {{ .Values.mail.domain }}
- name: POSTMASTER
value: "admin"
- name: MESSAGE_SIZE_LIMIT
value: {{ .Values.mail.messageSizeLimit }}
- name: RELAYNETS
value: {{ .Values.mail.relayNets }}
- name: RELAYHOST
value: {{ .Values.mail.relayHost }}
ports:
- name: smtp
containerPort: 25
protocol: TCP
livenessProbe:
tcpSocket:
port: 25
initialDelaySeconds: 10
periodSeconds: 5
readinessProbe:
tcpSocket:
port: 25
initialDelaySeconds: 10
periodSeconds: 5
volumeMounts:
- mountPath: /data
subPath: data
name: mailvol
- mountPath: /certs
subPath: certs
name: mailvol
resources:
{{- toYaml .Values.smtp.resources | nindent 12 }}
- name: admin
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.admin.image.repository }}:{{ .Values.admin.image.tag }}"
imagePullPolicy: {{ .Values.admin.image.pullPolicy }}
env:
- name: SECRET_KEY
value: {{ .Values.mail.secretKey }}
- name: DOMAIN
value: {{ .Values.mail.domain }}
- name: ENABLE_CERTBOT
value: false
- name: BABEL_DEFAULT_LOCALE
value: pt
- name: WEB_WEBMAIL
value: {{ .Values.mail.webmailAddr }}
- name: WEBSITE
value: {{ .Values.mail.website }}
- name: SITENAME
value: {{ .Values.mail.siteName }}
ports:
- name: http
containerPort: 80
protocol: TCP
livenessProbe:
httpGet:
path: /
port: 80
initialDelaySeconds: 10
periodSeconds: 5
readinessProbe:
httpGet:
path: /
port: 80
initialDelaySeconds: 10
periodSeconds: 5
volumeMounts:
- mountPath: /data
subPath: data
name: mailvol
- mountPath: /certs
subPath: certs
name: mailvol
resources:
{{- toYaml .Values.admin.resources | nindent 12 }}
- name: redis
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.redis.image.repository }}:{{ .Values.redis.image.tag }}"
imagePullPolicy: {{ .Values.redis.image.pullPolicy }}
ports:
- name: redis
containerPort: 6379
protocol: TCP
livenessProbe:
tcpSocket:
port: 6379
initialDelaySeconds: 10
periodSeconds: 5
readinessProbe:
tcpSocket:
port: 6379
initialDelaySeconds: 10
periodSeconds: 5
volumeMounts:
- mountPath: /data
subPath: redis
name: mailvol
resources:
{{- toYaml .Values.redis.resources | nindent 12 }}
volumes:
- name: mailvol
persistentVolumeClaim:
claimName: {{ include "emailleg.fullname" . }}-mailvol
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}