Skip to content
Snippets Groups Projects
Verified Commit d2fdf472 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

feat: add webmail functionality

parent 7f284065
No related branches found
No related tags found
No related merge requests found
Pipeline #2746 canceled
......@@ -44,6 +44,7 @@ data:
HOST_ADMIN: "{{ include "mailu-helm.fullname" . }}-admin.{{.Release.Namespace}}.svc.{{.Values.clusterSuffix}}"
ADMIN_ADDRESS: "{{ include "mailu-helm.fullname" . }}-admin.{{.Release.Namespace}}.svc.{{.Values.clusterSuffix}}"
HOST_FRONT: "{{ include "mailu-helm.fullname" . }}-front.{{.Release.Namespace}}.svc.{{.Values.clusterSuffix}}"
FRONT_ADDRESS: "{{ include "mailu-helm.fullname" . }}-front.{{.Release.Namespace}}.svc.{{.Values.clusterSuffix}}"
HOST_ANTISPAM_MILTER: "{{ include "mailu-helm.fullname" . }}-antispam.{{.Release.Namespace}}.svc.{{.Values.clusterSuffix}}"
ANTISPAM_MILTER_ADDRESS: "{{ include "mailu-helm.fullname" . }}-antispam.{{.Release.Namespace}}.svc.{{.Values.clusterSuffix}}:11332"
......
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "mailu-helm.fullname" . }}-webmail
labels:
component: webmail
{{- include "mailu-helm.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
component: webmail
{{- include "mailu-helm.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
component: webmail
{{- include "mailu-helm.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
volumes:
- name: webmail
{{- .Values.volumes.webmail | nindent 10 }}
containers:
- name: webmail
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "k8r.eu/justjanne/mailu-snappymail:{{ .Values.webmail.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
envFrom:
- configMapRef:
name: {{ include "mailu-helm.fullname" . }}
- secretRef:
name: {{ include "mailu-helm.fullname" . }}
env:
- name: HOST_FRONT
valueFrom:
configMapKeyRef:
key: FRONT_ADDRESS
name: {{ include "mailu-helm.fullname" . }}
ports:
- name: "http"
containerPort: 80
protocol: "TCP"
resources:
{{- toYaml .Values.webmail.resources | nindent 12 }}
volumeMounts:
- name: webmail
mountPath: "/data"
startupProbe:
httpGet:
path: /healthz
port: http
periodSeconds: 10
failureThreshold: 30
timeoutSeconds: 5
livenessProbe:
httpGet:
path: /healthz
port: http
periodSeconds: 10
failureThreshold: 3
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /healthz
port: http
periodSeconds: 10
failureThreshold: 1
timeoutSeconds: 5
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "mailu-helm.fullname" . }}-webmail
labels:
{{- include "mailu-helm.labels" . | nindent 4 }}
component: webmail
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/auth-url:
"http://{{ include "mailu-helm.fullname" . }}-admin.{{ .Release.Namespace }}.svc.{{ .Values.clusterSuffix }}/internal/auth/user"
nginx.ingress.kubernetes.io/configuration-snippet: |-
auth_request_set $user $upstream_http_x_user;
proxy_set_header 'X-Remote-User' $user;
auth_request_set $token $upstream_http_x_user_token;
proxy_set_header 'X-Remote-User-Token' $token;
error_page 403 @login;
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
nginx.ingress.kubernetes.io/proxy-body-size: "0"
spec:
rules:
- host: "{{ .Values.webmail.host }}"
http:
paths:
- path: "{{ .Values.webmail.path }}"
backend:
service:
name: {{ include "mailu-helm.fullname" . }}-webmail
port:
name: http
pathType: Prefix
apiVersion: v1
kind: Service
metadata:
name: {{ include "mailu-helm.fullname" . }}-webmail
labels:
{{- include "mailu-helm.labels" . | nindent 4 }}
component: webmail
spec:
type: {{ .Values.service.type }}
ports:
- name: http
port: 80
protocol: "TCP"
targetPort: http
selector:
{{- include "mailu-helm.selectorLabels" . | nindent 4 }}
component: webmail
......@@ -60,6 +60,8 @@ volumes:
emptyDir: {}
webdav: |-
emptyDir: {}
webmail: |-
emptyDir: {}
front:
resources:
......@@ -71,7 +73,7 @@ front:
memory: 100Mi
admin:
enabled: true
hostname: "mail.example.com"
host: "mail.example.com"
path: "/admin"
subnet: "10.42.0.0/16"
resources:
......@@ -109,6 +111,14 @@ antispam:
webmail:
host: "mail.example.com"
path: "/"
tag: ""
resources:
limits:
cpu: 1
memory: 1Gi
requests:
cpu: 100m
memory: 500Mi
webdav:
host: "mail.example.com"
path: "/webdav"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment