Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion templates/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,12 @@ spec:
{{- if .Values.sidecars }}
{{- include "common.tplvalues.render" (dict "value" .Values.sidecars "context" $) | nindent 8 }}
{{- end }}
dnsPolicy: ClusterFirst
{{- if .Values.dnsConfig }}
dnsConfig: {{- include "common.tplvalues.render" (dict "value" .Values.dnsConfig "context" $) | nindent 12 }}
{{- end }}
{{- if .Values.dnsPolicy }}
dnsPolicy: {{ .Values.dnsPolicy | quote }}
{{- end }}
{{- include "common.images.renderPullSecrets" (dict "images" (list .Values.image) "context" $) | nindent 6 }}
volumes:
- name: {{ .Release.Name }}-etc
Expand Down
43 changes: 43 additions & 0 deletions tests/deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,46 @@ tests:
- equal:
path: spec.maxReplicas
value: 5

- it: should omit dnsConfig by default
template: deployment.yml
asserts:
- notExists:
path: spec.template.spec.dnsConfig

- it: should render dnsConfig options when specified via values
template: deployment.yml
set:
dnsConfig:
options:
- name: ndots
value: "1"
searches:
- cluster.home.arpa
- home.arpa
asserts:
- equal:
path: spec.template.spec.dnsConfig
value:
options:
- name: ndots
value: "1"
searches:
- cluster.home.arpa
- home.arpa

- it: should render dnsPolicy by default
template: deployment.yml
asserts:
- equal:
path: spec.template.spec.dnsPolicy
value: ClusterFirst

- it: should render dnsPolicy when specified via values
template: deployment.yml
set:
dnsPolicy: ClusterFirstWithHostNet
asserts:
- equal:
path: spec.template.spec.dnsPolicy
value: ClusterFirstWithHostNet
18 changes: 18 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,24 @@ disruptionBudget:
## @param environment [array] Extra env vars passed to the Stream pods
environment: []

## Pod's DNS Configuration
## https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-dns-config
## This value is useful if you need to resolve your custom domain for ACME challenges
## Example:
## nameservers:
## - 1.2.3.4
## searches:
## - ns1.svc.cluster-domain.example
## - my.dns.search.suffix
## options:
## - name: ndots
## value: "2"
dnsConfig: {}

# Pod's DNS Policy
# https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#pod-s-dns-policy
dnsPolicy: ClusterFirst

## @section Stream Service configuration
##
service:
Expand Down
Loading