Skip to content

Commit

Permalink
Merge pull request #16 from jouve/mailpit-extraHosts
Browse files Browse the repository at this point in the history
[mailpit] mange extraHosts & webroot
  • Loading branch information
jouve authored Aug 1, 2023
2 parents 07f8ca6 + 1bbdc92 commit 1765c3a
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 34 deletions.
6 changes: 3 additions & 3 deletions charts/mailpit/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dependencies:
- name: common
repository: oci://registry-1.docker.io/bitnamicharts
version: 2.4.0
digest: sha256:126cfddd0ed32396341551f9fbe4fc3de673d5eb505a77895e1a2cd0b8999f67
generated: "2023-05-20T17:06:34.623077675+02:00"
version: 2.6.0
digest: sha256:5124856a42edeb2d1b4dd389806c602c12212be90538bfcf6dac6cd51fb93c9e
generated: "2023-08-01T17:07:34.403869+02:00"
2 changes: 1 addition & 1 deletion charts/mailpit/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: mailpit
description: An email and SMTP testing tool with API for developers
type: application
version: 0.3.0
version: 0.4.0
appVersion: 1.8.0
dependencies:
- name: common
Expand Down
30 changes: 17 additions & 13 deletions charts/mailpit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ helm install mailpit jouve/mailpit
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | ----------------- |
| `image.registry` | image registry | `docker.io` |
| `image.repository` | image repository | `axllent/mailpit` |
| `image.tag` | image tag (immutable tags are recommended) | `v1.7.1` |
| `image.tag` | image tag (immutable tags are recommended) | `v1.8.0` |
| `image.digest` | image digest in the way sha256:aa.... Please note this parameter, if set, will override the tag image tag (immutable tags are recommended) | `""` |
| `image.pullPolicy` | image pull policy | `IfNotPresent` |
| `image.pullSecrets` | image pull secrets | `[]` |
Expand All @@ -37,6 +37,7 @@ helm install mailpit jouve/mailpit
| `affinity` | Pod affinity | `{}` |
| `args` | Override default container args (useful when using custom images) | `[]` |
| `extraEnvVars` | Array with extra environment variables to add to nodes | `[]` |
| `mailpit.webroot` | Set the webroot for web UI & API | `/` |
| `mailpit.ui.authFile.enabled` | Adding basic authentication to web UI | `false` |
| `mailpit.ui.authFile.htpasswd` | htpasswd content | `""` |
| `mailpit.ui.tls.enabled` | Enable tls for web UI | `false` |
Expand All @@ -51,18 +52,21 @@ helm install mailpit jouve/mailpit

### Traffic Exposure Parameters

| Name | Description | Value |
| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ---------------- |
| `service.http.type` | service type | `ClusterIP` |
| `service.http.nodePort` | nodeport bind for HTTP service | `nil` |
| `service.smtp.type` | service type | `ClusterIP` |
| `service.smtp.nodePort` | nodeport bind for STMP service | `nil` |
| `ingress.enabled` | Enable ingress record generation for %%MAIN_CONTAINER_NAME%% | `false` |
| `ingress.hostname` | Default host for the ingress record | `hostname.local` |
| `ingress.ingressClassName` | IngressClass that will be be used to implement the Ingress (Kubernetes 1.18+) | `""` |
| `ingress.path` | Default path for the ingress record | `/` |
| `ingress.annotations` | Additional annotations for the Ingress resource. To enable certificate autogeneration, place here your cert-manager annotations. | `{}` |
| `ingress.tls` | Enable TLS configuration for the host defined at `ingress.hostname` parameter | `false` |
| Name | Description | Value |
| -------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
| `service.http.type` | service type | `ClusterIP` |
| `service.http.nodePort` | nodeport bind for HTTP service | `nil` |
| `service.smtp.type` | service type | `ClusterIP` |
| `service.smtp.nodePort` | nodeport bind for STMP service | `nil` |
| `ingress.enabled` | Enable ingress record generation for %%MAIN_CONTAINER_NAME%% | `false` |
| `ingress.annotations` | Additional annotations for the Ingress resource. To enable certificate autogeneration, place here your cert-manager annotations. | `{}` |
| `ingress.ingressClassName` | IngressClass that will be be used to implement the Ingress (Kubernetes 1.18+) | `""` |
| `ingress.hostname` | Default host for the ingress record | `hostname.local` |
| `ingress.path` | Default path for the ingress record | `/` |
| `ingress.pathType` | Ingress path type | `ImplementationSpecific` |
| `ingress.extraHosts` | The list of additional hostnames to be covered with this ingress record. | `[]` |
| `ingress.tls` | Enable TLS configuration for the host defined at `ingress.hostname` parameter | `false` |
| `ingress.extraTls` | The tls configuration for additional hostnames to be covered with this ingress record. | `[]` |

### Persistence Parameters

Expand Down
4 changes: 1 addition & 3 deletions charts/mailpit/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ spec:
args:
- --db-file
- /var/lib/mailpit/mailpit.db
{{- if .Values.ingress.enabled }}
- --webroot
- {{ .Values.ingress.path }}
{{- end }}
- {{ .Values.mailpit.webroot }}
{{- if .Values.mailpit.ui.authFile.enabled }}
- --ui-auth-file
- /etc/mailpit/ui.htpasswd
Expand Down
19 changes: 16 additions & 3 deletions charts/mailpit/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,34 @@ spec:
{{- end }}
rules:
{{- if .Values.ingress.hostname }}
- host: {{ .Values.ingress.hostname }}
- host: {{ .Values.ingress.hostname | quote }}
http:
paths:
- path: {{ .Values.ingress.path }}
{{- if eq "true" (include "common.ingress.supportsPathType" .) }}
pathType: ImplementationSpecific
pathType: {{ .Values.ingress.pathType }}
{{- end }}
backend: {{- include "common.ingress.backend" (dict "serviceName" (printf "%s-http" (include "common.names.fullname" .)) "servicePort" "http" "context" $) | nindent 14 }}
{{- end }}
{{- if or (and .Values.ingress.tls (include "common.ingress.certManagerRequest" ( dict "annotations" .Values.ingress.annotations ))) }}
{{- range .Values.ingress.extraHosts }}
- host: {{ .name | quote }}
http:
paths:
- path: {{ default $.Values.ingress.path .path }}
{{- if eq "true" (include "common.ingress.supportsPathType" $) }}
pathType: {{ default $.Values.ingress.pathType .pathType }}
{{- end }}
backend: {{- include "common.ingress.backend" (dict "serviceName" (include "common.names.fullname" $) "servicePort" "http" "context" $) | nindent 14 }}
{{- end }}
{{- if or (and .Values.ingress.tls (include "common.ingress.certManagerRequest" ( dict "annotations" .Values.ingress.annotations ))) .Values.ingress.extraTls }}
tls:
{{- if and .Values.ingress.tls (include "common.ingress.certManagerRequest" ( dict "annotations" .Values.ingress.annotations )) }}
- hosts:
- {{ .Values.ingress.hostname | quote }}
secretName: {{ template "common.names.fullname" . }}-tls
{{- end }}
{{- with .Values.ingress.extraTls }}
{{- include "common.tplvalues.render" (dict "value" . "context" $) | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
41 changes: 30 additions & 11 deletions charts/mailpit/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ extraEnvVars: []
# https://github.com/axllent/mailpit/wiki/Basic-authentication
# https://github.com/axllent/mailpit/wiki/HTTPS
mailpit:
## @param mailpit.webroot Set the webroot for web UI & API
webroot: /
ui:
## @param mailpit.ui.authFile.enabled Adding basic authentication to web UI
## @param mailpit.ui.authFile.htpasswd htpasswd content
Expand Down Expand Up @@ -158,34 +160,51 @@ ingress:
## @param ingress.enabled Enable ingress record generation for %%MAIN_CONTAINER_NAME%%
##
enabled: false
## @param ingress.hostname Default host for the ingress record
## @param ingress.annotations Additional annotations for the Ingress resource. To enable certificate autogeneration, place here your cert-manager annotations.
## Use this parameter to set the required annotations for cert-manager, see
## ref: https://cert-manager.io/docs/usage/ingress/#supported-annotations
## e.g:
## annotations:
## kubernetes.io/ingress.class: nginx
## cert-manager.io/cluster-issuer: cluster-issuer-name
##
hostname: hostname.local
annotations: {}
## @param ingress.ingressClassName IngressClass that will be be used to implement the Ingress (Kubernetes 1.18+)
## This is supported in Kubernetes 1.18+ and required if you have more than one IngressClass marked as the default for your cluster .
## ref: https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/
##
ingressClassName: ""
## @param ingress.hostname Default host for the ingress record
##
hostname: hostname.local
## @param ingress.path Default path for the ingress record
## NOTE: You may need to set this to '/*' in order to use this with ALB ingress controllers
##
path: /
## @param ingress.annotations Additional annotations for the Ingress resource. To enable certificate autogeneration, place here your cert-manager annotations.
## Use this parameter to set the required annotations for cert-manager, see
## ref: https://cert-manager.io/docs/usage/ingress/#supported-annotations
## e.g:
## annotations:
## kubernetes.io/ingress.class: nginx
## cert-manager.io/cluster-issuer: cluster-issuer-name
## @param ingress.pathType Ingress path type
##
annotations: {}
pathType: ImplementationSpecific
## @param ingress.extraHosts The list of additional hostnames to be covered with this ingress record.
## Most likely the hostname above will be enough, but in the event more hosts are needed, this is an array
## extraHosts:
## - name: nginx.local
## path: /
##
extraHosts: []
## @param ingress.tls Enable TLS configuration for the host defined at `ingress.hostname` parameter
## TLS certificates will be retrieved from a TLS secret
## You can:
## - Rely on cert-manager to create it by setting the corresponding annotations
##
tls: false

## @param ingress.extraTls The tls configuration for additional hostnames to be covered with this ingress record.
## see: https://kubernetes.io/docs/concepts/services-networking/ingress/#tls
## extraTls:
## - hosts:
## - nginx.local
## secretName: nginx.local-tls
##
extraTls: []

## @section Persistence Parameters
##
Expand Down

0 comments on commit 1765c3a

Please sign in to comment.