Skip to content

Commit 7936484

Browse files
committed
fix!: support dynamic NodePorts by making ports optional/removing default
1 parent 25a565b commit 7936484

File tree

4 files changed

+38
-36
lines changed

4 files changed

+38
-36
lines changed

charts/mailu/README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -325,14 +325,15 @@ Check that the deployed pods are all running.
325325
| `front.externalService.ports.smtps` | Expose SMTP port (TLS) - 465/tcp | `true` |
326326
| `front.externalService.ports.submission` | Expose Submission port - 587/tcp | `false` |
327327
| `front.externalService.ports.manageSieve` | Expose ManageSieve port - 4190/tcp | `true` |
328-
| `front.externalService.nodePorts.pop3` | NodePort to use for POP3 (defaults to 110/tcp) | `110` |
329-
| `front.externalService.nodePorts.pop3s` | NodePort to use for POP3 (TLS) (defaults to 995/tcp) | `995` |
330-
| `front.externalService.nodePorts.imap` | NodePort to use for IMAP (defaults to 143/tcp) | `143` |
331-
| `front.externalService.nodePorts.imaps` | NodePort to use for IMAP (TLS) (defaults to 993/tcp) | `993` |
332-
| `front.externalService.nodePorts.smtp` | NodePort to use for SMTP (defaults to 25/tcp) | `25` |
333-
| `front.externalService.nodePorts.smtps` | NodePort to use for SMTP (TLS) (defaults to 465/tcp) | `465` |
334-
| `front.externalService.nodePorts.submission` | NodePort to use for Submission (defaults to 587/tcp) | `587` |
335-
| `front.externalService.nodePorts.manageSieve` | NodePort to use for ManageSieve (defaults to 4190/tcp) | `4190` |
328+
| `front.externalService.nodePorts` | Optionally define NodePorts. | `{}` |
329+
| `front.externalService.nodePorts.pop3` | NodePort to use for POP3 | `undefined` |
330+
| `front.externalService.nodePorts.pop3s` | NodePort to use for POP3 (TLS) | `undefined` |
331+
| `front.externalService.nodePorts.imap` | NodePort to use for IMAP | `undefined` |
332+
| `front.externalService.nodePorts.imaps` | NodePort to use for IMAP (TLS) | `undefined` |
333+
| `front.externalService.nodePorts.smtp` | NodePort to use for SMTP | `undefined` |
334+
| `front.externalService.nodePorts.smtps` | NodePort to use for SMTP (TLS) | `undefined` |
335+
| `front.externalService.nodePorts.submission` | NodePort to use for Submission | `undefined` |
336+
| `front.externalService.nodePorts.manageSieve` | NodePort to use for ManageSieve | `undefined` |
336337
| `front.kind` | Kind of resource to create for the front (`Deployment` or `DaemonSet`) | `Deployment` |
337338
| `front.replicaCount` | Number of front replicas to deploy (only for `Deployment` kind) | `1` |
338339
| `front.resources.limits` | The resources limits for the container | `{}` |

charts/mailu/ci/helm-lint-values.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
hostnames:
2-
- example.com
2+
- mailu.cluster.local
33

4-
domain: example.com
4+
domain: mailu.cluster.local
55

66
initialAccount:
77
enabled: true
88
username: mailadmin
9-
domain: example.com
9+
domain: mailu.cluster.local
1010
password: chang3m3!
1111

1212
secretKey: chang3m3!

charts/mailu/templates/front/service-external.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,63 +27,63 @@ spec:
2727
- name: pop3
2828
port: 110
2929
protocol: TCP
30-
{{ if eq $.Values.front.externalService.type "NodePort" -}}
30+
{{- if and (eq $.Values.front.externalService.type "NodePort") .nodePorts.pop3 }}
3131
nodePort: {{ .nodePorts.pop3 }}
3232
{{- end }}
3333
{{- end }}
3434
{{- if .ports.pop3s }}
3535
- name: pop3s
3636
port: 995
3737
protocol: TCP
38-
{{ if eq $.Values.front.externalService.type "NodePort" -}}
38+
{{- if and (eq $.Values.front.externalService.type "NodePort") .nodePorts.pop3s }}
3939
nodePort: {{ .nodePorts.pop3s }}
4040
{{- end }}
4141
{{- end }}
4242
{{- if .ports.imap }}
4343
- name: imap
4444
port: 143
4545
protocol: TCP
46-
{{ if eq $.Values.front.externalService.type "NodePort" -}}
46+
{{- if and (eq $.Values.front.externalService.type "NodePort") .nodePorts.imap }}
4747
nodePort: {{ .nodePorts.imap }}
4848
{{- end }}
4949
{{- end }}
5050
{{- if .ports.imaps }}
5151
- name: imaps
5252
port: 993
5353
protocol: TCP
54-
{{ if eq $.Values.front.externalService.type "NodePort" -}}
54+
{{- if and (eq $.Values.front.externalService.type "NodePort") .nodePorts.imaps }}
5555
nodePort: {{ .nodePorts.imaps }}
5656
{{- end }}
5757
{{- end }}
5858
{{- if .ports.smtp }}
5959
- name: smtp
6060
port: 25
6161
protocol: TCP
62-
{{ if eq $.Values.front.externalService.type "NodePort" -}}
62+
{{- if and (eq $.Values.front.externalService.type "NodePort") .nodePorts.smtp }}
6363
nodePort: {{ .nodePorts.smtp }}
6464
{{- end }}
6565
{{- end }}
6666
{{- if .ports.smtps }}
6767
- name: smtps
6868
port: 465
6969
protocol: TCP
70-
{{ if eq $.Values.front.externalService.type "NodePort" -}}
70+
{{- if and (eq $.Values.front.externalService.type "NodePort") .nodePorts.smtps }}
7171
nodePort: {{ .nodePorts.smtps }}
7272
{{- end }}
7373
{{- end }}
7474
{{- if .ports.submission }}
7575
- name: smtpd
7676
port: 587
7777
protocol: TCP
78-
{{ if eq $.Values.front.externalService.type "NodePort" -}}
78+
{{- if and (eq $.Values.front.externalService.type "NodePort") .nodePorts.submission }}
7979
nodePort: {{ .nodePorts.submission }}
8080
{{- end }}
8181
{{- end }}
8282
{{- if .ports.manageSieve }}
8383
- name: sieve
8484
port: 4190
8585
protocol: TCP
86-
{{ if eq $.Values.front.externalService.type "NodePort" -}}
86+
{{- if and (eq $.Values.front.externalService.type "NodePort") .nodePorts.manageSieve }}
8787
nodePort: {{ .nodePorts.manageSieve }}
8888
{{- end }}
8989
{{- end }}

charts/mailu/values.yaml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -687,14 +687,15 @@ front:
687687
## @param front.externalService.ports.smtps Expose SMTP port (TLS) - 465/tcp
688688
## @param front.externalService.ports.submission Expose Submission port - 587/tcp
689689
## @param front.externalService.ports.manageSieve Expose ManageSieve port - 4190/tcp
690-
## @param front.externalService.nodePorts.pop3 NodePort to use for POP3 (defaults to 110/tcp)
691-
## @param front.externalService.nodePorts.pop3s NodePort to use for POP3 (TLS) (defaults to 995/tcp)
692-
## @param front.externalService.nodePorts.imap NodePort to use for IMAP (defaults to 143/tcp)
693-
## @param front.externalService.nodePorts.imaps NodePort to use for IMAP (TLS) (defaults to 993/tcp)
694-
## @param front.externalService.nodePorts.smtp NodePort to use for SMTP (defaults to 25/tcp)
695-
## @param front.externalService.nodePorts.smtps NodePort to use for SMTP (TLS) (defaults to 465/tcp)
696-
## @param front.externalService.nodePorts.submission NodePort to use for Submission (defaults to 587/tcp)
697-
## @param front.externalService.nodePorts.manageSieve NodePort to use for ManageSieve (defaults to 4190/tcp)
690+
## @param front.externalService.nodePorts [nullable] Optionally define NodePorts.
691+
## @param front.externalService.nodePorts.pop3 [nullable] NodePort to use for POP3
692+
## @param front.externalService.nodePorts.pop3s [nullable] NodePort to use for POP3 (TLS)
693+
## @param front.externalService.nodePorts.imap [nullable] NodePort to use for IMAP
694+
## @param front.externalService.nodePorts.imaps [nullable] NodePort to use for IMAP (TLS)
695+
## @param front.externalService.nodePorts.smtp [nullable] NodePort to use for SMTP
696+
## @param front.externalService.nodePorts.smtps [nullable] NodePort to use for SMTP (TLS)
697+
## @param front.externalService.nodePorts.submission [nullable] NodePort to use for Submission
698+
## @param front.externalService.nodePorts.manageSieve [nullable] NodePort to use for ManageSieve
698699
externalService:
699700
enabled: false
700701
type: ClusterIP
@@ -712,15 +713,15 @@ front:
712713
smtps: true
713714
submission: false
714715
manageSieve: true
715-
nodePorts:
716-
pop3: 110
717-
pop3s: 995
718-
imap: 143
719-
imaps: 993
720-
smtp: 25
721-
smtps: 465
722-
submission: 587
723-
manageSieve: 4190
716+
nodePorts: {}
717+
# pop3: 110
718+
# pop3s: 995
719+
# imap: 143
720+
# imaps: 993
721+
# smtp: 25
722+
# smtps: 465
723+
# submission: 587
724+
# manageSieve: 4190
724725

725726
## @param front.kind Kind of resource to create for the front (`Deployment` or `DaemonSet`)
726727
kind: Deployment

0 commit comments

Comments
 (0)