Skip to content

Commit

Permalink
Add custom annotations into GatewayClass and NginxGateway manifests (n…
Browse files Browse the repository at this point in the history
…ginxinc#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
  • Loading branch information
sgavrylenko committed Jun 3, 2024
1 parent 118488e commit cecf9ec
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions charts/nginx-gateway-fabric/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,11 @@ The following tables lists the configurable parameters of the NGINX Gateway Fabr
| `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.gatewayClassAnnotations` | Set of custom annotations for GatewayClass objects. | {} |
| `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 |
| `nginxGateway.config` | The dynamic configuration for the control plane that is contained in the NginxGateway resource | [See nginxGateway.config section](values.yaml) |
| `nginxGateway.configAnnotations` | Set of custom annotations for NginxGateway objects. | {} |
| `nginxGateway.readinessProbe.enable` | Enable the /readyz endpoint on the control plane. | true |
| `nginxGateway.readinessProbe.port` | Port in which the readiness endpoint is exposed. | 8081 |
| `nginxGateway.readinessProbe.initialDelaySeconds` | The number of seconds after the Pod has started before the readiness probes are initiated. | 3 |
Expand Down
6 changes: 6 additions & 0 deletions charts/nginx-gateway-fabric/templates/gatewayclass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ metadata:
name: {{ .Values.nginxGateway.gatewayClassName }}
labels:
{{- include "nginx-gateway.labels" . | nindent 4 }}
{{- if .Values.nginxGateway.gatewayClassAnnotations }}
annotations:
{{- range $key, $value := .Values.nginxGateway.gatewayClassAnnotations }}
{{ printf "%s: %s" $key $value }}
{{- end }}
{{- end }}
spec:
controllerName: {{ .Values.nginxGateway.gatewayControllerName }}
{{- if .Values.nginx.config }}
Expand Down
6 changes: 6 additions & 0 deletions charts/nginx-gateway-fabric/templates/nginxgateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,11 @@ metadata:
namespace: {{ .Release.Namespace }}
labels:
{{- include "nginx-gateway.labels" . | nindent 4 }}
{{- if .Values.nginxGateway.configAnnotations }}
annotations:
{{- range $key, $value := .Values.nginxGateway.configAnnotations }}
{{ printf "%s: %s" $key $value }}
{{- end }}
{{- end }}
spec:
{{- toYaml .Values.nginxGateway.config | nindent 2 }}
8 changes: 8 additions & 0 deletions charts/nginx-gateway-fabric/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ nginxGateway:
## Fabric must have a unique corresponding GatewayClass resource. NGINX Gateway Fabric only processes resources that
## belong to its class - i.e. have the "gatewayClassName" field resource equal to the class.
gatewayClassName: nginx
## Set of custom annotations for GatewayClass objects, e.g:
## gatewayClassAnnotations:
## someKey: someValue
gatewayClassAnnotations: {}
## The name of the Gateway controller. The controller name must be of the form: DOMAIN/PATH. The controller's domain
## is gateway.nginx.org.
gatewayControllerName: gateway.nginx.org/nginx-gateway-controller
Expand All @@ -13,6 +17,10 @@ nginxGateway:
logging:
## Log level. Supported values "info", "debug", "error".
level: info
## Set of custom annotations for NginxGateway objects, e.g:
## configAnnotations:
## someKey: someValue
configAnnotations: {}
## The number of replicas of the NGINX Gateway Fabric Deployment.
replicaCount: 1
## The configuration for leader election.
Expand Down

0 comments on commit cecf9ec

Please sign in to comment.