Skip to content

Commit 99719fe

Browse files
committed
Code review; add validation and helm template
1 parent 0081b2f commit 99719fe

35 files changed

+758
-108
lines changed

charts/nginx-gateway-fabric/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ To uninstall/delete the release `ngf`:
249249
```shell
250250
helm uninstall ngf -n nginx-gateway
251251
kubectl delete ns nginx-gateway
252-
for crd in `kubectl get crds -oname | grep gateway.nginx.org | awk -F / '{ print $2 }'`; do kubectl delete crd $crd; done
252+
kubectl delete crd nginxgateways.gateway.nginx.org nginxproxies.gateway.nginx.org
253253
```
254254

255255
These commands remove all the Kubernetes components associated with the release and deletes the release.
@@ -300,6 +300,7 @@ The following tables lists the configurable parameters of the NGINX Gateway Fabr
300300
| `nginx.image.tag` | The tag for the NGINX image. | edge |
301301
| `nginx.image.pullPolicy` | The `imagePullPolicy` for the NGINX image. | Always |
302302
| `nginx.plus` | Is NGINX Plus image being used | false |
303+
| `nginx.config` | The configuration for the data plane that is contained in the NginxProxy resource. | [See nginx.config section](values.yaml) |
303304
| `nginx.usage.secretName` | The namespace/name of the Secret containing the credentials for NGINX Plus usage reporting. | |
304305
| `nginx.usage.serverURL` | The base server URL of the NGINX Plus usage reporting server. | |
305306
| `nginx.usage.clusterName` | The display name of the Kubernetes cluster in the NGINX Plus usage reporting server. | |

charts/nginx-gateway-fabric/templates/_helpers.tpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ Create control plane config name.
3131
{{- printf "%s-config" $name | trunc 63 | trimSuffix "-" }}
3232
{{- end }}
3333

34+
{{/*
35+
Create data plane config name.
36+
*/}}
37+
{{- define "nginx-gateway.proxy-config-name" -}}
38+
{{- $name := default .Release.Name .Values.nameOverride }}
39+
{{- printf "%s-proxy-config" $name | trunc 63 | trimSuffix "-" }}
40+
{{- end }}
41+
3442
{{/*
3543
Create chart name and version as used by the chart label.
3644
*/}}

charts/nginx-gateway-fabric/templates/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ spec:
119119
- name: nginx-conf
120120
mountPath: /etc/nginx/conf.d
121121
- name: nginx-includes
122-
mountPath: /etc/nginx/includes
122+
mountPath: /etc/nginx/modules-includes
123123
- name: nginx-secrets
124124
mountPath: /etc/nginx/secrets
125125
- name: nginx-run
@@ -152,7 +152,7 @@ spec:
152152
- name: nginx-conf
153153
mountPath: /etc/nginx/conf.d
154154
- name: nginx-includes
155-
mountPath: /etc/nginx/includes
155+
mountPath: /etc/nginx/modules-includes
156156
- name: nginx-secrets
157157
mountPath: /etc/nginx/secrets
158158
- name: nginx-run

charts/nginx-gateway-fabric/templates/gatewayclass.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,9 @@ metadata:
66
{{- include "nginx-gateway.labels" . | nindent 4 }}
77
spec:
88
controllerName: {{ .Values.nginxGateway.gatewayControllerName }}
9+
{{- if .Values.nginx.config }}
10+
parametersRef:
11+
group: gateway.nginx.org
12+
kind: NginxProxy
13+
name: {{ include "nginx-gateway.proxy-config-name" . }}
14+
{{- end }}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{{- if .Values.nginx.config }}
2+
apiVersion: gateway.nginx.org/v1alpha1
3+
kind: NginxProxy
4+
metadata:
5+
name: {{ include "nginx-gateway.proxy-config-name" . }}
6+
labels:
7+
{{- include "nginx-gateway.labels" . | nindent 4 }}
8+
spec:
9+
{{- toYaml .Values.nginx.config | nindent 2 }}
10+
{{- end }}

charts/nginx-gateway-fabric/templates/rbac.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,17 @@ rules:
111111
- gateway.nginx.org
112112
resources:
113113
- nginxgateways
114-
- nginxproxies
115114
verbs:
116115
- get
117116
- list
118117
- watch
118+
- apiGroups:
119+
- gateway.nginx.org
120+
resources:
121+
- nginxproxies
122+
verbs:
123+
- list
124+
- watch
119125
- apiGroups:
120126
- gateway.nginx.org
121127
resources:

charts/nginx-gateway-fabric/values.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,17 @@ nginx:
7070
## Is NGINX Plus image being used
7171
plus: false
7272

73+
## The configuration for the data plane that is contained in the NginxProxy resource.
74+
config: {}
75+
# telemetry:
76+
# exporter:
77+
# endpoint: otel-collector.default.svc:4317
78+
# interval: 5s
79+
# batchSize: 512
80+
# batchCount: 4
81+
# serviceName: ""
82+
# spanAttributes: []
83+
7384
## Configuration for NGINX Plus usage reporting.
7485
usage:
7586
## The namespace/name of the Secret containing the credentials for NGINX Plus usage reporting.

conformance/provisioner/static-deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ spec:
7171
- name: nginx-conf
7272
mountPath: /etc/nginx/conf.d
7373
- name: nginx-includes
74-
mountPath: /etc/nginx/includes
74+
mountPath: /etc/nginx/modules-includes
7575
- name: nginx-secrets
7676
mountPath: /etc/nginx/secrets
7777
- name: nginx-run
@@ -97,7 +97,7 @@ spec:
9797
- name: nginx-conf
9898
mountPath: /etc/nginx/conf.d
9999
- name: nginx-includes
100-
mountPath: /etc/nginx/includes
100+
mountPath: /etc/nginx/modules-includes
101101
- name: nginx-secrets
102102
mountPath: /etc/nginx/secrets
103103
- name: nginx-run

deploy/manifests/nginx-gateway-experimental.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,17 @@ rules:
9393
- gateway.nginx.org
9494
resources:
9595
- nginxgateways
96-
- nginxproxies
9796
verbs:
9897
- get
9998
- list
10099
- watch
100+
- apiGroups:
101+
- gateway.nginx.org
102+
resources:
103+
- nginxproxies
104+
verbs:
105+
- list
106+
- watch
101107
- apiGroups:
102108
- gateway.nginx.org
103109
resources:
@@ -215,7 +221,7 @@ spec:
215221
- name: nginx-conf
216222
mountPath: /etc/nginx/conf.d
217223
- name: nginx-includes
218-
mountPath: /etc/nginx/includes
224+
mountPath: /etc/nginx/modules-includes
219225
- name: nginx-secrets
220226
mountPath: /etc/nginx/secrets
221227
- name: nginx-run
@@ -241,7 +247,7 @@ spec:
241247
- name: nginx-conf
242248
mountPath: /etc/nginx/conf.d
243249
- name: nginx-includes
244-
mountPath: /etc/nginx/includes
250+
mountPath: /etc/nginx/modules-includes
245251
- name: nginx-secrets
246252
mountPath: /etc/nginx/secrets
247253
- name: nginx-run

deploy/manifests/nginx-gateway.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,17 @@ rules:
9090
- gateway.nginx.org
9191
resources:
9292
- nginxgateways
93-
- nginxproxies
9493
verbs:
9594
- get
9695
- list
9796
- watch
97+
- apiGroups:
98+
- gateway.nginx.org
99+
resources:
100+
- nginxproxies
101+
verbs:
102+
- list
103+
- watch
98104
- apiGroups:
99105
- gateway.nginx.org
100106
resources:
@@ -211,7 +217,7 @@ spec:
211217
- name: nginx-conf
212218
mountPath: /etc/nginx/conf.d
213219
- name: nginx-includes
214-
mountPath: /etc/nginx/includes
220+
mountPath: /etc/nginx/modules-includes
215221
- name: nginx-secrets
216222
mountPath: /etc/nginx/secrets
217223
- name: nginx-run
@@ -237,7 +243,7 @@ spec:
237243
- name: nginx-conf
238244
mountPath: /etc/nginx/conf.d
239245
- name: nginx-includes
240-
mountPath: /etc/nginx/includes
246+
mountPath: /etc/nginx/modules-includes
241247
- name: nginx-secrets
242248
mountPath: /etc/nginx/secrets
243249
- name: nginx-run

0 commit comments

Comments
 (0)