Skip to content

Commit b2a736f

Browse files
authored
Add support for deployment labels to helm chart (#3194)
Problem: It's not possible to specify custom labels to be applied to the nginx gateway deployment Solution: Add support for specifying custom labels to be applied on nginx gateway deployment
1 parent c05ed19 commit b2a736f

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

charts/nginx-gateway-fabric/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ The following table lists the configurable parameters of the NGINX Gateway Fabri
285285
| `nginxGateway.image.repository` | The NGINX Gateway Fabric image to use | string | `"ghcr.io/nginx/nginx-gateway-fabric"` |
286286
| `nginxGateway.image.tag` | | string | `"edge"` |
287287
| `nginxGateway.kind` | The kind of the NGINX Gateway Fabric installation - currently, only deployment is supported. | string | `"deployment"` |
288+
| `nginxGateway.labels` | Set of labels to be added for NGINX Gateway Fabric deployment. | object | `{}` |
288289
| `nginxGateway.leaderElection.enable` | Enable leader election. Leader election is used to avoid multiple replicas of the NGINX Gateway Fabric reporting the status of the Gateway API resources. If not enabled, all replicas of NGINX Gateway Fabric will update the statuses of the Gateway API resources. | bool | `true` |
289290
| `nginxGateway.leaderElection.lockName` | The name of the leader election lock. A Lease object with this name will be created in the same Namespace as the controller. | string | Autogenerated if not set or set to "". |
290291
| `nginxGateway.lifecycle` | The lifecycle of the nginx-gateway container. | object | `{}` |

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

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ metadata:
66
namespace: {{ .Release.Namespace }}
77
labels:
88
{{- include "nginx-gateway.labels" . | nindent 4 }}
9+
{{- with .Values.nginxGateway.labels }}
10+
{{- toYaml . | nindent 4 }}
11+
{{- end }}
912
spec:
1013
replicas: {{ .Values.nginxGateway.replicaCount }}
1114
selector:
@@ -15,6 +18,9 @@ spec:
1518
metadata:
1619
labels:
1720
{{- include "nginx-gateway.selectorLabels" . | nindent 8 }}
21+
{{- with .Values.nginxGateway.labels }}
22+
{{- toYaml . | nindent 8 }}
23+
{{- end }}
1824
{{- if or .Values.nginxGateway.podAnnotations .Values.metrics.enable }}
1925
annotations:
2026
{{- if .Values.nginxGateway.podAnnotations }}

charts/nginx-gateway-fabric/values.schema.json

+6
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,12 @@
456456
"required": [],
457457
"title": "kind"
458458
},
459+
"labels": {
460+
"description": "Set of labels to be added for NGINX Gateway Fabric deployment.",
461+
"required": [],
462+
"title": "labels",
463+
"type": "object"
464+
},
459465
"leaderElection": {
460466
"description": "The configuration for leader election.",
461467
"properties": {

charts/nginx-gateway-fabric/values.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ nginxGateway:
2121
# -- Set of custom annotations for the NGINX Gateway Fabric pods.
2222
podAnnotations: {}
2323

24+
# -- Set of labels to be added for NGINX Gateway Fabric deployment.
25+
labels: {}
26+
2427
# -- Set of custom annotations for GatewayClass objects.
2528
gatewayClassAnnotations: {}
2629

0 commit comments

Comments
 (0)