Skip to content

Commit 57fe401

Browse files
committed
Add nginx status parameters to helm chart
Add controller.nginxStatus.enable and controller.nginxStatus.port parameters to the Helm chart, which control -nginx-status and -nginx-status-port Ingress Controller cli arguments.
1 parent d9ac543 commit 57fe401

File tree

6 files changed

+24
-8
lines changed

6 files changed

+24
-8
lines changed

deployments/helm-chart/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: nginx-ingress
2-
version: 0.1.2
2+
version: 0.1.3
33
appVersion: edge
44
description: NGINX Ingress Controller
55
sources:

deployments/helm-chart/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,13 @@ Parameter | Description | Default
8181
`controller.useIngressClassOnly` | Ignore Ingress resources without the `"kubernetes.io/ingress.class"` annotation. | false
8282
`controller.watchNamespace` | Namespace to watch for Ingress resources. By default the Ingress controller watches all namespaces. | ""
8383
`controller.healthStatus` | Add a location "/nginx-health" to the default server. The location responds with the 200 status code for any request. Useful for external health-checking of the Ingress controller. | false
84+
`controller.nginxStatus.enable` | Enable the NGINX stub_status, or the NGINX Plus API. | true
85+
`controller.nginxStatus.port` | Set the port where the NGINX stub_status or the NGINX Plus API is exposed. | 8080
8486
`controller.reportIngressStatus.enable` | Update the address field in the status of Ingresses resources with an external address of the Ingress controller. You must also specify the source of the external address either through an external service via `controller.reportIngressStatus.externalService` or the `external-status-address` entry in the ConfigMap via `controller.config.entries`. **Note:** `controller.config.entries.external-status-address` takes precedence if both are set. | true
8587
`controller.reportIngressStatus.externalService` | Specifies the name of the service with the type LoadBalancer through which the Ingress controller is exposed externally. The external address of the service is used when reporting the status of Ingress resources. `controller.reportIngressStatus.enable` must be set to `true`. | nginx-ingress
8688
`controller.reportIngressStatus.enableLeaderElection` | Enable Leader election to avoid multiple replicas of the controller reporting the status of Ingress resources. `controller.reportIngressStatus.enable` must be set to `true`. | true
8789
`rbac.create` | Configures RBAC. | true
88-
`prometheues.create` | Deploys a Prometheus exporter container within the Ingress controller pod. | false
90+
`prometheues.create` | Deploys a Prometheus exporter container within the Ingress controller pod. Requires NGINX status enabled via `controller.nginxStatus.enable`. Note: the exporter will use the port specified by `controller.nginxStatus.port`.| false
8991
`prometheus.port` | Configures the port to scrape the metrics. | 9113
9092
`prometheus.image.repository` | The image repository of the Prometheus exporter. | nginx/nginx-prometheus-exporter
9193
`prometheus.image.tag` | The tag of the Prometheus exporter image. | 0.1.0

deployments/helm-chart/templates/controller-daemonset.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ spec:
8383
{{- if .Values.controller.healthStatus }}
8484
- -health-status
8585
{{- end }}
86+
{{- if .Values.controller.nginxStatus }}
87+
- -nginx-status={{ .Values.controller.nginxStatus.enable }}
88+
- -nginx-status-port={{ .Values.controller.nginxStatus.port }}
89+
{{- end }}
8690
{{- if .Values.controller.reportIngressStatus.enable }}
8791
- -report-ingress-status
8892
{{- if .Values.controller.reportIngressStatus.externalService }}
@@ -92,7 +96,7 @@ spec:
9296
- -enable-leader-election
9397
{{- end }}
9498
{{- end }}
95-
{{- if .Values.prometheus }}
99+
{{- if and .Values.prometheus .Values.controller.nginxStatus }}
96100
{{- if .Values.prometheus.create }}
97101
- image: "{{ .Values.prometheus.image.repository }}:{{ .Values.prometheus.image.tag }}"
98102
imagePullPolicy: "{{ .Values.prometheus.image.pullPolicy }}"
@@ -108,9 +112,9 @@ spec:
108112
{{- end }}
109113
- -nginx.scrape-uri
110114
{{- if .Values.controller.nginxplus }}
111-
- http://127.0.0.1:8080/api
115+
- http://127.0.0.1:{{ .Values.controller.nginxStatus.port }}/api
112116
{{ else }}
113-
- http://127.0.0.1:8080/stub_status
117+
- http://127.0.0.1:{{ .Values.controller.nginxStatus.port }}/stub_status
114118
{{- end }}
115119
{{- end }}
116120
{{- end }}

deployments/helm-chart/templates/controller-deployment.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ spec:
6969
{{- if .Values.controller.healthStatus }}
7070
- -health-status
7171
{{- end }}
72+
{{- if .Values.controller.nginxStatus }}
73+
- -nginx-status={{ .Values.controller.nginxStatus.enable }}
74+
- -nginx-status-port={{ .Values.controller.nginxStatus.port }}
75+
{{- end }}
7276
{{- if .Values.controller.reportIngressStatus.enable }}
7377
- -report-ingress-status
7478
{{- if .Values.controller.reportIngressStatus.externalService }}
@@ -78,7 +82,7 @@ spec:
7882
- -enable-leader-election
7983
{{- end }}
8084
{{- end }}
81-
{{- if .Values.prometheus }}
85+
{{- if and .Values.prometheus .Values.controller.nginxStatus }}
8286
{{- if .Values.prometheus.create }}
8387
- image: "{{ .Values.prometheus.image.repository }}:{{ .Values.prometheus.image.tag }}"
8488
name: nginx-prometheus-exporter
@@ -94,9 +98,9 @@ spec:
9498
{{- end }}
9599
- -nginx.scrape-uri
96100
{{- if .Values.controller.nginxplus }}
97-
- http://127.0.0.1:8080/api
101+
- http://127.0.0.1:{{ .Values.controller.nginxStatus.port }}/api
98102
{{ else }}
99-
- http://127.0.0.1:8080/stub_status
103+
- http://127.0.0.1:{{ .Values.controller.nginxStatus.port }}/stub_status
100104
{{- end }}
101105
{{- end }}
102106
{{- end }}

deployments/helm-chart/values-plus.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ controller:
2222
useIngressClassOnly: false
2323
watchNamespace: ""
2424
healthStatus: false
25+
nginxStatus:
26+
enable: true
27+
port: 8080
2528
service:
2629
create: true
2730
type: LoadBalancer

deployments/helm-chart/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ controller:
2222
useIngressClassOnly: false
2323
watchNamespace: ""
2424
healthStatus: false
25+
nginxStatus:
26+
enable: true
27+
port: 8080
2528
service:
2629
create: true
2730
type: LoadBalancer

0 commit comments

Comments
 (0)