nginx-gateway-fabric
by jupyterjsc
NGINX Gateway Fabric
About this chart
NGINX Gateway Fabric Helm Chart
- NGINX Gateway Fabric Helm Chart
- Introduction
- Prerequisites
- Installing the Gateway API resources
- Requirements
- Installing the Chart
- Installing the Chart from the OCI Registry
- Installing the Chart via Sources
- Pulling the Chart
- Installing the Chart
- Custom installation options
- Service type
- Upgrading the Chart
- Upgrading the Gateway Resources
- Upgrading the CRDs
- Upgrading the Chart from the OCI Registry
- Upgrading the Chart from the Sources
- Uninstalling the Chart
- Uninstalling the Gateway Resources
- Configuration
Introduction
This chart deploys the NGINX Gateway Fabric in your Kubernetes cluster.
Prerequisites
Installing the Gateway API resources
[!NOTE]
The Gateway API resources from the standard channel must be installed before deploying NGINX Gateway Fabric. If they are already installed in your cluster, please ensure they are the correct version as supported by the NGINX Gateway Fabric - see the Technical Specifications.
kubectl kustomize https://github.com/nginx/nginx-gateway-fabric/config/crd/gateway-api/standard | kubectl apply -f -
Requirements
Kubernetes: >= 1.25.0-0
Installing the Chart
Installing the Chart from the OCI Registry
To install the latest stable release of NGINX Gateway Fabric in the nginx-gateway namespace, run the following command:
helm install ngf oci://ghcr.io/nginx/charts/nginx-gateway-fabric --create-namespace -n nginx-gateway
ngf is the name of the release, and can be changed to any name you want. This name is added as a prefix to the Deployment name.
If the namespace already exists, you can omit the optional --create-namespace flag. If you want the latest version from the main branch, add --version 0.0.0-edge to your install command.
To wait for the Deployment to be ready, you can either add the --wait flag to the helm install command, or run
the following after installing:
kubectl wait --timeout=5m -n nginx-gateway deployment/ngf-nginx-gateway-fabric --for=condition=Available
Installing the Chart via Sources
Pulling the Chart
helm pull oci://ghcr.io/nginx/charts/nginx-gateway-fabric --untar
cd nginx-gateway-fabric
This will pull the latest stable release. To pull the latest version from the main branch, specify the
--version 0.0.0-edge flag when pulling.
Installing the Chart
To install the chart into the nginx-gateway namespace, run the following command.
helm install ngf . --create-namespace -n nginx-gateway
ngf is the name of the release, and can be changed to any name you want. This name is added as a prefix to the Deployment name.
If the namespace already exists, you can omit the optional --create-namespace flag.
To wait for the Deployment to be ready, you can either add the --wait flag to the helm install command, or run
the following after installing:
kubectl wait --timeout=5m -n nginx-gateway deployment/ngf-nginx-gateway-fabric --for=condition=Available
Custom installation options
Service type
By default, the NGINX Gateway Fabric helm chart deploys a LoadBalancer Service.
To use a NodePort Service instead:
helm install ngf oci://ghcr.io/nginx/charts/nginx-gateway-fabric --create-namespace -n nginx-gateway --set nginx.service.type=NodePort
Upgrading the Chart
Upgrading the Gateway Resources
Before you upgrade a release, ensure the Gateway API resources are the correct version as supported by the NGINX Gateway Fabric - see the Technical Specifications.:
To upgrade the Gateway CRDs from the Gateway API repo, run:
kubectl kustomize https://github.com/nginx/nginx-gateway-fabric/config/crd/gateway-api/standard | kubectl apply -f -
Upgrading the CRDs
Helm does not upgrade the NGINX Gateway Fabric CRDs during a release upgrade. Before you upgrade a release, you must pull the chart from GitHub and run the following command to upgrade the CRDs:
kubectl apply --server-side -f crds/
The following warning is expected and can be ignored:
Warning: kubectl apply should be used on resource created by either kubectl create --save-config or kubectl apply.
Upgrading the Chart from the OCI Registry
To upgrade the release ngf, run:
helm upgrade ngf oci://ghcr.io/nginx/charts/nginx-gateway-fabric -n nginx-gateway
This will upgrade to the latest stable release. To upgrade to the latest version from the main branch, specify
the --version 0.0.0-edge flag when upgrading.
Upgrading the Chart from the Sources
Pull the chart sources as described in Pulling the Chart, if not already present. Then, to upgrade
the release ngf, run:
helm upgrade ngf . -n nginx-gateway
Uninstalling the Chart
To uninstall/delete the release ngf:
helm uninstall ngf -n nginx-gateway
kubectl delete ns nginx-gateway
kubectl delete -f https://raw.githubusercontent.com/nginx/nginx-gateway-fabric/main/deploy/crds.yaml
These commands remove all the Kubernetes components associated with the release and deletes the release.
Uninstalling the Gateway Resources
Warning: This command will delete all the corresponding custom resources in your cluster across all namespaces! Please ensure there are no custom resources that you want to keep and there are no other Gateway API implementations running in the cluster!
To delete the Gateway API CRDs from the Gateway API repo, run:
kubectl kustomize https://github.com/nginx/nginx-gateway-fabric/config/crd/gateway-api/standard | kubectl delete -f -
Configuration
The following table lists the configurable parameters of the NGINX Gateway Fabric chart and their default values.
More granular configuration options may not show up in this table. Viewing the
values.yamlfile directly can show all available options.
| Key | Description | Type | Default |
|---|---|---|---|
certGenerator | The certGenerator section contains the configuration for the cert-generator Job. | object | {"affinity":{},"agentTLSSecretName":"agent-tls","annotations":{},"enable":true,"nodeSelector":{},"overwrite":false,"serverTLSSecretName":"server-tls","tolerations":[],"topologySpreadConstraints":[],"ttlSecondsAfterFinished":30} |
certGenerator.affinity | The affinity of the cert-generator pod. | object | {} |
certGenerator.agentTLSSecretName | The name of the base Secret containing TLS CA, certificate, and key for the NGINX Agent to securely communicate with the NGINX Gateway Fabric control plane. Must exist in the same namespace that the NGINX Gateway Fabric control plane is running in (default namespace: nginx-gateway). | string | "agent-tls" |
certGenerator.annotations | The annotations of the cert-generator Job. | object | {} |
certGenerator.enable | Enable the cert-generator Job. If this is disabled, then cert-manager or some other method must be used to create the required Secrets. | bool | true |
certGenerator.nodeSelector | The nodeSelector of the cert-generator pod. | object | {} |
certGenerator.overwrite | Overwrite existing TLS Secrets on startup. | bool | false |
certGenerator.serverTLSSecretName | The name of the Secret containing TLS CA, certificate, and key for the NGINX Gateway Fabric control plane to securely communicate with the NGINX Agent. Must exist in the same namespace that the NGINX Gateway Fabric control plane is running in (default namespace: nginx-gateway). | string | "server-tls" |
certGenerator.tolerations | Tolerations for the cert-generator pod. | list | [] |
certGenerator.topologySpreadConstraints | The topology spread constraints for the cert-generator pod. | list | [] |
certGenerator.ttlSecondsAfterFinished | How long to wait after the cert generator job has finished before it is removed by the job controller. | int | 30 |
clusterDomain | The DNS cluster domain of your Kubernetes cluster. | string | "cluster.local" |
gateways | A list of Gateway objects. View https://gateway-api.sigs.k8s.io/reference/spec/#gateway for full Gateway reference. | list | [] |
nginx | The nginx section contains the configuration for all NGINX data plane deployments installed by the NGINX Gateway Fabric control plane. | object | {"autoscaling":{"enable":false},"config":{},"container":{"hostPorts":[],"lifecycle":{},"readinessProbe":{},"resources":{},"volumeMounts":[]},"debug":false,"image":{"pullPolicy":"IfNotPresent","repository":"ghcr.io/nginx/nginx-gateway-fabric/nginx","tag":"2.4.1"},"imagePullSecret":"","imagePullSecrets":[],"kind":"deployment","nginxOneConsole":{"dataplaneKeySecretName":"","endpointHost":"agent.connect.nginx.com","endpointPort":443,"skipVerify":false},"patches":[],"plus":false,"pod":{},"replicas":1,"service":{"externalTrafficPolicy":"Local","loadBalancerClass":"","loadBalancerIP":"","loadBalancerSourceRanges":[],"nodePorts":[],"patches":[],"type":"LoadBalancer"},"usage":{"caSecretName":"","clientSSLSecretName":"","endpoint":"","enforceInitialReport":true,"resolver":"","secretName":"nplus-license","skipVerify":false}} |
nginx.autoscaling | Autoscaling configuration for the NGINX data plane. | object | {"enable":false} |
nginx.autoscaling.enable | Enable or disable Horizontal Pod Autoscaler for the NGINX data plane. | bool | false |
nginx.config | The configuration for the data plane that is contained in the NginxProxy resource. This is applied globally to all Gateways managed by this instance of NGINX Gateway Fabric. | object | {} |
nginx.container | The container configuration for the NGINX container. This is applied globally to all Gateways managed by this instance of NGINX Gateway Fabric. | object | {"hostPorts":[],"lifecycle":{},"readinessProbe":{},"resources":{},"volumeMounts":[]} |
nginx.container.hostPorts | A list of HostPorts to expose on the host. This configuration allows containers to bind to a specific port on the host node, enabling external network traffic to reach the container directly through the host's IP address and port. Use this option when you need to expose container ports on the host for direct access, such as for debugging, legacy integrations, or when NodePort/LoadBalancer services are not suitable. Note: Using hostPort may have security and scheduling implications, as it ties pods to specific nodes and ports. | list | [] |
nginx.container.lifecycle | The lifecycle of the NGINX container. | object | {} |
nginx.container.resources | The resource requirements of the NGINX container. You should set this value if you want to use dataplane Autoscaling(HPA). | object | {} |
nginx.container.volumeMounts | volumeMounts are the additional volume mounts for the NGINX container. | list | [] |
nginx.debug | Enable debugging for NGINX. Uses the nginx-debug binary. The NGINX error log level should be set to debug in the NginxProxy resource. | bool | false |
nginx.image.repository | The NGINX image to use. | string | "ghcr.io/nginx/nginx-gateway-fabric/nginx" |
nginx.imagePullSecret | The name of the secret containing docker registry credentials. Secret must exist in the same namespace as the helm release. The control plane will copy this secret into any namespace where NGINX is deployed. | string | "" |
nginx.imagePullSecrets | A list of secret names containing docker registry credentials. Secrets must exist in the same namespace as the helm release. The control plane will copy these secrets into any namespace where NGINX is deployed. | list | [] |
nginx.kind | The kind of NGINX deployment. | string | "deployment" |
nginx.nginxOneConsole | Configuration for NGINX One Console. | object | {"dataplaneKeySecretName":"","endpointHost":"agent.connect.nginx.com","endpointPort":443,"skipVerify":false} |
nginx.nginxOneConsole.dataplaneKeySecretName | Name of the secret which holds the dataplane key that is required to authenticate with the NGINX One Console. Secret must exist in the same namespace that the NGINX Gateway Fabric control plane is running in (default namespace: nginx-gateway). | string | "" |
nginx.nginxOneConsole.endpointHost | The Endpoint host that the NGINX One Console telemetry metrics will be sent to. | string | "agent.connect.nginx.com" |
nginx.nginxOneConsole.endpointPort | The endpoint port that the NGINX One Console telemetry metrics will be sent to. | int | 443 |
nginx.nginxOneConsole.skipVerify | Skip TLS verification for NGINX One Co |
Deploy nginx-gateway-fabric with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has nginx-gateway-fabric on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartnginx-gateway-fabric is pinned at v2.4.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply