diff --git a/charts/mailpit/Chart.lock b/charts/mailpit/Chart.lock index 08a9192..5ba3136 100644 --- a/charts/mailpit/Chart.lock +++ b/charts/mailpit/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: common repository: oci://registry-1.docker.io/bitnamicharts - version: 2.8.0 -digest: sha256:8ab32897fda14bd026e41d2e532e07b1ea04a31588031cd50aa06d31748d858a -generated: "2023-08-21T11:07:54.622799+02:00" + version: 2.10.1 +digest: sha256:3f8cae6c1c6625ed483dbccffae6e274006e5bb3d79b2f1abba15c765d2b6a04 +generated: "2023-09-09T11:15:46.800109159+02:00" diff --git a/charts/mailpit/Chart.yaml b/charts/mailpit/Chart.yaml index 1112596..66dafa8 100644 --- a/charts/mailpit/Chart.yaml +++ b/charts/mailpit/Chart.yaml @@ -1,8 +1,9 @@ apiVersion: v2 name: mailpit description: An email and SMTP testing tool with API for developers +icon: https://raw.githubusercontent.com/axllent/mailpit/develop/server/ui/mailpit.svg type: application -version: 0.5.3 +version: 0.6.0 appVersion: 1.8.2 dependencies: - name: common diff --git a/charts/mailpit/README.md b/charts/mailpit/README.md index bb92457..5138414 100644 --- a/charts/mailpit/README.md +++ b/charts/mailpit/README.md @@ -57,9 +57,9 @@ helm install mailpit jouve/mailpit | Name | Description | Value | | -------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | | `service.http.type` | service type | `ClusterIP` | -| `service.http.nodePort` | nodeport bind for HTTP service | `nil` | +| `service.http.nodePort` | nodeport bind for HTTP service | `0` | | `service.smtp.type` | service type | `ClusterIP` | -| `service.smtp.nodePort` | nodeport bind for STMP service | `nil` | +| `service.smtp.nodePort` | nodeport bind for STMP service | `0` | | `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+) | `""` | diff --git a/charts/mailpit/ci/auth-values.yaml b/charts/mailpit/ci/auth-values.yaml new file mode 100644 index 0000000..e6b3117 --- /dev/null +++ b/charts/mailpit/ci/auth-values.yaml @@ -0,0 +1,9 @@ +mailpit: + ui: + authFile: + enabled: true + htpasswd: toto + smtp: + authFile: + enabled: true + htpasswd: tutu diff --git a/charts/mailpit/ci/default-values.yaml b/charts/mailpit/ci/default-values.yaml new file mode 100644 index 0000000..e69de29 diff --git a/charts/mailpit/ci/ingress-values.yaml b/charts/mailpit/ci/ingress-values.yaml new file mode 100644 index 0000000..f6ccc62 --- /dev/null +++ b/charts/mailpit/ci/ingress-values.yaml @@ -0,0 +1,2 @@ +ingress: + enabled: true diff --git a/charts/mailpit/ci/persistence-values.yaml b/charts/mailpit/ci/persistence-values.yaml new file mode 100644 index 0000000..a434bf0 --- /dev/null +++ b/charts/mailpit/ci/persistence-values.yaml @@ -0,0 +1,2 @@ +persistence: + enabled: true diff --git a/charts/mailpit/ci/tls-values.yaml b/charts/mailpit/ci/tls-values.yaml new file mode 100644 index 0000000..eaa4b3f --- /dev/null +++ b/charts/mailpit/ci/tls-values.yaml @@ -0,0 +1,9 @@ +mailpit: + ui: + tls: + enabled: true + secretName: ui-tls + smtp: + tls: + enabled: true + secretName: smtp-tls diff --git a/charts/mailpit/templates/deployment.yaml b/charts/mailpit/templates/deployment.yaml index 5db7745..b5f9d71 100644 --- a/charts/mailpit/templates/deployment.yaml +++ b/charts/mailpit/templates/deployment.yaml @@ -3,10 +3,7 @@ kind: Deployment metadata: name: {{ template "common.names.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- with .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} {{- with .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 4 }} {{- end }} @@ -18,14 +15,12 @@ spec: {{- else if .Values.updateStrategy }} strategy: {{- toYaml .Values.updateStrategy | nindent 4 }} {{- end }} + {{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.podLabels .Values.commonLabels ) "context" . ) | fromYaml }} selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} + matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }} template: metadata: - labels: {{- include "common.labels.standard" . | nindent 8 }} - {{- with .Values.podLabels }} - {{- include "common.tplvalues.render" (dict "value" . "context" $) | nindent 8 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" $podLabels "context" $ ) | nindent 8 }} {{- if or .Values.podAnnotations (include "mailpit.hasSecret" .) }} annotations: {{- with .Values.podAnnotations }} @@ -118,7 +113,7 @@ spec: {{- include "common.tplvalues.render" ( dict "value" . "context" $) | nindent 8 }} {{- end }} volumes: - {{- if or .Values.mailpit.ui.authFile.enabled .Values.mailpit.smtp.authFile.enabled .Values.mailpit.ui.tls.secretName .Values.mailpit.smtp.tls.secretName .Values.mailpit.relay.enabled }} + {{- if or .Values.mailpit.ui.authFile.enabled .Values.mailpit.smtp.authFile.enabled .Values.mailpit.ui.tls.enabled .Values.mailpit.smtp.tls.enabled .Values.mailpit.relay.enabled }} - name: etc projected: sources: @@ -142,7 +137,7 @@ spec: {{- end }} {{- if .Values.mailpit.ui.tls.enabled }} - secret: - name: {{ .Values.mailpit.ui.tls.secretName }} + name: {{ .Values.mailpit.ui.tls.secretName | required "mailpit.ui.tls.secretName required when tls is enabled" }} items: - key: tls.crt path: ui.crt @@ -151,7 +146,7 @@ spec: {{- end }} {{- if .Values.mailpit.smtp.tls.enabled }} - secret: - name: {{ .Values.mailpit.smtp.tls.secretName }} + name: {{ .Values.mailpit.smtp.tls.secretName | required "mailpit.smtp.tls.secretName required when tls is enabled" }} items: - key: tls.crt path: smtp.crt diff --git a/charts/mailpit/templates/http-service.yaml b/charts/mailpit/templates/http-service.yaml index 06f6055..7fa16d2 100644 --- a/charts/mailpit/templates/http-service.yaml +++ b/charts/mailpit/templates/http-service.yaml @@ -3,18 +3,9 @@ kind: Service metadata: name: {{ template "common.names.fullname" . }}-http namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- with .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 4 }} - {{- end }} - {{- if or .Values.commonAnnotations .Values.service.http.annotations }} - annotations: - {{- with .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 4 }} - {{- end }} - {{- with .Values.service.http.annotations }} - {{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- with include "common.tplvalues.merge" ( dict "values" (list .Values.service.http.annotations .Values.commonAnnotations) "context" . ) | fromYaml }} + annotations: {{- . | toYaml | nindent 4 }} {{- end }} spec: type: {{ .Values.service.http.type }} @@ -25,4 +16,5 @@ spec: nodePort: {{ .Values.service.http.nodePort }} {{- end }} targetPort: http - selector: {{- include "common.labels.matchLabels" . | nindent 4 }} + {{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.podLabels .Values.commonLabels ) "context" . ) | fromYaml }} + selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }} diff --git a/charts/mailpit/templates/ingress.yaml b/charts/mailpit/templates/ingress.yaml index 81fcffa..977d631 100644 --- a/charts/mailpit/templates/ingress.yaml +++ b/charts/mailpit/templates/ingress.yaml @@ -4,18 +4,9 @@ kind: Ingress metadata: name: {{ template "common.names.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- with .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 4 }} - {{- end }} - {{- if or .Values.commonAnnotations .Values.ingress.annotations }} - annotations: - {{- with .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 4 }} - {{- end }} - {{- with .Values.ingress.annotations }} - {{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- with include "common.tplvalues.merge" ( dict "values" (list .Values.ingress.annotations .Values.commonAnnotations) "context" . ) | fromYaml }} + annotations: {{- . | toYaml | nindent 4 }} {{- end }} spec: {{- if and .Values.ingress.ingressClassName (eq "true" (include "common.ingress.supportsIngressClassname" .)) }} diff --git a/charts/mailpit/templates/persistentvolumeclaim.yaml b/charts/mailpit/templates/persistentvolumeclaim.yaml index eaa531b..ca789db 100644 --- a/charts/mailpit/templates/persistentvolumeclaim.yaml +++ b/charts/mailpit/templates/persistentvolumeclaim.yaml @@ -4,18 +4,9 @@ apiVersion: v1 metadata: name: {{ include "common.names.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- with .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 4 }} - {{- end }} - {{- if or .Values.commonAnnotations .Values.persistence.annotations }} - annotations: - {{- with .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 4 }} - {{- end }} - {{- with .Values.persistence.annotations }} - {{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- with include "common.tplvalues.merge" ( dict "values" (list .Values.persistence.annotations .Values.commonAnnotations) "context" . ) | fromYaml }} + annotations: {{- . | toYaml | nindent 4 }} {{- end }} spec: accessModes: {{ .Values.persistence.accessModes | toYaml | nindent 4 }} diff --git a/charts/mailpit/templates/secret.yaml b/charts/mailpit/templates/secret.yaml index 7c89eb2..7d18e95 100644 --- a/charts/mailpit/templates/secret.yaml +++ b/charts/mailpit/templates/secret.yaml @@ -4,10 +4,7 @@ kind: Secret metadata: name: {{ template "common.names.fullname" . }} namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- with .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} {{- with .Values.commonAnnotations }} annotations: {{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 4 }} {{- end }} diff --git a/charts/mailpit/templates/smtp-service.yaml b/charts/mailpit/templates/smtp-service.yaml index 5bff391..1d39bf1 100644 --- a/charts/mailpit/templates/smtp-service.yaml +++ b/charts/mailpit/templates/smtp-service.yaml @@ -3,18 +3,9 @@ kind: Service metadata: name: {{ template "common.names.fullname" . }}-smtp namespace: {{ include "common.names.namespace" . | quote }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- with .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 4 }} - {{- end }} - {{- if or .Values.commonAnnotations .Values.service.smtp.annotations }} - annotations: - {{- with .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 4 }} - {{- end }} - {{- with .Values.service.smtp.annotations }} - {{- include "common.tplvalues.render" ( dict "value" . "context" $ ) | nindent 4 }} - {{- end }} + labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }} + {{- with include "common.tplvalues.merge" ( dict "values" (list .Values.service.smtp.annotations .Values.commonAnnotations) "context" . ) | fromYaml }} + annotations: {{- . | toYaml | nindent 4 }} {{- end }} spec: type: {{ .Values.service.smtp.type }} @@ -25,4 +16,5 @@ spec: nodePort: {{ .Values.service.smtp.nodePort }} {{- end }} targetPort: smtp - selector: {{- include "common.labels.matchLabels" . | nindent 4 }} + {{- $podLabels := include "common.tplvalues.merge" ( dict "values" (list .Values.podLabels .Values.commonLabels) "context" . ) | fromYaml }} + selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }} diff --git a/charts/mailpit/values.schema.json b/charts/mailpit/values.schema.json new file mode 100644 index 0000000..e2e0550 --- /dev/null +++ b/charts/mailpit/values.schema.json @@ -0,0 +1,387 @@ +{ + "title": "Chart Values", + "type": "object", + "properties": { + "global": { + "type": "object", + "properties": { + "imageRegistry": { + "type": "string", + "description": "Global Docker image registry", + "default": "" + }, + "imagePullSecrets": { + "type": "array", + "description": "Global Docker registry secret names as an array", + "default": [], + "items": {} + }, + "storageClass": { + "type": "string", + "description": "Global StorageClass for Persistent Volume(s)", + "default": "" + } + } + }, + "image": { + "type": "object", + "properties": { + "registry": { + "type": "string", + "description": "image registry", + "default": "docker.io" + }, + "repository": { + "type": "string", + "description": "image repository", + "default": "axllent/mailpit" + }, + "tag": { + "type": "string", + "description": "image tag (immutable tags are recommended)", + "default": "v1.8.2" + }, + "digest": { + "type": "string", + "description": "image digest in the way sha256:aa.... Please note this parameter, if set, will override the tag image tag (immutable tags are recommended)", + "default": "" + }, + "pullPolicy": { + "type": "string", + "description": "image pull policy", + "default": "IfNotPresent" + }, + "pullSecrets": { + "type": "array", + "description": "image pull secrets", + "default": [], + "items": {} + }, + "debug": { + "type": "boolean", + "description": "Enable image debug mode", + "default": false + } + } + }, + "updateStrategy": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "statefulset strategy type", + "default": "RollingUpdate" + } + } + }, + "replicaCount": { + "type": "number", + "description": "Number of replicas to deploy", + "default": 1 + }, + "resources": { + "type": "object", + "properties": { + "limits": { + "type": "object", + "properties": { + "cpu": { + "type": "string", + "description": "The resources limits for the containers", + "default": "100m" + }, + "memory": { + "type": "string", + "description": "The resources limits for the containers", + "default": "64Mi" + } + } + }, + "requests": { + "type": "object", + "properties": { + "cpu": { + "type": "string", + "description": "The requested resources for the containers", + "default": "5m" + }, + "memory": { + "type": "string", + "description": "The requested resources for the containers", + "default": "4Mi" + } + } + } + } + }, + "affinity": { + "type": "object", + "description": "Pod affinity", + "default": {} + }, + "args": { + "type": "array", + "description": "Override default container args (useful when using custom images)", + "default": [], + "items": {} + }, + "extraEnvVars": { + "type": "array", + "description": "Array with extra environment variables to add to nodes", + "default": [], + "items": {} + }, + "mailpit": { + "type": "object", + "properties": { + "webroot": { + "type": "string", + "description": "Set the webroot for web UI & API", + "default": "/" + }, + "ui": { + "type": "object", + "properties": { + "authFile": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Adding basic authentication to web UI", + "default": false + }, + "htpasswd": { + "type": "string", + "description": "htpasswd content", + "default": "" + }, + "existingSecret": { + "type": "object", + "description": "Secret containing htpasswd content", + "default": {} + } + } + }, + "tls": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Enable tls for web UI", + "default": false + }, + "secretName": { + "type": "string", + "description": "tls secret for web UI", + "default": "" + } + } + } + } + }, + "smtp": { + "type": "object", + "properties": { + "authFile": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Adding SMTP authentication", + "default": false + }, + "htpasswd": { + "type": "string", + "description": "htpasswd content", + "default": "" + }, + "existingSecret": { + "type": "object", + "description": "Secret containing htpasswd content", + "default": {} + } + } + }, + "tls": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Enable tls for SMTP", + "default": false + }, + "secretName": { + "type": "string", + "description": "tls secret for SMTP", + "default": "" + } + } + } + } + }, + "relay": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "enable SMTP Relay configuration", + "default": false + }, + "config": { + "type": "object", + "description": "Mailpit SMTP relay configuration", + "default": {} + }, + "relayAll": { + "type": "boolean", + "description": "Relay all messages to relay", + "default": false + } + } + } + } + }, + "service": { + "type": "object", + "properties": { + "http": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "service type", + "default": "ClusterIP" + }, + "nodePort": { + "type": "number", + "description": "nodeport bind for HTTP service", + "default": 0 + } + } + }, + "smtp": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "service type", + "default": "ClusterIP" + }, + "nodePort": { + "type": "number", + "description": "nodeport bind for STMP service", + "default": 0 + } + } + } + } + }, + "ingress": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Enable ingress record generation for %%MAIN_CONTAINER_NAME%%", + "default": false + }, + "annotations": { + "type": "object", + "description": "Additional annotations for the Ingress resource. To enable certificate autogeneration, place here your cert-manager annotations.", + "default": {} + }, + "ingressClassName": { + "type": "string", + "description": "IngressClass that will be be used to implement the Ingress (Kubernetes 1.18+)", + "default": "" + }, + "hostname": { + "type": "string", + "description": "Default host for the ingress record", + "default": "hostname.local" + }, + "path": { + "type": "string", + "description": "Default path for the ingress record", + "default": "/" + }, + "pathType": { + "type": "string", + "description": "Ingress path type", + "default": "ImplementationSpecific" + }, + "extraHosts": { + "type": "array", + "description": "The list of additional hostnames to be covered with this ingress record.", + "default": [], + "items": {} + }, + "tls": { + "type": "boolean", + "description": "Enable TLS configuration for the host defined at `ingress.hostname` parameter", + "default": false + }, + "extraTls": { + "type": "array", + "description": "The tls configuration for additional hostnames to be covered with this ingress record.", + "default": [], + "items": {} + } + } + }, + "persistence": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean", + "description": "Enable persistence using Persistent Volume Claims", + "default": false + }, + "storageClass": { + "type": "string", + "description": "Storage class of backing PVC", + "default": "" + }, + "annotations": { + "type": "object", + "description": "Persistent Volume Claim annotations", + "default": {} + }, + "labels": { + "type": "object", + "description": "Persistent Volume Claim labels", + "default": {} + }, + "accessModes": { + "type": "array", + "description": "Persistent Volume Access Modes", + "default": [ + "ReadWriteOnce" + ], + "items": { + "type": "string" + } + }, + "size": { + "type": "string", + "description": "Size of data volume", + "default": "8Gi" + }, + "existingClaim": { + "type": "string", + "description": "The name of an existing PVC to use for persistence", + "default": "" + }, + "selector": { + "type": "object", + "description": "Selector to match an existing Persistent Volume for WordPress data PVC", + "default": {} + }, + "dataSource": { + "type": "object", + "description": "Custom PVC data source", + "default": {} + } + } + } + } +} \ No newline at end of file diff --git a/charts/mailpit/values.yaml b/charts/mailpit/values.yaml index a1e8558..f360483 100644 --- a/charts/mailpit/values.yaml +++ b/charts/mailpit/values.yaml @@ -148,13 +148,13 @@ service: ## @param service.http.nodePort nodeport bind for HTTP service ## type: ClusterIP - nodePort: + nodePort: 0 smtp: ## @param service.smtp.type service type ## @param service.smtp.nodePort nodeport bind for STMP service ## type: ClusterIP - nodePort: + nodePort: 0 ## ingress parameters