{{- if .Values.webhookTestProxy.create -}} {{- $isWindows := (contains "windows" .Values.targetNodeOs) -}} {{- $osSelector := printf "kubernetes.io/os" -}} apiVersion: apps/v1 kind: DaemonSet metadata: name: {{ .Values.webhookTestProxy.label }} labels: app: {{ .Values.webhookTestProxy.label }} spec: selector: matchLabels: app: {{ .Values.webhookTestProxy.label }} template: metadata: labels: app: {{ .Values.webhookTestProxy.label }} spec: serviceAccountName: {{ template "webhook-test-proxy.serviceAccountName" . }} {{- if (not $isWindows) }} securityContext: runAsUser: 1000 runAsGroup: 3000 fsGroup: 2000 {{- end }} nodeSelector: {{ $osSelector }}: {{ $isWindows | ternary "windows" "linux" }} containers: - name: {{ .Values.webhookTestProxy.label }} image: {{ .Values.webhookTestProxy.image.repository }}:{{ .Values.webhookTestProxy.image.tag }} imagePullPolicy: {{ .Values.webhookTestProxy.image.pullPolicy }} ports: - containerPort: {{ .Values.webhookTestProxy.containerPort }} env: - name: PORT value: {{ .Values.webhookTestProxy.containerPort | quote }} {{- if .Values.webhookTestProxy.tolerations }} tolerations: {{ toYaml .Values.webhookTestProxy.tolerations | indent 8 }} {{- end }} {{- end -}}