Skip to content

Commit 4bd97d6

Browse files
authored
Add forward proxy support to mgmt config (#7560)
1 parent 04c5d4d commit 4bd97d6

22 files changed

+2851
-2
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
VER = $(shell grep IC_VERSION .github/data/version.txt | cut -d '=' -f 2)
33
GIT_TAG = $(shell git describe --exact-match --tags || echo untagged)
44
VERSION = $(VER)-SNAPSHOT
5-
NGINX_PLUS_VERSION ?= R34
5+
NGINX_PLUS_VERSION ?= R34
66
PLUS_ARGS = --build-arg NGINX_PLUS_VERSION=$(NGINX_PLUS_VERSION) --secret id=nginx-repo.crt,src=nginx-repo.crt --secret id=nginx-repo.key,src=nginx-repo.key
77

88
# Variables that can be overridden

charts/nginx-ingress/templates/controller-configmap.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ data:
5858
{{- if hasKey .Values.controller.mgmt.usageReport "interval" }}
5959
usage-report-interval: {{ quote .Values.controller.mgmt.usageReport.interval }}
6060
{{- end }}
61+
{{- if hasKey .Values.controller.mgmt.usageReport "proxyHost" }}
62+
usage-report-proxy-host: {{ quote .Values.controller.mgmt.usageReport.proxyHost }}
63+
{{- end }}
6164
{{- end }}
6265
{{- if hasKey .Values.controller.mgmt "sslTrustedCertificateSecretName" }}
6366
ssl-trusted-certificate-secret-name: {{ quote .Values.controller.mgmt.sslTrustedCertificateSecretName }}

charts/nginx-ingress/templates/controller-daemonset.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,23 @@ spec:
126126
valueFrom:
127127
fieldRef:
128128
fieldPath: spec.serviceAccountName
129+
{{- end }}
130+
{{- if hasKey .Values.controller.mgmt "usageReport" -}}
131+
{{- if hasKey .Values.controller.mgmt.usageReport "proxyCredentialsSecretName" }}
132+
{{- if not (hasKey .Values.controller.mgmt.usageReport "proxyHost") -}}
133+
{{- fail "Error: 'controller.mgmt.usageReport.proxyHost' must be set when using 'controller.mgmt.usageReport.proxyCredentialsSecretName'." }}
134+
{{- end }}
135+
- name: PROXY_USER
136+
valueFrom:
137+
secretKeyRef:
138+
name: {{ .Values.controller.mgmt.usageReport.proxyCredentialsSecretName }}
139+
key: username
140+
- name: PROXY_PASS
141+
valueFrom:
142+
secretKeyRef:
143+
name: {{ .Values.controller.mgmt.usageReport.proxyCredentialsSecretName }}
144+
key: password
145+
{{- end }}
129146
{{- end }}
130147
resources:
131148
{{ toYaml .Values.controller.resources | indent 10 }}

charts/nginx-ingress/templates/controller-deployment.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,23 @@ spec:
135135
valueFrom:
136136
fieldRef:
137137
fieldPath: spec.serviceAccountName
138+
{{- end }}
139+
{{- if hasKey .Values.controller.mgmt "usageReport" -}}
140+
{{- if hasKey .Values.controller.mgmt.usageReport "proxyCredentialsSecretName" }}
141+
{{- if not (hasKey .Values.controller.mgmt.usageReport "proxyHost") -}}
142+
{{- fail "Error: 'controller.mgmt.usageReport.proxyHost' must be set when using 'controller.mgmt.usageReport.proxyCredentialsSecretName'." }}
143+
{{- end }}
144+
- name: PROXY_USER
145+
valueFrom:
146+
secretKeyRef:
147+
name: {{ .Values.controller.mgmt.usageReport.proxyCredentialsSecretName }}
148+
key: username
149+
- name: PROXY_PASS
150+
valueFrom:
151+
secretKeyRef:
152+
name: {{ .Values.controller.mgmt.usageReport.proxyCredentialsSecretName }}
153+
key: password
154+
{{- end }}
138155
{{- end }}
139156
args:
140157
{{- include "nginx-ingress.args" . | nindent 10 }}

charts/nginx-ingress/values.schema.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,29 @@
142142
"1h",
143143
"24h"
144144
]
145+
},
146+
"proxyHost": {
147+
"type": "string",
148+
"title": "The proxy hostname with optional port",
149+
"default": "",
150+
"examples": [
151+
"proxy.example.com",
152+
"proxy.local",
153+
"proxy",
154+
"192.168.1.254",
155+
"proxy.example.com:3128",
156+
"proxy.local:3128",
157+
"proxy:3128",
158+
"192.168.1.254:3128"
159+
]
160+
},
161+
"proxyCredentialsSecretName": {
162+
"type": "string",
163+
"default": "",
164+
"title": "The secret containing the proxy username/password combination. Must contain a `username` and `password` field",
165+
"examples": [
166+
"proxy-credentials"
167+
]
145168
}
146169
}
147170
},

charts/nginx-ingress/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ controller:
2525
# usageReport:
2626
# endpoint: "product.connect.nginx.com" # Endpoint for usage report
2727
# interval: 1h
28+
# proxyHost: "proxy.example.com:3138" # Proxy server for usage report, with optional port
29+
# proxyCredentialsSecretName: "proxy-credentials" # Secret containing proxy credentials, must contain a `username` and `password` field
2830

2931
## Configures the ssl_verify directive in the mgmt block
3032
# sslVerify: true

0 commit comments

Comments
 (0)