Skip to content

Commit 1e7978d

Browse files
committed
fix!: support dynamic NodePorts by making ports optional/removing default
1 parent 754a752 commit 1e7978d

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
@@ -331,14 +331,15 @@ Check that the deployed pods are all running.
331331
| `front.externalService.ports.smtps` | Expose SMTP port (TLS) - 465/tcp | `true` |
332332
| `front.externalService.ports.submission` | Expose Submission port - 587/tcp | `false` |
333333
| `front.externalService.ports.manageSieve` | Expose ManageSieve port - 4190/tcp | `true` |
334-
| `front.externalService.nodePorts.pop3` | NodePort to use for POP3 (defaults to 110/tcp) | `110` |
335-
| `front.externalService.nodePorts.pop3s` | NodePort to use for POP3 (TLS) (defaults to 995/tcp) | `995` |
336-
| `front.externalService.nodePorts.imap` | NodePort to use for IMAP (defaults to 143/tcp) | `143` |
337-
| `front.externalService.nodePorts.imaps` | NodePort to use for IMAP (TLS) (defaults to 993/tcp) | `993` |
338-
| `front.externalService.nodePorts.smtp` | NodePort to use for SMTP (defaults to 25/tcp) | `25` |
339-
| `front.externalService.nodePorts.smtps` | NodePort to use for SMTP (TLS) (defaults to 465/tcp) | `465` |
340-
| `front.externalService.nodePorts.submission` | NodePort to use for Submission (defaults to 587/tcp) | `587` |
341-
| `front.externalService.nodePorts.manageSieve` | NodePort to use for ManageSieve (defaults to 4190/tcp) | `4190` |
334+
| `front.externalService.nodePorts` | Optionally define NodePorts. | `{}` |
335+
| `front.externalService.nodePorts.pop3` | NodePort to use for POP3 | `undefined` |
336+
| `front.externalService.nodePorts.pop3s` | NodePort to use for POP3 (TLS) | `undefined` |
337+
| `front.externalService.nodePorts.imap` | NodePort to use for IMAP | `undefined` |
338+
| `front.externalService.nodePorts.imaps` | NodePort to use for IMAP (TLS) | `undefined` |
339+
| `front.externalService.nodePorts.smtp` | NodePort to use for SMTP | `undefined` |
340+
| `front.externalService.nodePorts.smtps` | NodePort to use for SMTP (TLS) | `undefined` |
341+
| `front.externalService.nodePorts.submission` | NodePort to use for Submission | `undefined` |
342+
| `front.externalService.nodePorts.manageSieve` | NodePort to use for ManageSieve | `undefined` |
342343
| `front.kind` | Kind of resource to create for the front (`Deployment` or `DaemonSet`) | `Deployment` |
343344
| `front.replicaCount` | Number of front replicas to deploy (only for `Deployment` kind) | `1` |
344345
| `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
@@ -715,14 +715,15 @@ front:
715715
## @param front.externalService.ports.smtps Expose SMTP port (TLS) - 465/tcp
716716
## @param front.externalService.ports.submission Expose Submission port - 587/tcp
717717
## @param front.externalService.ports.manageSieve Expose ManageSieve port - 4190/tcp
718-
## @param front.externalService.nodePorts.pop3 NodePort to use for POP3 (defaults to 110/tcp)
719-
## @param front.externalService.nodePorts.pop3s NodePort to use for POP3 (TLS) (defaults to 995/tcp)
720-
## @param front.externalService.nodePorts.imap NodePort to use for IMAP (defaults to 143/tcp)
721-
## @param front.externalService.nodePorts.imaps NodePort to use for IMAP (TLS) (defaults to 993/tcp)
722-
## @param front.externalService.nodePorts.smtp NodePort to use for SMTP (defaults to 25/tcp)
723-
## @param front.externalService.nodePorts.smtps NodePort to use for SMTP (TLS) (defaults to 465/tcp)
724-
## @param front.externalService.nodePorts.submission NodePort to use for Submission (defaults to 587/tcp)
725-
## @param front.externalService.nodePorts.manageSieve NodePort to use for ManageSieve (defaults to 4190/tcp)
718+
## @param front.externalService.nodePorts [nullable] Optionally define NodePorts.
719+
## @param front.externalService.nodePorts.pop3 [nullable] NodePort to use for POP3
720+
## @param front.externalService.nodePorts.pop3s [nullable] NodePort to use for POP3 (TLS)
721+
## @param front.externalService.nodePorts.imap [nullable] NodePort to use for IMAP
722+
## @param front.externalService.nodePorts.imaps [nullable] NodePort to use for IMAP (TLS)
723+
## @param front.externalService.nodePorts.smtp [nullable] NodePort to use for SMTP
724+
## @param front.externalService.nodePorts.smtps [nullable] NodePort to use for SMTP (TLS)
725+
## @param front.externalService.nodePorts.submission [nullable] NodePort to use for Submission
726+
## @param front.externalService.nodePorts.manageSieve [nullable] NodePort to use for ManageSieve
726727
externalService:
727728
enabled: false
728729
type: ClusterIP
@@ -740,15 +741,15 @@ front:
740741
smtps: true
741742
submission: false
742743
manageSieve: true
743-
nodePorts:
744-
pop3: 110
745-
pop3s: 995
746-
imap: 143
747-
imaps: 993
748-
smtp: 25
749-
smtps: 465
750-
submission: 587
751-
manageSieve: 4190
744+
nodePorts: {}
745+
# pop3: 110
746+
# pop3s: 995
747+
# imap: 143
748+
# imaps: 993
749+
# smtp: 25
750+
# smtps: 465
751+
# submission: 587
752+
# manageSieve: 4190
752753

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

0 commit comments

Comments
 (0)