Generate host networking configuration separately

This commit is contained in:
sonicaj
2021-08-24 20:25:02 +05:00
committed by Waqar Ahmed
parent 845abb0a75
commit 6776dadd67
2 changed files with 14 additions and 1 deletions

View File

@@ -8,3 +8,16 @@ dnsConfig:
{{- toYaml .Values.dnsConfig | nindent 2 }}
{{- 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 -}}

View File

@@ -51,7 +51,7 @@ Pod specification
*/}}
{{- define "podSepc" }}
restartPolicy: {{ template "restartPolicy" . }}
hostNetwork: {{ .Values.hostNetwork }}
hostNetwork: {{ template "hostNetworkingConfiguration" . }}
containers:
- name: {{ .Chart.Name }}
{{- include "volumeMountsConfiguration" . | indent 2}}