-
-
Notifications
You must be signed in to change notification settings - Fork 24
/
README.md.gotmpl
106 lines (70 loc) · 3.08 KB
/
README.md.gotmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
{{ template "chart.header" . }}
{{ template "chart.description" . }}
## TL;DR;
```console
helm repo add christianhuth https://charts.christianhuth.de
helm repo update
helm install my-release christianhuth/maildev
```
## Introduction
This chart bootstraps [MailDev](https://maildev.github.io/maildev/) on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
MailDev is a simple way to test your project's generated emails during development with an easy-to-use web interface that runs on your machine.
Its main usage is to provide you with a SMTP relay service inside Kubernetes, so other apps can rely on it to send mails externally.
Inside the Namespace where it is deployed, an SMTP service is available: `RELEASE_NAME-smtp:1025`.
To make the SMTP service available for applications running outside of Kubernetes you can set `services.smtp.type` to `NodePort`.
MailDev also provides a Web interface, it can be disabled/enabled using `maildev.config.web.disabled`.
## Prerequisites
- Kubernetes 1.19+
## Installing the Chart
To install the chart with the release name `my-release`:
```console
helm repo add christianhuth https://charts.christianhuth.de
helm repo update
helm install my-release christianhuth/maildev
```
These commands deploy MailDev on the Kubernetes cluster in the default configuration. The [Values](#values) section lists the values that can be configured during installation.
> **Tip**: List all releases using `helm list`
## Test it
Forward your local port to the pod (this will block your terminal, open an additional one).
```bash
kubectl port-forward $(kubectl get pod -l "app.kubernetes.io/name=maildev" -o name) 1025
```
Create dummy mail.txt file.
```bash
cat <<EOF >> mail.txt
From: Test Maildev <[email protected]>
To: Nikola Tesla Tudela <[email protected]>
Subject: Test mail from command line
Date: Fri, 17 Nov 2020 11:26:16
Dear Joe,
Welcome to this example email. What a lovely day.
Cheers!!
EOF
```
Send the mail with curl:
```bash
curl smtp://localhost:1025 --mail-from [email protected] --mail-rcpt [email protected] --upload-file ./mail.txt
```
The mail should now show up in your inbox.
If you have enabled the logs for mails using `maildev.config.logMailContents=true`, you can also check the logs and see if the mail has been delivered.
```bash
kubectl logs $(kubectl get pod -l "app.kubernetes.io/name=maildev" -o name)
```
Output should be something like:
```bash
MailDev webapp running at http://0.0.0.0:1080
MailDev SMTP Server running at 0.0.0.0:1025
Received the following mail contents.
```
## Uninstalling the Chart
To uninstall the `my-release` deployment:
```console
helm uninstall my-release
```
The command removes all the Kubernetes components associated with the chart and deletes the release.
{{ template "chart.valuesSection" . }}
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.
Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,
```console
helm install my-release -f values.yaml christianhuth/maildev
```