-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
465 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: v1 | ||
description: An e-mail testing tool for developers | ||
name: mailhog | ||
appVersion: 1.0.0 | ||
version: 3.2.0 | ||
keywords: | ||
- mailhog | ||
- smtp | ||
- testing | ||
home: http://iankent.uk/project/mailhog/ | ||
icon: https://raw.githubusercontent.com/mailhog/MailHog-UI/master/assets/images/hog.png | ||
sources: | ||
- https://github.com/mailhog/MailHog | ||
maintainers: | ||
- name: unguiculus | ||
email: unguiculus@gmail.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
# Mailhog | ||
|
||
[Mailhog](http://iankent.uk/project/mailhog/) is an e-mail testing tool for developers. | ||
|
||
## TL;DR; | ||
|
||
```bash | ||
$ helm install stable/mailhog | ||
``` | ||
|
||
## Introduction | ||
|
||
This chart creates a [Mailhog](http://iankent.uk/project/mailhog/) deployment on a [Kubernetes](http://kubernetes.io) | ||
cluster using the [Helm](https://helm.sh) package manager. | ||
|
||
## Prerequisites | ||
|
||
- Kubernetes 1.9+ with Beta APIs enabled | ||
|
||
## Installing the Chart | ||
|
||
To install the chart with the release name `my-release`: | ||
|
||
```bash | ||
$ helm install --name my-release codecentric/mailhog | ||
``` | ||
|
||
The command deploys Mailhog on the Kubernetes cluster in the default configuration. The [configuration](#configuration) | ||
section lists the parameters that can be configured during installation. | ||
|
||
## Uninstalling the Chart | ||
|
||
To uninstall/delete the `my-release` deployment: | ||
|
||
```bash | ||
$ helm delete my-release | ||
``` | ||
The command removes all the Kubernetes components associated with the chart and deletes the release. | ||
|
||
## Configuration | ||
|
||
The following table lists the configurable parameters of the Mailhog chart and their default values. | ||
|
||
Parameter | Description | Default | ||
--- | --- | --- | ||
`image.repository` | Docker image repository | `mailhog/mailhog` | ||
`image.tag` | Docker image tag | `v1.0.0` | ||
`image.pullPolicy` | Docker image pull policy | `IfNotPresent` | ||
`auth.enabled` | Specifies whether basic authentication is enabled, see [Auth.md](https://github.com/mailhog/MailHog/blob/master/docs/Auth.md) | `false` | ||
`auth.existingSecret` | If auth is enabled, uses an existing secret with this name; otherwise a secret is created | `""` | ||
`auth.fileName` | The name of the auth file | `auth.txt` | ||
`auth.fileContents` | The contents of the auth file | `""` | ||
`nodeSelector` | Node labels for pod assignment | `{}` | ||
`podAnnotations` | Extra annotations to add to pod | `{}` | ||
`podLabels` | Extra labels to add to pod | `{}` | ||
`resources` | Pod resource requests and limits | `{}` | ||
`tolerations` | Node taints to tolerate | `[]` | ||
`service.annotations` | Annotations for the service | `{}` | ||
`service.clusterIP` | Internal cluster service IP | `""` | ||
`service.externalIPs` | Service external IP addresses | `[]` | ||
`service.loadBalancerIP` | IP address to assign to load balancer (if supported) | `""` | ||
`service.loadBalancerSourceRanges` | List of IP CIDRs allowed access to load balancer (if supported) | `[]` | ||
`service.type` | Type of service to create | `ClusterIP` | ||
`service.node.http` | HTTP port of service | `""` | ||
`service.node.smtp` | SMTP port of service | `""` | ||
`service.nodePort.http` | If `service.type` is `NodePort` and this is non-empty, sets the http node port of the service | `""` | ||
`service.nodePort.smtp` | If `service.type` is `NodePort` and this is non-empty, sets the smtp node port of the service | `""` | ||
`securityContext` | Pod security context | `{ runAsUser: 1000, fsGroup: 1000, runAsNonRoot: true }` | ||
`ingress.enabled` | If `true`, an ingress is created | `false` | ||
`ingress.annotations` | Annotations for the ingress | `{}` | ||
`ingress.hosts` | A list of ingress hosts | `{ host: mailhog.example.com, paths: ["/"] }` | ||
`ingress.tls` | A list of [IngressTLS](https://v1-8.docs.kubernetes.io/docs/api-reference/v1.8/#ingresstls-v1beta1-extensions) items | `[]` | ||
`extraEnv` | Additional environment variables, see [CONFIG.md](https://github.com/mailhog/MailHog/blob/master/docs/CONFIG.md) | `{}` | ||
|
||
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, | ||
|
||
```bash | ||
$ helm install --name my-release \ | ||
--set env.MH_UI_WEB_PATH=mailhog \ | ||
stable/mailhog | ||
``` | ||
|
||
Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example, | ||
|
||
```bash | ||
$ helm install --name my-release -f values.yaml stable/mailhog | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
Mailhog can be accessed via ports {{ .Values.service.port.http }} (HTTP) and {{ .Values.service.port.smtp }} (SMTP) on the following DNS name from within your cluster: | ||
{{ template "mailhog.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local | ||
|
||
If you'd like to test your instance, forward the ports locally: | ||
|
||
Web UI: | ||
======= | ||
|
||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "mailhog.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") | ||
kubectl port-forward --namespace {{ .Release.Namespace }} $POD_NAME 8025 | ||
|
||
SMTP Server: | ||
============ | ||
|
||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "mailhog.name" . }},release={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") | ||
kubectl port-forward --namespace {{ .Release.Namespace }} $POD_NAME 1025 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "mailhog.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "mailhog.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 -}} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "mailhog.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create the name for the auth secret. | ||
*/}} | ||
{{- define "mailhog.authFileSecret" -}} | ||
{{- if .Values.auth.existingSecret -}} | ||
{{- .Values.auth.existingSecret -}} | ||
{{- else -}} | ||
{{- template "mailhog.fullname" . -}}-auth | ||
{{- end -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{{- if and (.Values.auth.enabled) (not .Values.auth.existingSecret) -}} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: {{ include "mailhog.name" . }} | ||
helm.sh/chart: {{ include "mailhog.chart" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
name: {{ template "mailhog.authFileSecret" . }} | ||
type: Opaque | ||
data: | ||
{{ .Values.auth.fileName }}: {{ .Values.auth.fileContents | b64enc }} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ include "mailhog.fullname" . }} | ||
labels: | ||
app.kubernetes.io/name: {{ include "mailhog.name" . }} | ||
helm.sh/chart: {{ include "mailhog.chart" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
spec: | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: {{ include "mailhog.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
template: | ||
metadata: | ||
{{- with .Values.podAnnotations }} | ||
annotations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
labels: | ||
app.kubernetes.io/name: {{ include "mailhog.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- with .Values.podLabels }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
spec: | ||
{{- with .Values.securityContext }} | ||
securityContext: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
containers: | ||
- name: {{ template "mailhog.name" . }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | ||
imagePullPolicy: "{{ .Values.image.pullPolicy }}" | ||
env: | ||
- name: MH_HOSTNAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
{{- if .Values.auth.enabled }} | ||
- name: MH_AUTH_FILE | ||
value: /authdir/{{ .Values.auth.fileName }} | ||
{{- end }} | ||
{{- with .Values.extraEnv }} | ||
{{- toYaml . | nindent 12 }} | ||
{{- end }} | ||
ports: | ||
- name: http | ||
containerPort: 8025 | ||
protocol: TCP | ||
- name: smtp | ||
containerPort: 1025 | ||
protocol: TCP | ||
livenessProbe: | ||
tcpSocket: | ||
port: smtp | ||
initialDelaySeconds: 10 | ||
timeoutSeconds: 1 | ||
readinessProbe: | ||
tcpSocket: | ||
port: smtp | ||
{{- if .Values.auth.enabled }} | ||
volumeMounts: | ||
- name: authdir | ||
mountPath: /authdir | ||
readOnly: true | ||
{{- end }} | ||
resources: | ||
{{- toYaml .Values.resources | nindent 12 }} | ||
{{- with .Values.affinity }} | ||
affinity: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.nodeSelector }} | ||
nodeSelector: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- with .Values.tolerations }} | ||
tolerations: | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
{{- if .Values.auth.enabled }} | ||
volumes: | ||
- name: authdir | ||
secret: | ||
secretName: {{ template "mailhog.authFileSecret" . }} | ||
{{- end }} |
Oops, something went wrong.