Browse Source

Add support for specifying custom dns configuration

Waqar Ahmed 4 years ago
parent
commit
8e65fdd379

+ 38 - 0
charts/ix-chart/2010.0.1/questions.yaml

@@ -236,6 +236,44 @@ questions:
                                           cidr: false
                                           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
   # Host path based volumes
   - variable: hostPathVolumes

+ 10 - 0
charts/ix-chart/2010.0.1/templates/_networking.tpl

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

+ 1 - 0
charts/ix-chart/2010.0.1/templates/_workload.tpl

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