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