Skip to content

Commit

Permalink
Helm Chart: Support extra volume mounts (#1193)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
oWretch authored Nov 1, 2023
1 parent 190a16e commit 307db64
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions deploy/helm-chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ The following tables lists the configurable parameters of the NGINX Gateway Fabr
| `nginxGateway.image.tag` | The tag for the NGINX Gateway Fabric image. | edge |
| `nginxGateway.image.pullPolicy` | The `imagePullPolicy` for the NGINX Gateway Fabric image. | Always |
| `nginxGateway.lifecycle` | The `lifecycle` of the nginx-gateway container. | {} |
| `nginxGateway.extraVolumeMounts` | Extra `volumeMounts` for the nginxGateway container. | {} |
| `nginxGateway.gatewayClassName` | The name of the GatewayClass for the NGINX Gateway Fabric deployment. | nginx |
| `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 |
| `nginxGateway.kind` | The kind of the NGINX Gateway Fabric installation - currently, only Deployment is supported. | deployment |
Expand All @@ -225,6 +226,7 @@ The following tables lists the configurable parameters of the NGINX Gateway Fabr
| `nginx.image.tag` | The tag for the NGINX image. | edge |
| `nginx.image.pullPolicy` | The `imagePullPolicy` for the NGINX image. | Always |
| `nginx.lifecycle` | The `lifecycle` of the nginx container. | {} |
| `nginx.extraVolumeMounts` | Extra `volumeMounts` for the nginx container. | {} |
| `terminationGracePeriodSeconds` | The termination grace period of the NGINX Gateway Fabric pod. | 30 |
| `tolerations` | The `tolerations` of the NGINX Gateway Fabric pod. | [] |
| `affinity` | The `affinity` of the NGINX Gateway Fabric pod. | {} |
Expand All @@ -238,3 +240,4 @@ The following tables lists the configurable parameters of the NGINX Gateway Fabr
| `metrics.disable` | Disable exposing metrics in the Prometheus format. | false |
| `metrics.port` | Set the port where the Prometheus metrics are exposed. Format: [1024 - 65535] | 9113 |
| `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 |
| `extraVolumes` | Extra `volumes` for the NGINX Gateway Fabric pod. | [] |
9 changes: 9 additions & 0 deletions deploy/helm-chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ spec:
mountPath: /etc/nginx/secrets
- name: nginx-run
mountPath: /var/run/nginx
{{- with .Values.nginxGateway.extraVolumeMounts -}}
{{ toYaml . | nindent 8 }}
{{- end }}
- image: {{ .Values.nginx.image.repository }}:{{ .Values.nginx.image.tag | default .Chart.AppVersion }}
imagePullPolicy: {{ .Values.nginx.image.pullPolicy }}
name: nginx
Expand Down Expand Up @@ -133,6 +136,9 @@ spec:
mountPath: /var/cache/nginx
- name: nginx-lib
mountPath: /var/lib/nginx
{{- with .Values.nginx.extraVolumeMounts -}}
{{ toYaml . | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
{{- if .Values.affinity }}
affinity:
Expand All @@ -158,4 +164,7 @@ spec:
emptyDir: {}
- name: nginx-lib
emptyDir: {}
{{- with .Values.extraVolumes -}}
{{ toYaml . | nindent 6 }}
{{- end }}
{{- end }}
10 changes: 10 additions & 0 deletions deploy/helm-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ nginxGateway:
## The lifecycle of the nginx-gateway container.
lifecycle: {}

## extraVolumeMounts are the additional volume mounts for the nginx-gateway container.
extraVolumeMounts: []

nginx:
## The NGINX image to use
image:
Expand All @@ -58,6 +61,9 @@ nginx:
## The lifecycle of the nginx container.
lifecycle: {}

## extraVolumeMounts are the additional volume mounts for the nginx container.
extraVolumeMounts: []

## The termination grace period of the NGINX Gateway Fabric pod.
terminationGracePeriodSeconds: 30

Expand Down Expand Up @@ -103,3 +109,7 @@ metrics:
## 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.
secure: false

## extraVolumes for the NGINX Gateway Fabric pod. Use in conjunction with
## nginxGateway.extraVolumeMounts and nginx.extraVolumeMounts to mount additional volumes to the containers.
extraVolumes: []

0 comments on commit 307db64

Please sign in to comment.