dnspolicy

This commit is contained in:
Stavros kois
2022-11-20 23:27:39 +02:00
parent 48cda2b292
commit 66b2b452df
4 changed files with 19 additions and 1 deletions
@@ -0,0 +1,13 @@
{{/* Returns dnsPolicy */}}
{{- define "ix.v1.common.dnsPolicy" -}}
{{- $policy := "ClusterFirst" -}}
{{- if .Values.dnsPolicy -}}
{{- if and (ne .Values.dnsPolicy "Default") (ne .Values.dnsPolicy "ClusterFirst") (ne .Values.dnsPolicy "ClusterFirstWithHostNet") (ne .Values.dnsPolicy "None") -}}
{{- fail "Not valid dnsPolicy. Valid options are ClusterFirst, Default, ClusterFirstWithHostNet, None" -}}
{{- end -}}
{{- $policy = .Values.dnsPolicy -}}
{{- else if .Values.hostNetwork -}}
{{- $policy = "ClusterFirstWithHostNet" -}}
{{- end -}}
{{- $policy -}}
{{- end -}}
@@ -1,7 +1,7 @@
{{/* Common labels shared across objects */}}
{{- define "ix.v1.common.labels" -}}
helm.sh/chart: {{ include "ix.v1.common.names.chart" . }}
{{- include "ix.v1.common.labels.selectorLabels" . }}
{{ include "ix.v1.common.labels.selectorLabels" . }}
{{- if .Chart.AppVersion }}
helm-revision: {{ .Release.Revision | quote }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
@@ -10,6 +10,9 @@ hostNetwork: {{ .Values.hostNetwork }}
{{- with .Values.hostname }}
hostname: {{ tpl . $ }}
{{- end -}}
{{- with (include "ix.v1.common.dnsPolicy" . | trim ) }}
dnsPolicy: {{ . }}
{{- end -}}
{{- with .Values.termination.gracePeriodSeconds }}
terminationGracePeriodSeconds: {{ . }}
{{- end }}
+2
View File
@@ -49,6 +49,8 @@ schedulerName: ""
priorityClassName: ""
dnsPolicy: ""
# TODO: docs
podSecurityContext:
runAsUser: 568