Skip to content

Commit fbcb48d

Browse files
authored
Feat: Add user-provided helm values for additional control plane service labels (#3499)
Problem: As a user that uses prometheus for everything metrics, I would like to target the control plane service with a specific label. Solution: Add the ability for users to provide additional service labels for the NGINX Gateway Fabric control plane service in the helm chart. Testing: Used helm lint/install --dry-run to make sure the k8s resources are created correctly
1 parent fbc098b commit fbcb48d

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

charts/nginx-gateway-fabric/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ The following table lists the configurable parameters of the NGINX Gateway Fabri
288288
| `nginx.usage.resolver` | The nameserver used to resolve the NGINX Plus usage reporting endpoint. Used with NGINX Instance Manager. | string | `""` |
289289
| `nginx.usage.secretName` | The name of the Secret containing the JWT for NGINX Plus usage reporting. Must exist in the same namespace that the NGINX Gateway Fabric control plane is running in (default namespace: nginx-gateway). | string | `"nplus-license"` |
290290
| `nginx.usage.skipVerify` | Disable client verification of the NGINX Plus usage reporting server certificate. | bool | `false` |
291-
| `nginxGateway` | The nginxGateway section contains configuration for the NGINX Gateway Fabric control plane deployment. | object | `{"affinity":{},"config":{"logging":{"level":"info"}},"configAnnotations":{},"extraVolumeMounts":[],"extraVolumes":[],"gatewayClassAnnotations":{},"gatewayClassName":"nginx","gatewayControllerName":"gateway.nginx.org/nginx-gateway-controller","gwAPIExperimentalFeatures":{"enable":false},"image":{"pullPolicy":"Always","repository":"ghcr.io/nginx/nginx-gateway-fabric","tag":"edge"},"kind":"deployment","labels":{},"leaderElection":{"enable":true,"lockName":""},"lifecycle":{},"metrics":{"enable":true,"port":9113,"secure":false},"nodeSelector":{},"podAnnotations":{},"productTelemetry":{"enable":true},"readinessProbe":{"enable":true,"initialDelaySeconds":3,"port":8081},"replicas":1,"resources":{},"service":{"annotations":{}},"serviceAccount":{"annotations":{},"imagePullSecret":"","imagePullSecrets":[],"name":""},"snippetsFilters":{"enable":false},"terminationGracePeriodSeconds":30,"tolerations":[],"topologySpreadConstraints":[]}` |
291+
| `nginxGateway` | The nginxGateway section contains configuration for the NGINX Gateway Fabric control plane deployment. | object | `{"affinity":{},"config":{"logging":{"level":"info"}},"configAnnotations":{},"extraVolumeMounts":[],"extraVolumes":[],"gatewayClassAnnotations":{},"gatewayClassName":"nginx","gatewayControllerName":"gateway.nginx.org/nginx-gateway-controller","gwAPIExperimentalFeatures":{"enable":false},"image":{"pullPolicy":"Always","repository":"ghcr.io/nginx/nginx-gateway-fabric","tag":"edge"},"kind":"deployment","labels":{},"leaderElection":{"enable":true,"lockName":""},"lifecycle":{},"metrics":{"enable":true,"port":9113,"secure":false},"nodeSelector":{},"podAnnotations":{},"productTelemetry":{"enable":true},"readinessProbe":{"enable":true,"initialDelaySeconds":3,"port":8081},"replicas":1,"resources":{},"service":{"annotations":{},"labels":{}},"serviceAccount":{"annotations":{},"imagePullSecret":"","imagePullSecrets":[],"name":""},"snippetsFilters":{"enable":false},"terminationGracePeriodSeconds":30,"tolerations":[],"topologySpreadConstraints":[]}` |
292292
| `nginxGateway.affinity` | The affinity of the NGINX Gateway Fabric control plane pod. | object | `{}` |
293293
| `nginxGateway.config.logging.level` | Log level. | string | `"info"` |
294294
| `nginxGateway.configAnnotations` | Set of custom annotations for NginxGateway objects. | object | `{}` |
@@ -316,8 +316,9 @@ The following table lists the configurable parameters of the NGINX Gateway Fabri
316316
| `nginxGateway.readinessProbe.port` | Port in which the readiness endpoint is exposed. | int | `8081` |
317317
| `nginxGateway.replicas` | The number of replicas of the NGINX Gateway Fabric Deployment. | int | `1` |
318318
| `nginxGateway.resources` | The resource requests and/or limits of the nginx-gateway container. | object | `{}` |
319-
| `nginxGateway.service` | The service configuration for the NGINX Gateway Fabric control plane. | object | `{"annotations":{}}` |
319+
| `nginxGateway.service` | The service configuration for the NGINX Gateway Fabric control plane. | object | `{"annotations":{},"labels":{}}` |
320320
| `nginxGateway.service.annotations` | The annotations of the NGINX Gateway Fabric control plane service. | object | `{}` |
321+
| `nginxGateway.service.labels` | The labels of the NGINX Gateway Fabric control plane service. | object | `{}` |
321322
| `nginxGateway.serviceAccount` | The serviceaccount configuration for the NGINX Gateway Fabric control plane. | object | `{"annotations":{},"imagePullSecret":"","imagePullSecrets":[],"name":""}` |
322323
| `nginxGateway.serviceAccount.annotations` | Set of custom annotations for the NGINX Gateway Fabric control plane service account. | object | `{}` |
323324
| `nginxGateway.serviceAccount.imagePullSecret` | The name of the secret containing docker registry credentials for the control plane. Secret must exist in the same namespace as the helm release. | string | `""` |

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ metadata:
55
namespace: {{ .Release.Namespace }}
66
labels:
77
{{- include "nginx-gateway.labels" . | nindent 4 }}
8+
{{- if .Values.nginxGateway.service.labels }}
9+
{{ toYaml .Values.nginxGateway.service.labels | indent 4 }}
10+
{{- end }}
811
{{- if .Values.nginxGateway.service.annotations }}
912
annotations:
1013
{{ toYaml .Values.nginxGateway.service.annotations | indent 4 }}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,12 @@
804804
"required": [],
805805
"title": "annotations",
806806
"type": "object"
807+
},
808+
"labels": {
809+
"description": "The labels of the NGINX Gateway Fabric control plane service.",
810+
"required": [],
811+
"title": "labels",
812+
"type": "object"
807813
}
808814
},
809815
"required": [],

charts/nginx-gateway-fabric/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ nginxGateway:
5959
# -- The annotations of the NGINX Gateway Fabric control plane service.
6060
annotations: {}
6161

62+
# -- The labels of the NGINX Gateway Fabric control plane service.
63+
labels: {}
64+
6265
# -- The serviceaccount configuration for the NGINX Gateway Fabric control plane.
6366
serviceAccount:
6467
# -- Set of custom annotations for the NGINX Gateway Fabric control plane service account.

0 commit comments

Comments
 (0)