diff --git a/charts/nginx-ingress/templates/_helpers.tpl b/charts/nginx-ingress/templates/_helpers.tpl index 12b8aa70e..79ae0ce4d 100644 --- a/charts/nginx-ingress/templates/_helpers.tpl +++ b/charts/nginx-ingress/templates/_helpers.tpl @@ -291,6 +291,10 @@ Build the args for the service binary. - -default-https-listener-port={{ .Values.controller.defaultHTTPSListenerPort}} {{- if .Values.controller.globalConfiguration.create }} - -global-configuration=$(POD_NAMESPACE)/{{ include "nginx-ingress.controller.fullname" . }} +{{- else }} +{{- if .Values.controller.globalConfigurationCustomName }} +- -global-configuration={{ .Values.controller.globalConfigurationCustomName }} +{{- end }} {{- end }} {{- end }} - -ready-status={{ .Values.controller.readyStatus.enable }} diff --git a/charts/nginx-ingress/values.schema.json b/charts/nginx-ingress/values.schema.json index 0440ae6d5..f3bdacde9 100644 --- a/charts/nginx-ingress/values.schema.json +++ b/charts/nginx-ingress/values.schema.json @@ -1042,6 +1042,14 @@ } ] }, + "globalConfigurationCustomName": { + "type": "string", + "default": "", + "title": "The globalConfigurationCustomName", + "examples": [ + "the-namespace/the-name-of-the-global-configuration-custom-resource" + ] + }, "enableSnippets": { "type": "boolean", "default": false, diff --git a/charts/nginx-ingress/values.yaml b/charts/nginx-ingress/values.yaml index 6ed8f0e21..3638a05f8 100644 --- a/charts/nginx-ingress/values.yaml +++ b/charts/nginx-ingress/values.yaml @@ -372,6 +372,9 @@ controller: # port: 5353 # protocol: TCP + ## globalConfigurationCustomName: "the-namespace/the-name-of-the-global-configuration-custom-resource" + ## The name of the GlobalConfiguration custom resource to use instead of the one provided by default when controller.globalConfiguration.create is set to false. + ## Enable custom NGINX configuration snippets in Ingress, VirtualServer, VirtualServerRoute and TransportServer resources. enableSnippets: false