Add support for specifying custom dns configuration

This commit is contained in:
Waqar Ahmed 2020-10-13 20:55:34 +05:00
parent b20a4f6486
commit 8e65fdd379
3 changed files with 49 additions and 0 deletions

View File

@ -236,6 +236,44 @@ questions:
cidr: false cidr: false
required: true required: true
- variable: dnsPolicy
label: "DNS Policy"
description: "Default behaviour is where Pod inherits the name resolution configuration from the node that the pods run on, if None is specified, It allows a Pod to ignore DNS settings from the Kubernetes environment."
group: "Networking"
schema:
type: string
default: "Default"
enum:
- "Default"
- "None"
- variable: dnsConfig
label: "DNS Configuration"
group: "Networking"
description: "Specify custom DNS configuration which will be applied to the pod"
schema:
type: dict
attrs:
- variable: nameservers
label: "Nameservers"
schema:
default: []
type: list
items:
- variable: nameserver
label: "Nameserver"
schema:
type: string
- variable: searches
label: "Searches"
schema:
default: []
type: list
items:
- variable: search
label: "Search Entry"
schema:
type: string
# Storage Options # Storage Options
# Host path based volumes # Host path based volumes
- variable: hostPathVolumes - variable: hostPathVolumes

View File

@ -0,0 +1,10 @@
{{/*
DNS Configuration
*/}}
{{- define "dnsConfiguration" }}
dnsPolicy: .Values.dnsPolicy
{{- if .Values.dnsConfig }}
dnsConfig:
{{- toYaml .Values.dnsConfig | nindent 2 }}
{{- end }}
{{- end }}

View File

@ -63,6 +63,7 @@ containers:
{{- include "containerEnvVariables" . | indent 2 }} {{- include "containerEnvVariables" . | indent 2 }}
{{- include "containerLivenssProbe" . | indent 2 }} {{- include "containerLivenssProbe" . | indent 2 }}
{{- include "volumeConfiguration" . }} {{- include "volumeConfiguration" . }}
{{- include "dnsConfiguration" . }}
{{- end }} {{- end }}