Skip to content

Commit

Permalink
Upd: Allow for setting the DNS policy for the pod
Browse files Browse the repository at this point in the history
  • Loading branch information
bokysan committed Oct 27, 2023
1 parent b90b336 commit d300d9b
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
26 changes: 26 additions & 0 deletions helm/mail/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,32 @@ spec:
{{- if .Values.extraContainers }}
{{- tpl .Values.extraContainers $root | nindent 8 }}
{{- end }}
{{- if .Values.dns.policy }}
dnsPolicy: {{- .Values.dns.policy }}
{{- end }}
{{- if or .Values.dns.nameservers .Values.dns.searches .Values.dns.options }}
dnsConfig:
{{- if .Values.dns.nameservers }}
nameservers:
{{- range .Values.dns.nameservers }}
- {{ . }}
{{- end }}
{{- end }}
{{- if .Values.dns.searches }}
searches: {{- .Values.dns.searches | nindent 4 }}
{{- end }}
{{- if .Values.dns.options }}
options:
{{- range .Values.dns.options }}
{{- if .name }}
- name: {{ .name }}
{{- if .value }}
value: {{ .value | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
volumes:
{{- if .Values.certs.create }}
- name: certs-init
Expand Down
14 changes: 14 additions & 0 deletions helm/mail/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,20 @@ config:
# e.g.
# RequireSafeKeys: "yes"

dns:
policy: ""
# policy: "None"
nameservers: {}
# - 8.8.8.8
# - 8.8.4.4
searches: ""
# searches: "default.svc.cluster.local svc.cluster.local cluster.local"
options: {}
# options:
# ndots:
# - name: ndots
# value: "5"

persistence:
enabled: true
accessModes:
Expand Down
10 changes: 10 additions & 0 deletions helm/test_14_test_dns_policy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
dns:
policy: "None"
nameservers:
- 8.8.8.8
- 8.8.4.4
searches: "default.svc.cluster.local svc.cluster.local cluster.local"
options:
ndots:
- name: ndots
value: "5"

0 comments on commit d300d9b

Please sign in to comment.