From 986971e764b3fb9bfe2ee1dee310f6a053f99bf6 Mon Sep 17 00:00:00 2001 From: Benjamin Jee Date: Wed, 19 Feb 2025 10:38:55 -0800 Subject: [PATCH 1/5] Add support for nginx debug mode in CP/DP split --- apis/v1alpha2/nginxproxy_types.go | 6 ++++++ apis/v1alpha2/zz_generated.deepcopy.go | 5 +++++ charts/nginx-gateway-fabric/templates/nginxproxy.yaml | 1 + config/crd/bases/gateway.nginx.org_nginxproxies.yaml | 5 +++++ deploy/aws-nlb/deploy.yaml | 1 + deploy/azure/deploy.yaml | 1 + deploy/crds.yaml | 5 +++++ deploy/default/deploy.yaml | 1 + deploy/experimental-nginx-plus/deploy.yaml | 1 + deploy/experimental/deploy.yaml | 1 + deploy/nginx-plus/deploy.yaml | 1 + deploy/nodeport/deploy.yaml | 1 + deploy/openshift/deploy.yaml | 1 + deploy/snippets-filters-nginx-plus/deploy.yaml | 1 + deploy/snippets-filters/deploy.yaml | 1 + internal/mode/static/provisioner/objects.go | 6 ++++++ internal/mode/static/state/graph/nginxproxy_test.go | 10 ++++++++++ 17 files changed, 48 insertions(+) diff --git a/apis/v1alpha2/nginxproxy_types.go b/apis/v1alpha2/nginxproxy_types.go index 8f8a2671e8..02deb19e24 100644 --- a/apis/v1alpha2/nginxproxy_types.go +++ b/apis/v1alpha2/nginxproxy_types.go @@ -435,6 +435,12 @@ type PodSpec struct { // ContainerSpec defines container fields for the NGINX container. type ContainerSpec struct { + // Debug enables debugging for NGINX by using the nginx-debug binary. + // + // +optional + // +kubebuilder:default=false + Debug *bool `json:"debug,omitempty"` + // Image is the NGINX image to use. // // +optional diff --git a/apis/v1alpha2/zz_generated.deepcopy.go b/apis/v1alpha2/zz_generated.deepcopy.go index c6420fc2f2..54e5c760b2 100644 --- a/apis/v1alpha2/zz_generated.deepcopy.go +++ b/apis/v1alpha2/zz_generated.deepcopy.go @@ -14,6 +14,11 @@ import ( // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ContainerSpec) DeepCopyInto(out *ContainerSpec) { *out = *in + if in.Debug != nil { + in, out := &in.Debug, &out.Debug + *out = new(bool) + **out = **in + } if in.Image != nil { in, out := &in.Image, &out.Image *out = new(Image) diff --git a/charts/nginx-gateway-fabric/templates/nginxproxy.yaml b/charts/nginx-gateway-fabric/templates/nginxproxy.yaml index 1dd6f44155..9ae2280a28 100644 --- a/charts/nginx-gateway-fabric/templates/nginxproxy.yaml +++ b/charts/nginx-gateway-fabric/templates/nginxproxy.yaml @@ -23,6 +23,7 @@ spec: {{- end }} image: {{- toYaml .Values.nginx.image | nindent 10 }} + debug: {{ .Values.nginx.debug }} {{- end }} {{- if .Values.nginx.service }} service: diff --git a/config/crd/bases/gateway.nginx.org_nginxproxies.yaml b/config/crd/bases/gateway.nginx.org_nginxproxies.yaml index a86fcf723e..47e7d24322 100644 --- a/config/crd/bases/gateway.nginx.org_nginxproxies.yaml +++ b/config/crd/bases/gateway.nginx.org_nginxproxies.yaml @@ -79,6 +79,11 @@ spec: description: Container defines container fields for the NGINX container. properties: + debug: + default: false + description: Debug enables debugging for NGINX by using + the nginx-debug binary. + type: boolean image: description: Image is the NGINX image to use. properties: diff --git a/deploy/aws-nlb/deploy.yaml b/deploy/aws-nlb/deploy.yaml index d49067708b..aec2cfefaf 100644 --- a/deploy/aws-nlb/deploy.yaml +++ b/deploy/aws-nlb/deploy.yaml @@ -301,6 +301,7 @@ spec: kubernetes: deployment: container: + debug: false image: pullPolicy: Always repository: ghcr.io/nginx/nginx-gateway-fabric/nginx diff --git a/deploy/azure/deploy.yaml b/deploy/azure/deploy.yaml index e7d0ef976d..e8f2255240 100644 --- a/deploy/azure/deploy.yaml +++ b/deploy/azure/deploy.yaml @@ -303,6 +303,7 @@ spec: kubernetes: deployment: container: + debug: false image: pullPolicy: Always repository: ghcr.io/nginx/nginx-gateway-fabric/nginx diff --git a/deploy/crds.yaml b/deploy/crds.yaml index cc4ad633b3..c7d257349b 100644 --- a/deploy/crds.yaml +++ b/deploy/crds.yaml @@ -664,6 +664,11 @@ spec: description: Container defines container fields for the NGINX container. properties: + debug: + default: false + description: Debug enables debugging for NGINX by using + the nginx-debug binary. + type: boolean image: description: Image is the NGINX image to use. properties: diff --git a/deploy/default/deploy.yaml b/deploy/default/deploy.yaml index 42cc36de4a..d1905fafce 100644 --- a/deploy/default/deploy.yaml +++ b/deploy/default/deploy.yaml @@ -301,6 +301,7 @@ spec: kubernetes: deployment: container: + debug: false image: pullPolicy: Always repository: ghcr.io/nginx/nginx-gateway-fabric/nginx diff --git a/deploy/experimental-nginx-plus/deploy.yaml b/deploy/experimental-nginx-plus/deploy.yaml index 88f5e771cd..0f627deac4 100644 --- a/deploy/experimental-nginx-plus/deploy.yaml +++ b/deploy/experimental-nginx-plus/deploy.yaml @@ -308,6 +308,7 @@ spec: kubernetes: deployment: container: + debug: false image: pullPolicy: Always repository: private-registry.nginx.com/nginx-gateway-fabric/nginx-plus diff --git a/deploy/experimental/deploy.yaml b/deploy/experimental/deploy.yaml index 15311817cc..5ab61dda00 100644 --- a/deploy/experimental/deploy.yaml +++ b/deploy/experimental/deploy.yaml @@ -306,6 +306,7 @@ spec: kubernetes: deployment: container: + debug: false image: pullPolicy: Always repository: ghcr.io/nginx/nginx-gateway-fabric/nginx diff --git a/deploy/nginx-plus/deploy.yaml b/deploy/nginx-plus/deploy.yaml index ca6be2dd91..888f9986f3 100644 --- a/deploy/nginx-plus/deploy.yaml +++ b/deploy/nginx-plus/deploy.yaml @@ -303,6 +303,7 @@ spec: kubernetes: deployment: container: + debug: false image: pullPolicy: Always repository: private-registry.nginx.com/nginx-gateway-fabric/nginx-plus diff --git a/deploy/nodeport/deploy.yaml b/deploy/nodeport/deploy.yaml index fa29623d9a..ea18145688 100644 --- a/deploy/nodeport/deploy.yaml +++ b/deploy/nodeport/deploy.yaml @@ -301,6 +301,7 @@ spec: kubernetes: deployment: container: + debug: false image: pullPolicy: Always repository: ghcr.io/nginx/nginx-gateway-fabric/nginx diff --git a/deploy/openshift/deploy.yaml b/deploy/openshift/deploy.yaml index e2701bf885..9c293c508a 100644 --- a/deploy/openshift/deploy.yaml +++ b/deploy/openshift/deploy.yaml @@ -311,6 +311,7 @@ spec: kubernetes: deployment: container: + debug: false image: pullPolicy: Always repository: ghcr.io/nginx/nginx-gateway-fabric/nginx diff --git a/deploy/snippets-filters-nginx-plus/deploy.yaml b/deploy/snippets-filters-nginx-plus/deploy.yaml index f452442bef..c461724970 100644 --- a/deploy/snippets-filters-nginx-plus/deploy.yaml +++ b/deploy/snippets-filters-nginx-plus/deploy.yaml @@ -306,6 +306,7 @@ spec: kubernetes: deployment: container: + debug: false image: pullPolicy: Always repository: private-registry.nginx.com/nginx-gateway-fabric/nginx-plus diff --git a/deploy/snippets-filters/deploy.yaml b/deploy/snippets-filters/deploy.yaml index dfe78332b5..98b6096c92 100644 --- a/deploy/snippets-filters/deploy.yaml +++ b/deploy/snippets-filters/deploy.yaml @@ -304,6 +304,7 @@ spec: kubernetes: deployment: container: + debug: false image: pullPolicy: Always repository: ghcr.io/nginx/nginx-gateway-fabric/nginx diff --git a/internal/mode/static/provisioner/objects.go b/internal/mode/static/provisioner/objects.go index 19a24cb832..714e83db8d 100644 --- a/internal/mode/static/provisioner/objects.go +++ b/internal/mode/static/provisioner/objects.go @@ -447,6 +447,12 @@ func (p *NginxProvisioner) buildNginxPodTemplateSpec( } container.Lifecycle = containerSpec.Lifecycle container.VolumeMounts = append(container.VolumeMounts, containerSpec.VolumeMounts...) + + // ensure that this "effectiveNginxProxy" works + if containerSpec.Debug != nil && *containerSpec.Debug { + container.Command = append(container.Command, "/bin/sh") + container.Args = append(container.Args, "-c", "rm -rf /var/run/nginx/*sock && nginx-debug -g 'daemon off;'") + } spec.Spec.Containers[0] = container } } diff --git a/internal/mode/static/state/graph/nginxproxy_test.go b/internal/mode/static/state/graph/nginxproxy_test.go index 2289bb7dab..bf074ab562 100644 --- a/internal/mode/static/state/graph/nginxproxy_test.go +++ b/internal/mode/static/state/graph/nginxproxy_test.go @@ -55,6 +55,7 @@ func TestBuildEffectiveNginxProxy(t *testing.T) { logLevel ngfAPIv1alpha2.NginxErrorLogLevel, setIP bool, disableHTTP bool, + nginxDebug bool, ) *ngfAPIv1alpha2.NginxProxy { return &ngfAPIv1alpha2.NginxProxy{ Spec: ngfAPIv1alpha2.NginxProxySpec{ @@ -79,6 +80,13 @@ func TestBuildEffectiveNginxProxy(t *testing.T) { ErrorLevel: &logLevel, }, DisableHTTP2: &disableHTTP, + Kubernetes: &ngfAPIv1alpha2.KubernetesSpec{ + Deployment: &ngfAPIv1alpha2.DeploymentSpec{ + Container: ngfAPIv1alpha2.ContainerSpec{ + Debug: &nginxDebug, + }, + }, + }, }, } } @@ -100,6 +108,7 @@ func TestBuildEffectiveNginxProxy(t *testing.T) { ngfAPIv1alpha2.NginxLogLevelAlert, true, false, + false, ) } @@ -120,6 +129,7 @@ func TestBuildEffectiveNginxProxy(t *testing.T) { ngfAPIv1alpha2.NginxLogLevelError, false, true, + true, ) } From 472374d95f3f76e62047b067317f2bcbb0c69e71 Mon Sep 17 00:00:00 2001 From: Benjamin Jee Date: Wed, 19 Feb 2025 11:46:39 -0800 Subject: [PATCH 2/5] Remove comment --- internal/mode/static/provisioner/objects.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/mode/static/provisioner/objects.go b/internal/mode/static/provisioner/objects.go index 714e83db8d..a4fb38b35f 100644 --- a/internal/mode/static/provisioner/objects.go +++ b/internal/mode/static/provisioner/objects.go @@ -448,7 +448,6 @@ func (p *NginxProvisioner) buildNginxPodTemplateSpec( container.Lifecycle = containerSpec.Lifecycle container.VolumeMounts = append(container.VolumeMounts, containerSpec.VolumeMounts...) - // ensure that this "effectiveNginxProxy" works if containerSpec.Debug != nil && *containerSpec.Debug { container.Command = append(container.Command, "/bin/sh") container.Args = append(container.Args, "-c", "rm -rf /var/run/nginx/*sock && nginx-debug -g 'daemon off;'") From 8dedb6e323269201eb143a07ba62851714c597fb Mon Sep 17 00:00:00 2001 From: Benjamin Jee Date: Wed, 19 Feb 2025 15:00:29 -0800 Subject: [PATCH 3/5] Remove default debug value and change container command --- apis/v1alpha2/nginxproxy_types.go | 1 - build/entrypoint.sh | 10 ++++++++-- config/crd/bases/gateway.nginx.org_nginxproxies.yaml | 1 - deploy/crds.yaml | 1 - internal/mode/static/provisioner/objects.go | 4 ++-- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/apis/v1alpha2/nginxproxy_types.go b/apis/v1alpha2/nginxproxy_types.go index 02deb19e24..bfa21aca59 100644 --- a/apis/v1alpha2/nginxproxy_types.go +++ b/apis/v1alpha2/nginxproxy_types.go @@ -438,7 +438,6 @@ type ContainerSpec struct { // Debug enables debugging for NGINX by using the nginx-debug binary. // // +optional - // +kubebuilder:default=false Debug *bool `json:"debug,omitempty"` // Image is the NGINX image to use. diff --git a/build/entrypoint.sh b/build/entrypoint.sh index 1095831c57..4ccd6be3a2 100755 --- a/build/entrypoint.sh +++ b/build/entrypoint.sh @@ -16,7 +16,13 @@ rm -rf /var/run/nginx/*.sock # Launch nginx echo "starting nginx ..." -/usr/sbin/nginx -g "daemon off;" & + +# if we want to use the nginx-debug binary, we will call this script with an argument "debug" +if [ "${1:-false}" = "debug" ]; then + /usr/sbin/nginx-debug -g "daemon off;" & +else + /usr/sbin/nginx -g "daemon off;" & +fi nginx_pid=$! @@ -31,7 +37,7 @@ done # start nginx-agent, pass args echo "starting nginx-agent ..." -nginx-agent "$@" & +nginx-agent & agent_pid=$! diff --git a/config/crd/bases/gateway.nginx.org_nginxproxies.yaml b/config/crd/bases/gateway.nginx.org_nginxproxies.yaml index 47e7d24322..6593274424 100644 --- a/config/crd/bases/gateway.nginx.org_nginxproxies.yaml +++ b/config/crd/bases/gateway.nginx.org_nginxproxies.yaml @@ -80,7 +80,6 @@ spec: container. properties: debug: - default: false description: Debug enables debugging for NGINX by using the nginx-debug binary. type: boolean diff --git a/deploy/crds.yaml b/deploy/crds.yaml index c7d257349b..08d58ad387 100644 --- a/deploy/crds.yaml +++ b/deploy/crds.yaml @@ -665,7 +665,6 @@ spec: container. properties: debug: - default: false description: Debug enables debugging for NGINX by using the nginx-debug binary. type: boolean diff --git a/internal/mode/static/provisioner/objects.go b/internal/mode/static/provisioner/objects.go index a4fb38b35f..6c3c6b5c01 100644 --- a/internal/mode/static/provisioner/objects.go +++ b/internal/mode/static/provisioner/objects.go @@ -449,8 +449,8 @@ func (p *NginxProvisioner) buildNginxPodTemplateSpec( container.VolumeMounts = append(container.VolumeMounts, containerSpec.VolumeMounts...) if containerSpec.Debug != nil && *containerSpec.Debug { - container.Command = append(container.Command, "/bin/sh") - container.Args = append(container.Args, "-c", "rm -rf /var/run/nginx/*sock && nginx-debug -g 'daemon off;'") + container.Command = append(container.Command, "/agent/entrypoint.sh") + container.Args = append(container.Args, "debug") } spec.Spec.Containers[0] = container } From 85f2d98df04ad7da0e12fb9b465f0458bbfa901a Mon Sep 17 00:00:00 2001 From: Benjamin Jee Date: Wed, 19 Feb 2025 15:38:25 -0800 Subject: [PATCH 4/5] Fully remove default debug value --- charts/nginx-gateway-fabric/README.md | 3 +-- charts/nginx-gateway-fabric/templates/nginxproxy.yaml | 2 ++ charts/nginx-gateway-fabric/values.schema.json | 7 ------- charts/nginx-gateway-fabric/values.yaml | 2 +- deploy/aws-nlb/deploy.yaml | 1 - deploy/azure/deploy.yaml | 1 - deploy/default/deploy.yaml | 1 - deploy/experimental-nginx-plus/deploy.yaml | 1 - deploy/experimental/deploy.yaml | 1 - deploy/nginx-plus/deploy.yaml | 1 - deploy/nodeport/deploy.yaml | 1 - deploy/openshift/deploy.yaml | 1 - deploy/snippets-filters-nginx-plus/deploy.yaml | 1 - deploy/snippets-filters/deploy.yaml | 1 - 14 files changed, 4 insertions(+), 20 deletions(-) diff --git a/charts/nginx-gateway-fabric/README.md b/charts/nginx-gateway-fabric/README.md index 142c5eee65..d18df97de2 100644 --- a/charts/nginx-gateway-fabric/README.md +++ b/charts/nginx-gateway-fabric/README.md @@ -258,10 +258,9 @@ The following table lists the configurable parameters of the NGINX Gateway Fabri | Key | Description | Type | Default | |-----|-------------|------|---------| -| `nginx` | The nginx section contains the configuration for all NGINX data plane deployments installed by the NGINX Gateway Fabric control plane. | object | `{"config":{},"container":{},"debug":false,"image":{"pullPolicy":"Always","repository":"ghcr.io/nginx/nginx-gateway-fabric/nginx","tag":"edge"},"imagePullSecret":"","imagePullSecrets":[],"kind":"deployment","plus":false,"pod":{},"replicas":1,"service":{"externalTrafficPolicy":"Local","type":"LoadBalancer"},"usage":{"caSecretName":"","clientSSLSecretName":"","endpoint":"","resolver":"","secretName":"nplus-license","skipVerify":false}}` | +| `nginx` | The nginx section contains the configuration for all NGINX data plane deployments installed by the NGINX Gateway Fabric control plane. | object | `{"config":{},"container":{},"image":{"pullPolicy":"Always","repository":"ghcr.io/nginx/nginx-gateway-fabric/nginx","tag":"edge"},"imagePullSecret":"","imagePullSecrets":[],"kind":"deployment","plus":false,"pod":{},"replicas":1,"service":{"externalTrafficPolicy":"Local","type":"LoadBalancer"},"usage":{"caSecretName":"","clientSSLSecretName":"","endpoint":"","resolver":"","secretName":"nplus-license","skipVerify":false}}` | | `nginx.config` | The configuration for the data plane that is contained in the NginxProxy resource. | object | `{}` | | `nginx.container` | The container configuration for the NGINX container. | object | `{}` | -| `nginx.debug` | Enable debugging for NGINX. Uses the nginx-debug binary. The NGINX error log level should be set to debug in the NginxProxy resource. | bool | `false` | | `nginx.image.repository` | The NGINX image to use. | string | `"ghcr.io/nginx/nginx-gateway-fabric/nginx"` | | `nginx.imagePullSecret` | The name of the secret containing docker registry credentials. Secret must exist in the same namespace as the helm release. The control plane will copy this secret into any namespace where NGINX is deployed. | string | `""` | | `nginx.imagePullSecrets` | A list of secret names containing docker registry credentials. Secrets must exist in the same namespace as the helm release. The control plane will copy these secrets into any namespace where NGINX is deployed. | list | `[]` | diff --git a/charts/nginx-gateway-fabric/templates/nginxproxy.yaml b/charts/nginx-gateway-fabric/templates/nginxproxy.yaml index 9ae2280a28..f77630fe95 100644 --- a/charts/nginx-gateway-fabric/templates/nginxproxy.yaml +++ b/charts/nginx-gateway-fabric/templates/nginxproxy.yaml @@ -23,7 +23,9 @@ spec: {{- end }} image: {{- toYaml .Values.nginx.image | nindent 10 }} + {{- if .Values.nginx.debug }} debug: {{ .Values.nginx.debug }} + {{- end }} {{- end }} {{- if .Values.nginx.service }} service: diff --git a/charts/nginx-gateway-fabric/values.schema.json b/charts/nginx-gateway-fabric/values.schema.json index fac20c8777..f4f2ec4c43 100644 --- a/charts/nginx-gateway-fabric/values.schema.json +++ b/charts/nginx-gateway-fabric/values.schema.json @@ -229,13 +229,6 @@ "title": "container", "type": "object" }, - "debug": { - "default": false, - "description": "Enable debugging for NGINX. Uses the nginx-debug binary. The NGINX error log level should be set to debug in the NginxProxy resource.", - "required": [], - "title": "debug", - "type": "boolean" - }, "image": { "properties": { "pullPolicy": { diff --git a/charts/nginx-gateway-fabric/values.yaml b/charts/nginx-gateway-fabric/values.yaml index 5289392b38..bb4cf04cb0 100644 --- a/charts/nginx-gateway-fabric/values.yaml +++ b/charts/nginx-gateway-fabric/values.yaml @@ -425,4 +425,4 @@ nginx: # loadBalancerSourceRanges: [] # -- Enable debugging for NGINX. Uses the nginx-debug binary. The NGINX error log level should be set to debug in the NginxProxy resource. - debug: false + # debug: false diff --git a/deploy/aws-nlb/deploy.yaml b/deploy/aws-nlb/deploy.yaml index aec2cfefaf..d49067708b 100644 --- a/deploy/aws-nlb/deploy.yaml +++ b/deploy/aws-nlb/deploy.yaml @@ -301,7 +301,6 @@ spec: kubernetes: deployment: container: - debug: false image: pullPolicy: Always repository: ghcr.io/nginx/nginx-gateway-fabric/nginx diff --git a/deploy/azure/deploy.yaml b/deploy/azure/deploy.yaml index e8f2255240..e7d0ef976d 100644 --- a/deploy/azure/deploy.yaml +++ b/deploy/azure/deploy.yaml @@ -303,7 +303,6 @@ spec: kubernetes: deployment: container: - debug: false image: pullPolicy: Always repository: ghcr.io/nginx/nginx-gateway-fabric/nginx diff --git a/deploy/default/deploy.yaml b/deploy/default/deploy.yaml index d1905fafce..42cc36de4a 100644 --- a/deploy/default/deploy.yaml +++ b/deploy/default/deploy.yaml @@ -301,7 +301,6 @@ spec: kubernetes: deployment: container: - debug: false image: pullPolicy: Always repository: ghcr.io/nginx/nginx-gateway-fabric/nginx diff --git a/deploy/experimental-nginx-plus/deploy.yaml b/deploy/experimental-nginx-plus/deploy.yaml index 0f627deac4..88f5e771cd 100644 --- a/deploy/experimental-nginx-plus/deploy.yaml +++ b/deploy/experimental-nginx-plus/deploy.yaml @@ -308,7 +308,6 @@ spec: kubernetes: deployment: container: - debug: false image: pullPolicy: Always repository: private-registry.nginx.com/nginx-gateway-fabric/nginx-plus diff --git a/deploy/experimental/deploy.yaml b/deploy/experimental/deploy.yaml index 5ab61dda00..15311817cc 100644 --- a/deploy/experimental/deploy.yaml +++ b/deploy/experimental/deploy.yaml @@ -306,7 +306,6 @@ spec: kubernetes: deployment: container: - debug: false image: pullPolicy: Always repository: ghcr.io/nginx/nginx-gateway-fabric/nginx diff --git a/deploy/nginx-plus/deploy.yaml b/deploy/nginx-plus/deploy.yaml index 888f9986f3..ca6be2dd91 100644 --- a/deploy/nginx-plus/deploy.yaml +++ b/deploy/nginx-plus/deploy.yaml @@ -303,7 +303,6 @@ spec: kubernetes: deployment: container: - debug: false image: pullPolicy: Always repository: private-registry.nginx.com/nginx-gateway-fabric/nginx-plus diff --git a/deploy/nodeport/deploy.yaml b/deploy/nodeport/deploy.yaml index ea18145688..fa29623d9a 100644 --- a/deploy/nodeport/deploy.yaml +++ b/deploy/nodeport/deploy.yaml @@ -301,7 +301,6 @@ spec: kubernetes: deployment: container: - debug: false image: pullPolicy: Always repository: ghcr.io/nginx/nginx-gateway-fabric/nginx diff --git a/deploy/openshift/deploy.yaml b/deploy/openshift/deploy.yaml index 9c293c508a..e2701bf885 100644 --- a/deploy/openshift/deploy.yaml +++ b/deploy/openshift/deploy.yaml @@ -311,7 +311,6 @@ spec: kubernetes: deployment: container: - debug: false image: pullPolicy: Always repository: ghcr.io/nginx/nginx-gateway-fabric/nginx diff --git a/deploy/snippets-filters-nginx-plus/deploy.yaml b/deploy/snippets-filters-nginx-plus/deploy.yaml index c461724970..f452442bef 100644 --- a/deploy/snippets-filters-nginx-plus/deploy.yaml +++ b/deploy/snippets-filters-nginx-plus/deploy.yaml @@ -306,7 +306,6 @@ spec: kubernetes: deployment: container: - debug: false image: pullPolicy: Always repository: private-registry.nginx.com/nginx-gateway-fabric/nginx-plus diff --git a/deploy/snippets-filters/deploy.yaml b/deploy/snippets-filters/deploy.yaml index 98b6096c92..dfe78332b5 100644 --- a/deploy/snippets-filters/deploy.yaml +++ b/deploy/snippets-filters/deploy.yaml @@ -304,7 +304,6 @@ spec: kubernetes: deployment: container: - debug: false image: pullPolicy: Always repository: ghcr.io/nginx/nginx-gateway-fabric/nginx From c517dca586ffdc5fdf8781ac99f8c9b352175e87 Mon Sep 17 00:00:00 2001 From: Benjamin Jee Date: Wed, 19 Feb 2025 15:57:52 -0800 Subject: [PATCH 5/5] Add back debug field in values file --- charts/nginx-gateway-fabric/README.md | 3 ++- charts/nginx-gateway-fabric/values.schema.json | 7 +++++++ charts/nginx-gateway-fabric/values.yaml | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/charts/nginx-gateway-fabric/README.md b/charts/nginx-gateway-fabric/README.md index d18df97de2..142c5eee65 100644 --- a/charts/nginx-gateway-fabric/README.md +++ b/charts/nginx-gateway-fabric/README.md @@ -258,9 +258,10 @@ The following table lists the configurable parameters of the NGINX Gateway Fabri | Key | Description | Type | Default | |-----|-------------|------|---------| -| `nginx` | The nginx section contains the configuration for all NGINX data plane deployments installed by the NGINX Gateway Fabric control plane. | object | `{"config":{},"container":{},"image":{"pullPolicy":"Always","repository":"ghcr.io/nginx/nginx-gateway-fabric/nginx","tag":"edge"},"imagePullSecret":"","imagePullSecrets":[],"kind":"deployment","plus":false,"pod":{},"replicas":1,"service":{"externalTrafficPolicy":"Local","type":"LoadBalancer"},"usage":{"caSecretName":"","clientSSLSecretName":"","endpoint":"","resolver":"","secretName":"nplus-license","skipVerify":false}}` | +| `nginx` | The nginx section contains the configuration for all NGINX data plane deployments installed by the NGINX Gateway Fabric control plane. | object | `{"config":{},"container":{},"debug":false,"image":{"pullPolicy":"Always","repository":"ghcr.io/nginx/nginx-gateway-fabric/nginx","tag":"edge"},"imagePullSecret":"","imagePullSecrets":[],"kind":"deployment","plus":false,"pod":{},"replicas":1,"service":{"externalTrafficPolicy":"Local","type":"LoadBalancer"},"usage":{"caSecretName":"","clientSSLSecretName":"","endpoint":"","resolver":"","secretName":"nplus-license","skipVerify":false}}` | | `nginx.config` | The configuration for the data plane that is contained in the NginxProxy resource. | object | `{}` | | `nginx.container` | The container configuration for the NGINX container. | object | `{}` | +| `nginx.debug` | Enable debugging for NGINX. Uses the nginx-debug binary. The NGINX error log level should be set to debug in the NginxProxy resource. | bool | `false` | | `nginx.image.repository` | The NGINX image to use. | string | `"ghcr.io/nginx/nginx-gateway-fabric/nginx"` | | `nginx.imagePullSecret` | The name of the secret containing docker registry credentials. Secret must exist in the same namespace as the helm release. The control plane will copy this secret into any namespace where NGINX is deployed. | string | `""` | | `nginx.imagePullSecrets` | A list of secret names containing docker registry credentials. Secrets must exist in the same namespace as the helm release. The control plane will copy these secrets into any namespace where NGINX is deployed. | list | `[]` | diff --git a/charts/nginx-gateway-fabric/values.schema.json b/charts/nginx-gateway-fabric/values.schema.json index f4f2ec4c43..fac20c8777 100644 --- a/charts/nginx-gateway-fabric/values.schema.json +++ b/charts/nginx-gateway-fabric/values.schema.json @@ -229,6 +229,13 @@ "title": "container", "type": "object" }, + "debug": { + "default": false, + "description": "Enable debugging for NGINX. Uses the nginx-debug binary. The NGINX error log level should be set to debug in the NginxProxy resource.", + "required": [], + "title": "debug", + "type": "boolean" + }, "image": { "properties": { "pullPolicy": { diff --git a/charts/nginx-gateway-fabric/values.yaml b/charts/nginx-gateway-fabric/values.yaml index bb4cf04cb0..5289392b38 100644 --- a/charts/nginx-gateway-fabric/values.yaml +++ b/charts/nginx-gateway-fabric/values.yaml @@ -425,4 +425,4 @@ nginx: # loadBalancerSourceRanges: [] # -- Enable debugging for NGINX. Uses the nginx-debug binary. The NGINX error log level should be set to debug in the NginxProxy resource. - # debug: false + debug: false