Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔧(mailcatcher) add Helm chart for mailcatcher #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mailcatcher/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mailcatcher-*.tgz
1 change: 1 addition & 0 deletions mailcatcher/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mailcatcher-*.tgz
7 changes: 7 additions & 0 deletions mailcatcher/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v2
description: |
MailCatcher runs a super simple SMTP server which catches any
message sent to it to display in a web interface
name: mailcatcher
version: 0.0.1
appVersion: 0.9.0
4 changes: 4 additions & 0 deletions mailcatcher/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Mailcatcher

MailCatcher runs a super simple SMTP server which catches any
message sent to it to display in a web interface
24 changes: 24 additions & 0 deletions mailcatcher/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{- define "mailcatcher.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{- define "mailcatcher.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 "mailcatcher.selectorLabels" -}}
app.kubernetes.io/name: {{ include "mailcatcher.name" . }}
app.kubernetes.io/part-of: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: mail
{{- end }}

25 changes: 25 additions & 0 deletions mailcatcher/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "mailcatcher.fullname" . }}
labels:
{{- include "mailcatcher.selectorLabels" . | nindent 4 }}
spec:
replicas: 1
selector:
matchLabels:
{{- include "mailcatcher.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "mailcatcher.selectorLabels" . | nindent 8 }}
spec:
containers:
- name: {{ include "mailcatcher.name" . }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default (printf "v%s" .Chart.AppVersion) }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- containerPort: 1025
protocol: TCP
- containerPort: 1080
protocol: TCP
33 changes: 33 additions & 0 deletions mailcatcher/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{{- if .Values.ingress.enabled -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ template "mailcatcher.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
labels: {{- include "mailcatcher.selectorLabels" . | nindent 4 }}
annotations:
{{- if .Values.ingress.annotations }}
{{- toYaml .Values.ingress.annotations | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.className }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
{{- if $.Values.ingress.tls.enable }}
tls:
- hosts:
- {{ $.Values.ingress.host }}
secretName: {{ $.Values.ingress.tls.certificateSecretName }}
{{- end }}
rules:
- host: {{ .Values.ingress.host }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ include "mailcatcher.fullname" . }}
port:
number: 1080
{{- end }}
19 changes: 19 additions & 0 deletions mailcatcher/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "mailcatcher.fullname" . }}
labels:
{{- include "mailcatcher.selectorLabels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: 1080
targetPort: 1080
protocol: TCP
name: http
- port: 1025
targetPort: 1025
protocol: TCP
name: smtp
selector:
{{- include "mailcatcher.selectorLabels" . | nindent 3 }}
73 changes: 73 additions & 0 deletions mailcatcher/values.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"$schema": "http://json-schema.org/schema#",
"type": "object",
"required": [
"image"
],
"properties": {
"image": {
"type": "object",
"required": [
"repository",
"pullPolicy"
],
"properties": {
"repository": {
"type": "string",
"pattern": "^[a-z0-9-_/]+$"
},
"pullPolicy": {
"type": "string",
"pattern": "^(Always|Never|IfNotPresent)$"
}
}
},
"service": {
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"pattern": "^(ClusterIP)$"
}
}
},
"ingress": {
"type": "object",
"required": [
"enabled",
"className",
"annotations",
"tls"
],
"properties": {
"enabled": {
"type": "boolean"
},
"className": {
"type": "string"
},
"annotations": {
"type": "object"
},
"tls": {
"type": "object",
"required": [
"enable"
],
"properties": {
"enable": {
"type": "boolean"
},
"certificateSecretName": {
"type": "string"
}
}
}
}
}
}
}

15 changes: 15 additions & 0 deletions mailcatcher/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
image:
repository: sj26/mailcatcher
tag: ""
pullPolicy: IfNotPresent

service:
type: ClusterIP

ingress:
enabled: true
className: "nginx"
annotations: {}
tls:
enable: false
certificateSecretName: ""