Skip to content

Commit f641031

Browse files
authored
Merge pull request #196 from barbirict/feat/ip-family-policy-in-service
feat(service): add support for ipFamilyPolicy and ipFamilies
2 parents 2c43eb2 + b73f959 commit f641031

File tree

2 files changed

+39
-26
lines changed

2 files changed

+39
-26
lines changed

charts/docker-mailserver/templates/service.yaml

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ metadata:
1010
prometheus.io/probe: {{ .Values.monitoring.service.probe | quote }}
1111
prometheus.io/path: {{ .Values.monitoring.service.path | quote }}
1212
prometheus.io/port: {{ .Values.monitoring.service.port | quote }}
13-
##
13+
##
1414
{{- if .Values.service.annotations }}
1515
{{ toYaml .Values.service.annotations | indent 4 }}
1616
{{ end }}
@@ -44,20 +44,20 @@ spec:
4444
- name: smtp
4545
port: 25
4646
targetPort: smtp
47-
{{- if eq .Values.service.type "NodePort" }}
47+
{{- if eq .Values.service.type "NodePort" }}
4848
nodePort: {{ default "30025" .Values.service.nodePort.smtp }}
4949
{{- end }}
5050

5151
- name: submissions
5252
targetPort: submissions
5353
port: 465
54-
{{- if eq .Values.service.type "NodePort" }}
54+
{{- if eq .Values.service.type "NodePort" }}
5555
nodePort: {{ default "30465" .Values.service.nodePort.smtps }}
56-
{{- end }}
56+
{{- end }}
5757
- name: submission
5858
targetPort: submission
5959
port: 587
60-
{{- if eq .Values.service.type "NodePort" }}
60+
{{- if eq .Values.service.type "NodePort" }}
6161
nodePort: {{ default "30587" .Values.service.nodePort.submission }}
6262
{{ end }}
6363
{{- if .Values.proxyProtocol.enabled }}
@@ -70,75 +70,75 @@ spec:
7070
- name: sub-proxy
7171
targetPort: sub-proxy
7272
port: 10587
73-
{{- end }}
73+
{{- end }}
7474

7575
{{- if and (.Values.deployment.env.ENABLE_IMAP) (not .Values.deployment.env.SMTP_ONLY) }}
7676
- name: imap
7777
targetPort: imap
7878
port: 143
79-
{{- if eq .Values.service.type "NodePort" }}
79+
{{- if eq .Values.service.type "NodePort" }}
8080
nodePort: {{ default "30143" .Values.service.nodePort.imap }}
81-
{{- end }}
81+
{{- end }}
8282
- name: imaps
8383
targetPort: imaps
8484
port: 993
85-
{{- if eq .Values.service.type "NodePort" }}
85+
{{- if eq .Values.service.type "NodePort" }}
8686
nodePort: {{ default "30993" .Values.service.nodePort.imaps }}
87-
{{- end }}
87+
{{- end }}
8888
{{- if .Values.proxyProtocol.enabled }}
8989
- name: imap-proxy
9090
targetPort: imap-proxy
9191
port: 10143
9292
- name: imaps-proxy
9393
targetPort: imaps-proxy
9494
port: 10993
95-
{{- end }}
96-
{{- end }}
95+
{{- end }}
96+
{{- end }}
9797

9898
{{- if and (.Values.deployment.env.ENABLE_POP3) (not .Values.deployment.env.SMTP_ONLY) }}
9999
- name: pop3
100100
targetPort: pop3
101101
port: 110
102-
{{- if eq .Values.service.type "NodePort" }}
102+
{{- if eq .Values.service.type "NodePort" }}
103103
nodePort: {{ default "30110" .Values.service.nodePort.pop3 }}
104-
{{- end }}
104+
{{- end }}
105105
- name: pop3s
106106
targetPort: pop3s
107107
port: 995
108-
{{- if eq .Values.service.type "NodePort" }}
108+
{{- if eq .Values.service.type "NodePort" }}
109109
nodePort: {{ default "30995" .Values.service.nodePort.pop3s }}
110-
{{- end }}
110+
{{- end }}
111111
{{- if .Values.proxyProtocol.enabled }}
112112
- name: pop3-proxy
113113
targetPort: pop3-proxy
114114
port: 10110
115115
- name: pop3s-proxy
116116
targetPort: pop3s-proxy
117117
port: 10995
118-
{{- end }}
119-
{{- end }}
120-
118+
{{- end }}
119+
{{- end }}
120+
121121
{{- if .Values.deployment.env.ENABLE_RSPAMD }}
122122
- name: rspamd
123123
targetPort: rspamd
124-
port: 11334
125-
{{- end }}
124+
port: 11334
125+
{{- end }}
126126

127127
{{- if and (.Values.deployment.env.ENABLE_MANAGESIEVE) (not .Values.deployment.env.SMTP_ONLY) }}
128128
- name: managesieve
129129
targetPort: managesieve
130-
port: 4190
130+
port: 4190
131131
{{- if .Values.proxyProtocol.enabled }}
132132
- name: msieve-proxy
133133
targetPort: msieve-proxy
134134
port: 14190
135-
{{- end }}
136-
{{- end }}
137-
135+
{{- end }}
136+
{{- end }}
137+
138138
{{- if .Values.metrics.enabled }}
139139
- name: metrics
140140
port: {{ .Values.monitoring.service.port }}
141-
targetPort: metrics
141+
targetPort: metrics
142142
{{- end }}
143143

144144
type: {{ default "ClusterIP" .Values.service.type }}
@@ -148,3 +148,9 @@ spec:
148148
{{- if .Values.service.trafficDistribution }}
149149
trafficDistribution: {{ .Values.service.trafficDistribution }}
150150
{{- end }}
151+
152+
ipFamilyPolicy: {{ default "SingleStack" .Values.service.ipFamilyPolicy }}
153+
{{- if .Values.service.ipFamilies }}
154+
ipFamilies:
155+
{{- toYaml .Values.service.ipFamilies | nindent 2 }}
156+
{{- end }}

charts/docker-mailserver/values.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,13 @@ service:
321321
## to allocate a free IP from the pool.
322322
## Default: Automatically assign a random IP
323323
# clusterIp:
324+
## IP family policy for the service. Options: SingleStack, PreferDualStack, RequireDualStack
325+
## Default: SingleStack
326+
#ipFamilyPolicy:
327+
## List of IP families to use. Options: IPv4, IPv6
328+
## Order determines preference when ipFamilyPolicy is PreferDualStack or RequireDualStack
329+
## Default: Determined by cluster configuration
330+
#ipFamilies:
324331
annotations: {}
325332
labels: {}
326333

0 commit comments

Comments
 (0)