From ae3c34337c309878662cf9e71143161788063488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szczepan=20R=C4=99dzioch?= <> Date: Mon, 5 Feb 2024 13:21:52 +0100 Subject: [PATCH] Separate SMTP and web ports on Pod and k8s Service --- charts/maildev/Chart.yaml | 4 ++-- charts/maildev/README.md | 2 ++ charts/maildev/templates/deployment.yaml | 8 ++++---- charts/maildev/values.yaml | 8 ++++++-- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/charts/maildev/Chart.yaml b/charts/maildev/Chart.yaml index 98288c93..4ac558b0 100644 --- a/charts/maildev/Chart.yaml +++ b/charts/maildev/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: maildev description: MailDev is a simple way to test your emails during development with an easy to use web interface. type: application -version: 1.1.0 +version: 1.1.1 appVersion: "2.1.0" home: https://github.com/christianknell/helm-charts icon: https://avatars1.githubusercontent.com/u/26743469 @@ -16,7 +16,7 @@ sources: annotations: artifacthub.io/changes: | - kind: changed - description: image version to 2.1.0 + description: separate pod and service ports artifacthub.io/screenshots: | - title: SMTP server & web interface for viewing and testing emails during development. url: https://maildev.github.io/maildev/assets/img/original/maildev-light.png diff --git a/charts/maildev/README.md b/charts/maildev/README.md index 510ad4e5..89d6545f 100644 --- a/charts/maildev/README.md +++ b/charts/maildev/README.md @@ -168,8 +168,10 @@ The command removes all the Kubernetes components associated with the chart and | serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template | | services.smtp.nodePort | string | `nil` | You can set the node port for the external SMTP server that should be used or leave it blank to get a random node port. Only active if `services.smtp.type == NodePort` | | services.smtp.port | int | `1025` | Kubernetes port to use for the internal SMTP server | +| services.smtp.podPort | int | `1025` | Pod port to use for the internal SMTP server | | services.smtp.type | string | `"ClusterIP"` | Kubernetes service type for the SMTP server | | services.web.port | int | `1080` | Kubernetes port to use for the web GUI | +| services.web.podPort | int | `1080` | Pod port to use for the web GUI | | services.web.type | string | `"ClusterIP"` | Kubernetes service type for the web GUI | | tolerations | list | `[]` | Toleration labels for pod assignment | diff --git a/charts/maildev/templates/deployment.yaml b/charts/maildev/templates/deployment.yaml index 807756ff..c307bd76 100644 --- a/charts/maildev/templates/deployment.yaml +++ b/charts/maildev/templates/deployment.yaml @@ -77,7 +77,7 @@ spec: value: {{ .Values.maildev.config.mailDirectory | quote }} # SMTP Settings - name: MAILDEV_SMTP_PORT - value: {{ .Values.services.smtp.port | quote }} + value: {{ .Values.services.smtp.podPort | quote }} {{- if .Values.maildev.config.smtp.hideExtensions }} - name: MAILDEV_HIDE_EXTENSIONS value: {{ .Values.maildev.config.smtp.hideExtensions | quote }} @@ -123,7 +123,7 @@ spec: key: web-password {{- end }} - name: MAILDEV_WEB_PORT - value: {{ .Values.services.web.port | quote }} + value: {{ .Values.services.web.podPort | quote }} {{- if .Values.extraEnv }} ## Additional Setings {{- range .Values.extraEnv }} @@ -135,10 +135,10 @@ spec: {{- end }} ports: - name: web - containerPort: {{ .Values.services.web.port }} + containerPort: {{ .Values.services.web.podPort }} protocol: TCP - name: smtp - containerPort: {{ .Values.services.smtp.port }} + containerPort: {{ .Values.services.smtp.podPort }} protocol: TCP livenessProbe: httpGet: diff --git a/charts/maildev/values.yaml b/charts/maildev/values.yaml index 1692f6b7..720d1f37 100644 --- a/charts/maildev/values.yaml +++ b/charts/maildev/values.yaml @@ -65,13 +65,17 @@ services: web: # -- Kubernetes service type for the web GUI type: ClusterIP - # -- Kubernetes port to use for the web GUI + # -- Kubernetes service port to use for the web GUI port: 1080 + # -- Pod port to use for the web GUI + podPort: 1080 smtp: # -- Kubernetes service type for the SMTP server type: ClusterIP - # -- Kubernetes port to use for the internal SMTP server + # -- Kubernetes service port to use for the internal SMTP server port: 1025 + # -- Pod port to use for the internal SMTP server + podPort: 1025 # -- You can set the node port for the external SMTP server that should be used or leave it blank to get a random node port. Only active if `services.smtp.type == NodePort` nodePort: