Mohammed Naser | 9ad0d46 | 2023-01-15 20:36:37 -0500 | [diff] [blame] | 1 | {{- define "ingress-nginx.params" -}} |
| 2 | - /nginx-ingress-controller |
| 3 | {{- if .Values.defaultBackend.enabled }} |
| 4 | - --default-backend-service=$(POD_NAMESPACE)/{{ include "ingress-nginx.defaultBackend.fullname" . }} |
| 5 | {{- end }} |
| 6 | {{- if and .Values.controller.publishService.enabled .Values.controller.service.enabled }} |
| 7 | {{- if .Values.controller.service.external.enabled }} |
| 8 | - --publish-service={{ template "ingress-nginx.controller.publishServicePath" . }} |
| 9 | {{- else if .Values.controller.service.internal.enabled }} |
| 10 | - --publish-service={{ template "ingress-nginx.controller.publishServicePath" . }}-internal |
| 11 | {{- end }} |
| 12 | {{- end }} |
| 13 | - --election-id={{ .Values.controller.electionID }} |
| 14 | - --controller-class={{ .Values.controller.ingressClassResource.controllerValue }} |
| 15 | {{- if .Values.controller.ingressClass }} |
| 16 | - --ingress-class={{ .Values.controller.ingressClass }} |
| 17 | {{- end }} |
| 18 | - --configmap={{ default "$(POD_NAMESPACE)" .Values.controller.configMapNamespace }}/{{ include "ingress-nginx.controller.fullname" . }} |
| 19 | {{- if .Values.tcp }} |
| 20 | - --tcp-services-configmap={{ default "$(POD_NAMESPACE)" .Values.controller.tcp.configMapNamespace }}/{{ include "ingress-nginx.fullname" . }}-tcp |
| 21 | {{- end }} |
| 22 | {{- if .Values.udp }} |
| 23 | - --udp-services-configmap={{ default "$(POD_NAMESPACE)" .Values.controller.udp.configMapNamespace }}/{{ include "ingress-nginx.fullname" . }}-udp |
| 24 | {{- end }} |
| 25 | {{- if .Values.controller.scope.enabled }} |
| 26 | - --watch-namespace={{ default "$(POD_NAMESPACE)" .Values.controller.scope.namespace }} |
| 27 | {{- end }} |
| 28 | {{- if and (not .Values.controller.scope.enabled) .Values.controller.scope.namespaceSelector }} |
| 29 | - --watch-namespace-selector={{ default "" .Values.controller.scope.namespaceSelector }} |
| 30 | {{- end }} |
| 31 | {{- if and .Values.controller.reportNodeInternalIp .Values.controller.hostNetwork }} |
| 32 | - --report-node-internal-ip-address={{ .Values.controller.reportNodeInternalIp }} |
| 33 | {{- end }} |
| 34 | {{- if .Values.controller.admissionWebhooks.enabled }} |
| 35 | - --validating-webhook=:{{ .Values.controller.admissionWebhooks.port }} |
| 36 | - --validating-webhook-certificate={{ .Values.controller.admissionWebhooks.certificate }} |
| 37 | - --validating-webhook-key={{ .Values.controller.admissionWebhooks.key }} |
| 38 | {{- end }} |
| 39 | {{- if .Values.controller.maxmindLicenseKey }} |
| 40 | - --maxmind-license-key={{ .Values.controller.maxmindLicenseKey }} |
| 41 | {{- end }} |
| 42 | {{- if .Values.controller.healthCheckHost }} |
| 43 | - --healthz-host={{ .Values.controller.healthCheckHost }} |
| 44 | {{- end }} |
| 45 | {{- if not (eq .Values.controller.healthCheckPath "/healthz") }} |
| 46 | - --health-check-path={{ .Values.controller.healthCheckPath }} |
| 47 | {{- end }} |
| 48 | {{- if .Values.controller.ingressClassByName }} |
| 49 | - --ingress-class-by-name=true |
| 50 | {{- end }} |
| 51 | {{- if .Values.controller.watchIngressWithoutClass }} |
| 52 | - --watch-ingress-without-class=true |
| 53 | {{- end }} |
| 54 | {{- range $key, $value := .Values.controller.extraArgs }} |
| 55 | {{- /* Accept keys without values or with false as value */}} |
| 56 | {{- if eq ($value | quote | len) 2 }} |
| 57 | - --{{ $key }} |
| 58 | {{- else }} |
| 59 | - --{{ $key }}={{ $value }} |
| 60 | {{- end }} |
| 61 | {{- end }} |
| 62 | {{- end -}} |