Skip to content
Merged
Show file tree
Hide file tree
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
42 changes: 42 additions & 0 deletions devel/debugging/local-controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ go run cmd/kgateway/main.go

> Note: `172.17.0.1` is IP address of the `docker0` bridge interface that allows pods running in `Kind` to access the host network, thereby allowing the Gateway proxy to connect to the xDS service running on the host.

> Additional note: Replacing `172.17.0.1` with `192.168.65.254`, as the value for `KGW_XDS_SERVICE_HOST` may help, if the gateway proxy pods in a local kind cluster are unable to connect to the xDS service running on the local machine. `192.168.65.254` is the IP address that `host.docker.internal` resolves to on gateway proxy pods when running in a local kind cluster.
Copy link

Copilot AI May 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add an explicit command example, e.g., export KGW_XDS_SERVICE_HOST=192.168.65.254, so readers know exactly how to set the environment variable.

Suggested change
> Additional note: Replacing `172.17.0.1` with `192.168.65.254`, as the value for `KGW_XDS_SERVICE_HOST` may help, if the gateway proxy pods in a local kind cluster are unable to connect to the xDS service running on the local machine. `192.168.65.254` is the IP address that `host.docker.internal` resolves to on gateway proxy pods when running in a local kind cluster.
> Additional note: Replacing `172.17.0.1` with `192.168.65.254`, as the value for `KGW_XDS_SERVICE_HOST` may help, if the gateway proxy pods in a local kind cluster are unable to connect to the xDS service running on the local machine. For example, you can set it using the following command:
>
> ```bash
> export KGW_XDS_SERVICE_HOST=192.168.65.254
> ```
>
> `192.168.65.254` is the IP address that `host.docker.internal` resolves to on gateway proxy pods when running in a local kind cluster.

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this suggestion is reasonable to make it easy to c/p the env var.


## Vscode Debugger

Use the following `launch.json` configuration to run the controller in the debugger:
Expand All @@ -42,3 +44,43 @@ Use the following `launch.json` configuration to run the controller in the debug
},
}
```

## Steps to run and inspect local builds:

Setup a local kind cluster:
```sh
VERSION=2.0.0-dev ./hack/kind/setup-kind.sh
```

Install the required CRDs:
```sh
helm install kgateway-crds install/helm/kgateway-crds
```

Create a namespace for testing:
```sh
kubectl create ns kgateway-system
```

Run kgateway locally using one of the methods described above: either `go run` or the vscode debugger.

Create an example gateway:
```sh
kubectl -n kgateway-system apply -f examples/example-gw.yaml
```

Create an example route:
```sh
kubectl -n kgateway-system apply -f examples/example-http-route.yaml
```

Using a local web browser:
- GET http://localhost:9097/snapshots/krt to inspect the KRT snapshot.
- GET http://localhost:9097/snapshots/xds to inspect the XDS snapshot.

When finished testing:

```sh
kubectl -n kgateway-system delete -f examples/example-gw.yaml
kind delete cluster
```
2 changes: 1 addition & 1 deletion test/kubernetes/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Its sole responsibility is to create [TestInstallations](#testinstallation).

## TestInstallation

A [TestInstallation](./test.go) is the structure that manages a group of tests that run against an installation of Gloo Gateway, within a Kubernetes Cluster.
A [TestInstallation](./test.go) is the structure that manages a group of tests that run against an installation within a Kubernetes Cluster.

We try to define a single `TestInstallation` per file in a `TestCluster`. This way, it is easy to identify what behaviors are expected for that installation.

Expand Down