Commit 6776dadd authored by sonicaj's avatar sonicaj Committed by Waqar Ahmed

Generate host networking configuration separately

parent 845abb0a
...@@ -8,3 +8,16 @@ dnsConfig: ...@@ -8,3 +8,16 @@ dnsConfig:
{{- toYaml .Values.dnsConfig | nindent 2 }} {{- toYaml .Values.dnsConfig | nindent 2 }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{/*
Get configuration for host network
*/}}
{{- define "hostNetworkingConfiguration" -}}
{{- $host := default false .Values.hostNetwork -}}
{{- if or .Values.externalInterfaces (eq $host false) -}}
{{- print "false" -}}
{{- else -}}
{{- print "true" -}}
{{- end -}}
{{- end -}}
...@@ -51,7 +51,7 @@ Pod specification ...@@ -51,7 +51,7 @@ Pod specification
*/}} */}}
{{- define "podSepc" }} {{- define "podSepc" }}
restartPolicy: {{ template "restartPolicy" . }} restartPolicy: {{ template "restartPolicy" . }}
hostNetwork: {{ .Values.hostNetwork }} hostNetwork: {{ template "hostNetworkingConfiguration" . }}
containers: containers:
- name: {{ .Chart.Name }} - name: {{ .Chart.Name }}
{{- include "volumeMountsConfiguration" . | indent 2}} {{- include "volumeMountsConfiguration" . | indent 2}}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment