From a6a9f66c1318efce88f10b625ab6339e25cc6cfc Mon Sep 17 00:00:00 2001 From: Dean Coakley Date: Fri, 21 Jun 2019 17:32:29 +0100 Subject: [PATCH] Add log level support to helm chart * Fix typo in cmd/nginx-ingress/main.go cresting->creating --- cmd/nginx-ingress/main.go | 6 +++--- deployments/helm-chart/README.md | 1 + deployments/helm-chart/templates/controller-daemonset.yaml | 1 + deployments/helm-chart/templates/controller-deployment.yaml | 1 + deployments/helm-chart/values.yaml | 3 +++ 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/cmd/nginx-ingress/main.go b/cmd/nginx-ingress/main.go index e42d0ca78a..5c65d127cd 100644 --- a/cmd/nginx-ingress/main.go +++ b/cmd/nginx-ingress/main.go @@ -110,8 +110,8 @@ The external address of the service is used when reporting the status of Ingress "Enable debugging for NGINX. Uses the nginx-debug binary. Requires 'error-log-level: debug' in the ConfigMap.") wildcardTLSSecret = flag.String("wildcard-tls-secret", "", - `A Secret with a TLS certificate and key for TLS termination of every Ingress host for which TLS termination is enabled but the Secret is not specified. - Format: /. If the argument is not set, for such Ingress hosts NGINX will break any attempt to establish a TLS connection. + `A Secret with a TLS certificate and key for TLS termination of every Ingress host for which TLS termination is enabled but the Secret is not specified. + Format: /. If the argument is not set, for such Ingress hosts NGINX will break any attempt to establish a TLS connection. If the argument is set, but the Ingress controller is not able to fetch the Secret from Kubernetes API, the Ingress controller will fail to start.`) enablePrometheusMetrics = flag.Bool("enable-prometheus-metrics", false, @@ -222,7 +222,7 @@ func main() { templateExecutorV2, err := version2.NewTemplateExecutor(nginxVirtualServerTemplatePath) if err != nil { - glog.Fatalf("Error cresting TemplateExecutorV2: %v", err) + glog.Fatalf("Error creating TemplateExecutorV2: %v", err) } var registry *prometheus.Registry diff --git a/deployments/helm-chart/README.md b/deployments/helm-chart/README.md index 23d91dff44..5bc6d39012 100644 --- a/deployments/helm-chart/README.md +++ b/deployments/helm-chart/README.md @@ -62,6 +62,7 @@ Parameter | Description | Default `controller.nginxplus` | Deploys the Ingress controller for NGINX Plus. | false `controller.hostNetwork` | Enables the Ingress controller pods to use the host's network namespace. | false `controller.nginxDebug` | Enables debugging for NGINX. Uses the `nginx-debug` binary. Requires `error-log-level: debug` in the ConfigMap via `controller.config.entries`. | false +`controller.logLevel` | The log level of the Ingress Controller. | 1 `controller.image.repository` | The image repository of the Ingress controller. | nginx/nginx-ingress `controller.image.tag` | The tag of the Ingress controller image. | edge `controller.image.pullPolicy` | The pull policy for the Ingress controller image. | IfNotPresent diff --git a/deployments/helm-chart/templates/controller-daemonset.yaml b/deployments/helm-chart/templates/controller-daemonset.yaml index cba7e6be25..e1a2dec13c 100644 --- a/deployments/helm-chart/templates/controller-daemonset.yaml +++ b/deployments/helm-chart/templates/controller-daemonset.yaml @@ -82,6 +82,7 @@ spec: {{- end }} - -health-status={{ .Values.controller.healthStatus }} - -nginx-debug={{ .Values.controller.nginxDebug }} + - -v={{ .Values.controller.logLevel }} - -nginx-status={{ .Values.controller.nginxStatus.enable }} {{- if .Values.controller.nginxStatus.enable }} - -nginx-status-port={{ .Values.controller.nginxStatus.port }} diff --git a/deployments/helm-chart/templates/controller-deployment.yaml b/deployments/helm-chart/templates/controller-deployment.yaml index 761dde48b9..fe3e99660a 100644 --- a/deployments/helm-chart/templates/controller-deployment.yaml +++ b/deployments/helm-chart/templates/controller-deployment.yaml @@ -80,6 +80,7 @@ spec: {{- end }} - -health-status={{ .Values.controller.healthStatus }} - -nginx-debug={{ .Values.controller.nginxDebug }} + - -v={{ .Values.controller.logLevel }} - -nginx-status={{ .Values.controller.nginxStatus.enable }} {{- if .Values.controller.nginxStatus.enable }} - -nginx-status-port={{ .Values.controller.nginxStatus.port }} diff --git a/deployments/helm-chart/values.yaml b/deployments/helm-chart/values.yaml index 1664c69e58..d04953074e 100644 --- a/deployments/helm-chart/values.yaml +++ b/deployments/helm-chart/values.yaml @@ -15,6 +15,9 @@ controller: ## Enables debugging for NGINX. Uses the nginx-debug binary. Requires error-log-level: debug in the ConfigMap via `controller.config.entries`. nginxDebug: false + ## The log level of the Ingress Controller. + logLevel: 1 + ## A list of custom ports to expose on the NGINX ingress controller pod. Follows the conventional Kubernetes yaml syntax for container ports. customPorts: []