Skip to content

Commit 6cff031

Browse files
committed
[ADD] persistence, improve gh actions
1 parent 4cef746 commit 6cff031

6 files changed

Lines changed: 121 additions & 29 deletions

File tree

.github/workflows/release.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,18 @@ on:
55
push:
66
branches:
77
- main
8+
workflow_run:
9+
workflows:
10+
- Lint and Test Charts
11+
types:
12+
- completed
813

914
jobs:
1015
release:
1116
permissions:
1217
contents: write
1318
runs-on: ubuntu-latest
19+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1420
steps:
1521
- name: Checkout
1622
uses: actions/checkout@v3

Chart.yaml

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,18 @@
11
apiVersion: v2
22
name: smtp4dev
33
description: A Helm chart for helm-smtp4dev
4-
icon: https://raw.githubusercontent.com/rnwood/smtp4dev/master/logo.svg
5-
maintainers:
6-
- name: iMio
7-
url: https://imio.github.io/helm-charts/
8-
# A chart can be either an 'application' or a 'library' chart.
9-
#
10-
# Application charts are a collection of templates that can be packaged into versioned archives
11-
# to be deployed.
12-
#
13-
# Library charts provide useful utilities or functions for the chart developer. They're included as
14-
# a dependency of application charts to inject those utilities and functions into the rendering
15-
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
164
type: application
17-
18-
# This is the chart version. This version number should be incremented each time you make changes
19-
# to the chart and its templates, including the app version.
20-
# Versions are expected to follow Semantic Versioning (https://semver.org/)
21-
version: 0.0.1
22-
23-
# This is the version number of the application being deployed. This version number should be
24-
# incremented each time you make changes to the application. Versions are not expected to
25-
# follow Semantic Versioning. They should reflect the version the application is using.
26-
# It is recommended to use it with quotes.
5+
version: 0.0.2
276
appVersion: "3.1.4"
7+
keywords:
8+
- smtp4dev
9+
- fake smtp email server
10+
- development
11+
sources:
12+
- https://github.com/imio/helm-charts
13+
- https://github.com/imio/helm-smtp4dev
14+
- https://github.com/rnwood/smtp4dev
15+
icon: https://raw.githubusercontent.com/rnwood/smtp4dev/master/logo.svg
16+
maintainers:
17+
- name: IMIO
18+
url: https://github.com/IMIO/

README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,58 @@
11
# Helm Chart for smtp4dev
2+
3+
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ![version](https://img.shields.io/github/tag/IMIO/helm-smtp4dev.svg?label=release) ![test](https://github.com/IMIO/helm-smtp4dev/actions/workflows/test.yaml/badge.svg) ![release](https://github.com/IMIO/helm-smtp4dev/actions/workflows/release.yaml/badge.svg)
4+
5+
## Introduction
6+
7+
This [Helm](https://helm.sh/) chart installs [smtp4dev](https://github.com/rnwood/smtp4dev) in a [Kubernetes](https://kubernetes.io) cluster.
8+
9+
## Prerequisites
10+
11+
- Kubernetes cluster 1.19+
12+
- Helm 3.0.0+
13+
- PV provisioner support in the underlying infrastructure (Optional)
14+
15+
## Installation
16+
17+
### Add Helm repository
18+
19+
```bash
20+
helm repo add imio https://imio.github.io/helm-charts
21+
helm repo update
22+
```
23+
24+
### Configure the chart
25+
26+
The following items can be set via `--set` flag during installation or configured by editing the `values.yaml` directly (need to download the chart first).
27+
28+
Feel free to modify the options in the [values.yaml file](values.yaml) before installation.
29+
30+
### Install the chart
31+
32+
```bash
33+
helm install [RELEASE_NAME] imio/smtp4dev
34+
```
35+
36+
or by cloning this repository:
37+
38+
```bash
39+
git clone https://github.com/imio/helm-smtp4dev.git
40+
cd helm-smtp4dev
41+
helm install smtp4dev . -f values.yaml --namespace smtp4dev --create-namespace
42+
```
43+
44+
## Configuration
45+
46+
The following table lists the configurable parameters of the smtp4dev chart and the default values.
47+
48+
See the [values.yaml](values.yaml) file for more information.
49+
50+
## Contributing
51+
52+
Feel free to contribute by making a [pull request](https://github.com/imio/helm-smtp4dev/pull/new/master).
53+
54+
Please read the official [Helm Contribution Guide](https://github.com/helm/charts/blob/master/CONTRIBUTING.md) from Helm for more information on how you can contribute to this Chart.
55+
56+
## License
57+
58+
[Apache License 2.0](/LICENSE)

templates/deployment.yaml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,19 @@ spec:
8686
path: /
8787
port: http
8888
resources:
89-
{{- toYaml .Values.resources | nindent 12 }}
90-
{{- with .Values.volumeMounts }}
89+
{{- toYaml .Values.resources | nindent 12 }}
9190
volumeMounts:
92-
{{- toYaml . | nindent 12 }}
93-
{{- end }}
94-
{{- with .Values.volumes }}
91+
- name: smtp4dev
92+
mountPath: /smtp4dev
93+
readOnly: false
9594
volumes:
96-
{{- toYaml . | nindent 8 }}
97-
{{- end }}
95+
- name: smtp4dev
96+
{{- if .Values.persistence.enabled }}
97+
persistentVolumeClaim:
98+
claimName: {{ .Values.persistence.existingClaim | default (include "helm-smtp4dev.fullname" .) }}
99+
{{- else }}
100+
emptyDir: {}
101+
{{- end }}
98102
{{- with .Values.nodeSelector }}
99103
nodeSelector:
100104
{{- toYaml . | nindent 8 }}

templates/pvc.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{{- if .Values.persistence.enabled }}
2+
kind: PersistentVolumeClaim
3+
apiVersion: v1
4+
metadata:
5+
name: {{ include "helm-smtp4dev.fullname" . }}
6+
spec:
7+
accessModes:
8+
{{- range .Values.persistence.accessModes }}
9+
- {{ . | quote }}
10+
{{- end }}
11+
storageClassName: {{ .Values.persistence.storageClass | quote }}
12+
resources:
13+
requests:
14+
storage: {{ .Values.persistence.size | quote }}
15+
{{- end -}}

values.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ image:
1010
# Overrides the image tag whose default is the chart appVersion.
1111
tag: "v3"
1212

13+
# smtp4dev configuration (env variables)
1314
smtp4dev:
1415
ServerOptions__BasePath: /smtp4dev
1516
ServerOptions__Hostname: smtp4dev
@@ -76,6 +77,24 @@ ingress:
7677
# hosts:
7778
# - chart-example.local
7879

80+
# persistence
81+
persistence:
82+
enabled: true
83+
# A manually managed Persistent Volume and Claim
84+
# Requires persistence.enabled: true
85+
# If defined, PVC must be created manually before volume will be bound
86+
existingClaim: ""
87+
# smtp4dev data Persistent Volume Storage Class
88+
# If defined, storageClassName: <storageClass>
89+
# If set to "-", storageClassName: "", which disables dynamic provisioning
90+
# If undefined (the default) or set to null, no storageClassName spec is
91+
# set, choosing the default provisioner. (gp2 on AWS, standard on
92+
# GKE, AWS & OpenStack)
93+
storageClass: "standard"
94+
accessModes:
95+
- ReadWriteOnce
96+
size: 1Gi
97+
7998
resources: {}
8099
# We usually recommend not to specify default resources and to leave this as a conscious
81100
# choice for the user. This also increases chances charts run on environments with little

0 commit comments

Comments
 (0)