Deploying NGINX Gateway Fabric on a kind Cluster
Learn how to run NGINX Gateway Fabric on a kind (Kubernetes in Docker) cluster.
To complete the steps in this guide, you first need to install the following tools for Kubernetes management and development:
- kubectl: A command-line interface for Kubernetes that allows you to manage and inspect cluster resources, and control containerized applications.
- kind: Short for Kubernetes in Docker, this tool lets you run Kubernetes clusters locally using Docker containers, ideal for testing and development purposes.
To create a kind cluster, choose from the following options:
Option 1: Use the
kindtool. For detailed instructions, refer to the kind quick start guide Creating a Cluster.
Option 2: Run the following
makecommand in the root of your repository:
This command creates a kind cluster using the settings from your Makefile.
Now that you’ve created a kind cluster, the next step is to install NGINX Gateway Fabric.
To install NGINX Gateway Fabric, choose the appropriate installation guide that suits your setup:
When using kind clusters, be aware that NodePort services require additional setup. Also, for LoadBalancer services, you’ll need a third-party controller like MetalLB to assign external IPs. The default Helm chart creates a LoadBalancer service; however, you can disable this by adding
--set service.create=falseto your Helm command. Afterward, you can configure port forwarding as described below to access the examples.
Once NGINX Gateway Fabric has been installed, you need to configure port forwarding from local ports 8080 and 8443 to ports 80 and 443 on the nginx-gateway Pod.
To configure port forwarding, run the following command:
kubectl -n nginx-gateway port-forward <pod-name> 8080:80 8443:443
NGINX will only start listening on these ports after you set up a Gateway resource with a valid listener.
Learn how to use NGINX Gateway Fabric by exploring the tutorials in the examples directory. The guides provide practical instructions and scenarios to help you use NGINX Gateway Fabric effectively.