feat: maildev
This commit is contained in:
parent
c10591bdf9
commit
7a607b95f2
8 changed files with 311 additions and 0 deletions
4
charts/maildev/Chart.yaml
Normal file
4
charts/maildev/Chart.yaml
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
apiVersion: v2
|
||||||
|
description: A Helm chart for maildev
|
||||||
|
name: maildev
|
||||||
|
version: 0.0.28
|
38
charts/maildev/templates/_helpers.tpl
Normal file
38
charts/maildev/templates/_helpers.tpl
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
{{- define "common.names.name" -}}
|
||||||
|
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- define "common.names.chart" -}}
|
||||||
|
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- define "common.names.fullname" -}}
|
||||||
|
{{- if .Values.fullnameOverride -}}
|
||||||
|
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||||
|
{{- if contains $name .Release.Name -}}
|
||||||
|
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- define "common.names.suffixedName" -}}
|
||||||
|
{{- $base := trunc 54 (include "common.names.fullname" .root) -}}
|
||||||
|
{{- $suffix := .suffix -}}
|
||||||
|
{{- printf "%s-%s" $base $suffix | trunc 63 | trimSuffix "-" -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- define "common.labels.standard" -}}
|
||||||
|
app.kubernetes.io/name: {{ include "common.names.name" . }}
|
||||||
|
helm.sh/chart: {{ include "common.names.chart" . }}
|
||||||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- define "common.labels.matchLabels" -}}
|
||||||
|
app.kubernetes.io/name: {{ include "common.names.name" . }}
|
||||||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
|
{{- end -}}
|
48
charts/maildev/templates/cron.yaml
Normal file
48
charts/maildev/templates/cron.yaml
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
{{- if and .Values.persistence.enabled .Values.cron.enabled }}
|
||||||
|
apiVersion: batch/v1
|
||||||
|
kind: CronJob
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||||
|
{{- if .Values.commonLabels }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
schedule: {{ .Values.cron.schedule | quote }}
|
||||||
|
startingDeadlineSeconds: 100
|
||||||
|
jobTemplate:
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: delete-mail
|
||||||
|
image: "{{ .Values.cron.image.repository }}:{{ .Values.cron.image.tag }}"
|
||||||
|
imagePullPolicy: {{ .Values.cron.image.pullPolicy }}
|
||||||
|
args:
|
||||||
|
- "find"
|
||||||
|
- "{{ .Values.persistence.mountPath }}"
|
||||||
|
- "-type"
|
||||||
|
- "f"
|
||||||
|
- "-mtime"
|
||||||
|
- "+{{ .Values.cron.daysToKeep }}"
|
||||||
|
- "-exec"
|
||||||
|
- "rm"
|
||||||
|
- "-f"
|
||||||
|
- "{}"
|
||||||
|
- ";"
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: {{ .Values.persistence.mountPath }}
|
||||||
|
- name: reload-mail
|
||||||
|
image: "{{ .Values.cron.image.repository }}:{{ .Values.cron.image.tag }}"
|
||||||
|
imagePullPolicy: {{ .Values.cron.image.pullPolicy }}
|
||||||
|
args: ["wget","{{ include "common.names.fullname" . }}:1080/reloadMailsFromDirectory"]
|
||||||
|
volumes:
|
||||||
|
- name: data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: {{ include "common.names.fullname" . }}
|
||||||
|
restartPolicy: OnFailure
|
||||||
|
{{- end }}
|
73
charts/maildev/templates/deployment.yaml
Normal file
73
charts/maildev/templates/deployment.yaml
Normal file
|
@ -0,0 +1,73 @@
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||||
|
{{- if .Values.commonLabels }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
replicas: {{ .Values.replicaCount }}
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
matchLabels: {{ include "common.labels.matchLabels" . | nindent 6 }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
{{ if .Values.podAnnotations }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml .Values.podAnnotations | nindent 8 }}
|
||||||
|
{{ end }}
|
||||||
|
labels: {{- include "common.labels.standard" . | nindent 8 }}
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: {{ .Chart.Name }}
|
||||||
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||||
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
|
args:
|
||||||
|
- "--mail-directory"
|
||||||
|
- "{{ .Values.persistence.mountPath }}"
|
||||||
|
{{- if .Values.extraArgs }}
|
||||||
|
{{- range .Values.extraArgs }}
|
||||||
|
- {{ . | quote }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: {{ .Values.persistence.mountPath }}
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
containerPort: 1080
|
||||||
|
protocol: TCP
|
||||||
|
- name: smtp
|
||||||
|
containerPort: 1025
|
||||||
|
protocol: TCP
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /healthz
|
||||||
|
port: http
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /healthz
|
||||||
|
port: http
|
||||||
|
securityContext:
|
||||||
|
runAsUser: 1000
|
||||||
|
runAsGroup: 1000
|
||||||
|
resources:
|
||||||
|
{{- toYaml .Values.resources | nindent 12 }}
|
||||||
|
volumes:
|
||||||
|
- name: data
|
||||||
|
{{- if and (.Values.persistence.enabled) }}
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: {{ include "common.names.fullname" . }}
|
||||||
|
{{- else }}
|
||||||
|
emptyDir: {}
|
||||||
|
{{- end }}
|
||||||
|
nodeSelector:
|
||||||
|
{{- toYaml .Values.nodeSelector | nindent 8 }}
|
||||||
|
affinity:
|
||||||
|
{{- toYaml .Values.affinity | nindent 8 }}
|
||||||
|
tolerations:
|
||||||
|
{{- toYaml .Values.tolerations | nindent 8 }}
|
29
charts/maildev/templates/ingress.yaml
Normal file
29
charts/maildev/templates/ingress.yaml
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
{{- if .Values.ingress.enabled -}}
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||||
|
annotations:
|
||||||
|
{{- if .Values.ingress.annotations }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.ingress.annotations "context" $) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
tls:
|
||||||
|
{{- if .Values.ingress.tls }}
|
||||||
|
- hosts:
|
||||||
|
- {{ .Values.ingress.hostname | quote }}
|
||||||
|
secretName: {{ .Values.ingress.tlsSecretname }}
|
||||||
|
{{- end }}
|
||||||
|
rules:
|
||||||
|
- host: {{ .Values.ingress.hostname | quote }}
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
port:
|
||||||
|
name: http
|
||||||
|
{{- end }}
|
25
charts/maildev/templates/pvc.yaml
Normal file
25
charts/maildev/templates/pvc.yaml
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
{{- if and (.Values.persistence.enabled) (not .Values.persistence.existingClaim) }}
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
apiVersion: v1
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||||
|
{{- if .Values.commonLabels }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
annotations:
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- {{ .Values.persistence.accessMode | quote }}
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ .Values.persistence.size | quote }}
|
||||||
|
{{- if .Values.persistence.storageClass }}
|
||||||
|
{{- if (not (eq "-" .Values.persistence.storageClass)) }}
|
||||||
|
storageClassName: "{{ .Values.persistence.storageClass }}"
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
30
charts/maildev/templates/service.yaml
Normal file
30
charts/maildev/templates/service.yaml
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
{{- if .Values.service.enabled -}}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ include "common.names.fullname" . }}
|
||||||
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
||||||
|
{{- if .Values.commonLabels }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
annotations:
|
||||||
|
{{- if .Values.commonAnnotations }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.service.annotations }}
|
||||||
|
{{- include "common.tplvalues.render" ( dict "value" .Values.service.annotations "context" $ ) | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
type: {{ .Values.service.type }}
|
||||||
|
{{- if and .Values.service.clusterIP (eq .Values.service.type "ClusterIP") }}
|
||||||
|
clusterIP: {{ .Values.service.clusterIP }}
|
||||||
|
{{- end }}
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: {{ .Values.service.httpPort }}
|
||||||
|
targetPort: 1080
|
||||||
|
- name: smtp
|
||||||
|
port: {{ .Values.service.smtpPort }}
|
||||||
|
targetPort: 1025
|
||||||
|
selector: {{ include "common.labels.matchLabels" . | nindent 4 }}
|
||||||
|
{{- end }}
|
64
charts/maildev/values.yaml
Normal file
64
charts/maildev/values.yaml
Normal file
|
@ -0,0 +1,64 @@
|
||||||
|
fullnameOverride: ""
|
||||||
|
nameOverride: ""
|
||||||
|
|
||||||
|
commonAnnotations: {}
|
||||||
|
commonLabels: {}
|
||||||
|
|
||||||
|
podAnnotations:
|
||||||
|
|
||||||
|
image:
|
||||||
|
repository: maildev/maildev
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
tag: "2.1.0"
|
||||||
|
|
||||||
|
persistence:
|
||||||
|
enabled:
|
||||||
|
accessMode: ReadWriteMany
|
||||||
|
size: 256M
|
||||||
|
storageClass: ""
|
||||||
|
existingClaim: ""
|
||||||
|
mountPath: /home/node/maildev-data
|
||||||
|
|
||||||
|
cron:
|
||||||
|
enabled:
|
||||||
|
image:
|
||||||
|
repository: busybox
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
tag: latest
|
||||||
|
schedule: "0 1 * * *"
|
||||||
|
daysToKeep: 30
|
||||||
|
|
||||||
|
extraArgs: []
|
||||||
|
# - "--outgoing-host"
|
||||||
|
# - "smtp.yourdomaine.com"
|
||||||
|
# - "--outgoing-port"
|
||||||
|
# - "25"
|
||||||
|
|
||||||
|
service:
|
||||||
|
enabled: true
|
||||||
|
type: ClusterIP
|
||||||
|
smtpPort: 1025
|
||||||
|
httpPort: 1080
|
||||||
|
nodePort:
|
||||||
|
clusterIP: ""
|
||||||
|
annotations: {}
|
||||||
|
|
||||||
|
ingress:
|
||||||
|
enabled: false
|
||||||
|
annotations: {}
|
||||||
|
hostname: api.local
|
||||||
|
tlsSecretname: alerte-secours-tls
|
||||||
|
|
||||||
|
resources: {}
|
||||||
|
# requests:
|
||||||
|
# cpu: "200m"
|
||||||
|
# memory: 500Mi
|
||||||
|
# limits:
|
||||||
|
# cpu: "100m"
|
||||||
|
# memory: 256Mi
|
||||||
|
|
||||||
|
replicaCount: 1
|
||||||
|
|
||||||
|
nodeSelector: {}
|
||||||
|
tolerations: []
|
||||||
|
affinity: {}
|
Loading…
Add table
Reference in a new issue