Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc 288 Deploying NGINX Gateway Fabric on a kind Cluster #1339

Merged
merged 8 commits into from
Dec 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 37 additions & 19 deletions site/content/installation/running-on-kind.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,61 @@
---
title: "Running on kind"
description: "Learn how to run NGINX Gateway Fabric on a kind cluster."
title: "Deploying NGINX Gateway Fabric on a kind Cluster"
description: "Learn how to run NGINX Gateway Fabric on a kind (Kubernetes in Docker) cluster."
weight: 300
toc: true
docs: "DOCS-000"
---

{{< custom-styles >}}

## Prerequisites

- [kubectl](https://kubernetes.io/docs/tasks/tools/)
- [kind](https://kind.sigs.k8s.io/)
To complete the steps in this guide, you first need to install the following tools for Kubernetes management and development:

## Prepare Cluster
- [kubectl](https://kubernetes.io/docs/tasks/tools/): A command-line interface for Kubernetes that allows you to manage and inspect cluster resources, and control containerized applications.
- [kind](https://kind.sigs.k8s.io/): Short for _Kubernetes in Docker_, this tool lets you run Kubernetes clusters locally using Docker containers, ideal for testing and development purposes.

Create a cluster with `kind`. You can follow
their [instructions](https://kind.sigs.k8s.io/docs/user/quick-start/#creating-a-cluster), or run the following make
command at the root of the repository:

```makefile
make create-kind-cluster
```
## Create a kind Cluster

To create a kind cluster, choose from the following options:

- **Option 1**: Use the `kind` tool. For detailed instructions, refer to the kind quick start guide [Creating a Cluster](https://kind.sigs.k8s.io/docs/user/quick-start/#creating-a-cluster).

- **Option 2**: Run the following `make` command in the root of your repository:

```makefile
make create-kind-cluster
```

This command creates a kind cluster using the settings from your Makefile.


## Deploy NGINX Gateway Fabric

Follow the [installation](./how-to/installation/installation.md) instructions to deploy NGINX Gateway Fabric on your Kind cluster.
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:

{{<note>}} For `kind` clusters, NodePort services require [extra configuration](https://kind.sigs.k8s.io/docs/user/configuration/#nodeport-with-port-mappings) and LoadBalancer services need [a third-party controller](https://kind.sigs.k8s.io/docs/user/loadbalancer/) like MetalLB for external IP assignment. However, the Helm chart creates a LoadBalancer service by default. To avoid this, you can disable service creation by adding `--set service.create=false` to your Helm command and use the port-forwarding command below instead to try out the examples. {{</note>}}
- [Installation with Helm]({{< relref "installation/installing-ngf/helm.md" >}})
- [Installation with Kubernetes manifests]({{< relref "installation/installing-ngf/manifests.md" >}})

## Access NGINX Gateway Fabric
{{<note>}}
When using kind clusters, be aware that NodePort services require [additional setup](https://kind.sigs.k8s.io/docs/user/configuration/#nodeport-with-port-mappings). Also, for LoadBalancer services, you’ll need a [third-party controller](https://kind.sigs.k8s.io/docs/user/loadbalancer/) like MetalLB to assign external IPs. The default Helm chart creates a LoadBalancer service; however, you can disable this by adding `--set service.create=false` to your Helm command. Afterward, you can [configure port forwarding](#configure-port-forwarding) as described below to access the examples.
{{</note>}}

Forward local ports 8080 and 8443 to ports 80 and 443 of the nginx-gateway Pod:
## Configure Port Forwarding {#configure-port-forwarding}
travisamartin marked this conversation as resolved.
Show resolved Hide resolved

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:

```shell
kubectl -n nginx-gateway port-forward <pod-name> 8080:80 8443:443
```

{{<note>}} NGINX will not listen on any ports until you configure a [Gateway](https://gateway-api.sigs.k8s.io/api-types/gateway/#gateway) resource with a valid listener. {{</note>}}

{{< note >}}NGINX will only start listening on these ports after you set up a [Gateway](https://gateway-api.sigs.k8s.io/api-types/gateway/#gateway) resource with a valid listener.{{</note>}}

## Use NGINX Gateway Fabric
## Getting Started with NGINX Gateway Fabric

To get started, follow the tutorials in the [examples](../examples) directory.
Learn how to use NGINX Gateway Fabric by exploring the tutorials in the [examples](https://github.com/nginxinc/nginx-gateway-fabric/tree/main/examples) directory. The guides provide practical instructions and scenarios to help you use NGINX Gateway Fabric effectively.
Loading