Skip to content

Commit cecf9ec

Browse files
authored
Add custom annotations into GatewayClass and NginxGateway manifests (#1993)
Problem: For deploying our service we use ArgoCD. For this, we have a Helm Chart that contains multiple resources that are using CRDs, that are not managed by this helm chart. When trying to sync this application, it fails if at least one CRD is not installed in the cluster. This is expected. Solution: To work around this problem, we want to use SkipDryRunOnMissingResource option as annotation for GatewayClass and NginxGateway objects from the nginx-gateway-fabric chart
1 parent 118488e commit cecf9ec

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

charts/nginx-gateway-fabric/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,11 @@ The following tables lists the configurable parameters of the NGINX Gateway Fabr
253253
| `nginxGateway.lifecycle` | The `lifecycle` of the nginx-gateway container. | {} |
254254
| `nginxGateway.extraVolumeMounts` | Extra `volumeMounts` for the nginxGateway container. | {} |
255255
| `nginxGateway.gatewayClassName` | The name of the GatewayClass for the NGINX Gateway Fabric deployment. | nginx |
256+
| `nginxGateway.gatewayClassAnnotations` | Set of custom annotations for GatewayClass objects. | {} |
256257
| `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 |
257258
| `nginxGateway.kind` | The kind of the NGINX Gateway Fabric installation - currently, only Deployment is supported. | deployment |
258259
| `nginxGateway.config` | The dynamic configuration for the control plane that is contained in the NginxGateway resource | [See nginxGateway.config section](values.yaml) |
260+
| `nginxGateway.configAnnotations` | Set of custom annotations for NginxGateway objects. | {} |
259261
| `nginxGateway.readinessProbe.enable` | Enable the /readyz endpoint on the control plane. | true |
260262
| `nginxGateway.readinessProbe.port` | Port in which the readiness endpoint is exposed. | 8081 |
261263
| `nginxGateway.readinessProbe.initialDelaySeconds` | The number of seconds after the Pod has started before the readiness probes are initiated. | 3 |

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ metadata:
44
name: {{ .Values.nginxGateway.gatewayClassName }}
55
labels:
66
{{- include "nginx-gateway.labels" . | nindent 4 }}
7+
{{- if .Values.nginxGateway.gatewayClassAnnotations }}
8+
annotations:
9+
{{- range $key, $value := .Values.nginxGateway.gatewayClassAnnotations }}
10+
{{ printf "%s: %s" $key $value }}
11+
{{- end }}
12+
{{- end }}
713
spec:
814
controllerName: {{ .Values.nginxGateway.gatewayControllerName }}
915
{{- if .Values.nginx.config }}

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,11 @@ metadata:
55
namespace: {{ .Release.Namespace }}
66
labels:
77
{{- include "nginx-gateway.labels" . | nindent 4 }}
8+
{{- if .Values.nginxGateway.configAnnotations }}
9+
annotations:
10+
{{- range $key, $value := .Values.nginxGateway.configAnnotations }}
11+
{{ printf "%s: %s" $key $value }}
12+
{{- end }}
13+
{{- end }}
814
spec:
915
{{- toYaml .Values.nginxGateway.config | nindent 2 }}

charts/nginx-gateway-fabric/values.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ nginxGateway:
55
## Fabric must have a unique corresponding GatewayClass resource. NGINX Gateway Fabric only processes resources that
66
## belong to its class - i.e. have the "gatewayClassName" field resource equal to the class.
77
gatewayClassName: nginx
8+
## Set of custom annotations for GatewayClass objects, e.g:
9+
## gatewayClassAnnotations:
10+
## someKey: someValue
11+
gatewayClassAnnotations: {}
812
## The name of the Gateway controller. The controller name must be of the form: DOMAIN/PATH. The controller's domain
913
## is gateway.nginx.org.
1014
gatewayControllerName: gateway.nginx.org/nginx-gateway-controller
@@ -13,6 +17,10 @@ nginxGateway:
1317
logging:
1418
## Log level. Supported values "info", "debug", "error".
1519
level: info
20+
## Set of custom annotations for NginxGateway objects, e.g:
21+
## configAnnotations:
22+
## someKey: someValue
23+
configAnnotations: {}
1624
## The number of replicas of the NGINX Gateway Fabric Deployment.
1725
replicaCount: 1
1826
## The configuration for leader election.

0 commit comments

Comments
 (0)