Skip to content

Commit d40f67e

Browse files
committed
Helm Chart: Support extra volume mounts (nginx#1193)
Problem: No support in the helm chart for mounting additional volumes onto the NGF and NGINX containers. Solution: Add the ability to specify additional volumes and volume mounts to the helm chart.
1 parent 8567e1b commit d40f67e

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

deploy/helm-chart/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ The following tables lists the configurable parameters of the NGINX Gateway Fabr
211211
| `nginxGateway.image.tag` | The tag for the NGINX Gateway Fabric image. | edge |
212212
| `nginxGateway.image.pullPolicy` | The `imagePullPolicy` for the NGINX Gateway Fabric image. | Always |
213213
| `nginxGateway.lifecycle` | The `lifecycle` of the nginx-gateway container. | {} |
214+
| `nginxGateway.extraVolumeMounts` | Extra `volumeMounts` for the nginxGateway container. | {} |
214215
| `nginxGateway.gatewayClassName` | The name of the GatewayClass for the NGINX Gateway Fabric deployment. | nginx |
215216
| `nginxGateway.gatewayControllerName` | The name of the Gateway controller. The controller name must be of the form: DOMAIN/PATH. The controller's domain is gateway.nginx.org. | gateway.nginx.org/nginx-gateway-controller |
216217
| `nginxGateway.kind` | The kind of the NGINX Gateway Fabric installation - currently, only Deployment is supported. | deployment |
@@ -225,6 +226,7 @@ The following tables lists the configurable parameters of the NGINX Gateway Fabr
225226
| `nginx.image.tag` | The tag for the NGINX image. | edge |
226227
| `nginx.image.pullPolicy` | The `imagePullPolicy` for the NGINX image. | Always |
227228
| `nginx.lifecycle` | The `lifecycle` of the nginx container. | {} |
229+
| `nginx.extraVolumeMounts` | Extra `volumeMounts` for the nginx container. | {} |
228230
| `terminationGracePeriodSeconds` | The termination grace period of the NGINX Gateway Fabric pod. | 30 |
229231
| `tolerations` | The `tolerations` of the NGINX Gateway Fabric pod. | [] |
230232
| `affinity` | The `affinity` of the NGINX Gateway Fabric pod. | {} |
@@ -238,3 +240,4 @@ The following tables lists the configurable parameters of the NGINX Gateway Fabr
238240
| `metrics.disable` | Disable exposing metrics in the Prometheus format. | false |
239241
| `metrics.port` | Set the port where the Prometheus metrics are exposed. Format: [1024 - 65535] | 9113 |
240242
| `metrics.secure` | Enable serving metrics via https. By default metrics are served via http. Please note that this endpoint will be secured with a self-signed certificate. | false |
243+
| `extraVolumes` | Extra `volumes` for the NGINX Gateway Fabric pod. | [] |

deploy/helm-chart/templates/deployment.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ spec:
101101
mountPath: /etc/nginx/secrets
102102
- name: nginx-run
103103
mountPath: /var/run/nginx
104+
{{- with .Values.nginxGateway.extraVolumeMounts -}}
105+
{{ toYaml . | nindent 8 }}
106+
{{- end }}
104107
- image: {{ .Values.nginx.image.repository }}:{{ .Values.nginx.image.tag | default .Chart.AppVersion }}
105108
imagePullPolicy: {{ .Values.nginx.image.pullPolicy }}
106109
name: nginx
@@ -133,6 +136,9 @@ spec:
133136
mountPath: /var/cache/nginx
134137
- name: nginx-lib
135138
mountPath: /var/lib/nginx
139+
{{- with .Values.nginx.extraVolumeMounts -}}
140+
{{ toYaml . | nindent 8 }}
141+
{{- end }}
136142
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
137143
{{- if .Values.affinity }}
138144
affinity:
@@ -158,4 +164,7 @@ spec:
158164
emptyDir: {}
159165
- name: nginx-lib
160166
emptyDir: {}
167+
{{- with .Values.extraVolumes -}}
168+
{{ toYaml . | nindent 6 }}
169+
{{- end }}
161170
{{- end }}

deploy/helm-chart/values.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ nginxGateway:
4848
## The lifecycle of the nginx-gateway container.
4949
lifecycle: {}
5050

51+
## extraVolumeMounts are the additional volume mounts for the nginx-gateway container.
52+
extraVolumeMounts: []
53+
5154
nginx:
5255
## The NGINX image to use
5356
image:
@@ -58,6 +61,9 @@ nginx:
5861
## The lifecycle of the nginx container.
5962
lifecycle: {}
6063

64+
## extraVolumeMounts are the additional volume mounts for the nginx container.
65+
extraVolumeMounts: []
66+
6167
## The termination grace period of the NGINX Gateway Fabric pod.
6268
terminationGracePeriodSeconds: 30
6369

@@ -103,3 +109,7 @@ metrics:
103109
## Enable serving metrics via https. By default metrics are served via http.
104110
## Please note that this endpoint will be secured with a self-signed certificate.
105111
secure: false
112+
113+
## extraVolumes for the NGINX Gateway Fabric pod. Use in conjunction with
114+
## nginxGateway.extraVolumeMounts and nginx.extraVolumeMounts to mount additional volumes to the containers.
115+
extraVolumes: []

0 commit comments

Comments
 (0)