|
7 | 7 |
|
8 | 8 | This little Python script watches for Gateways and HTTP Routes part of the [Kubernetes Gateway API](https://gateway-api.sigs.k8s.io) |
9 | 9 | in the Kubernetes cluster you have configured as your current context. It then works out the hostname from the HTTP route |
10 | | -and registers it in multicast DNS towards the IP address of the Gateway. cloud-provider-mdns is intended to simplify |
| 10 | +and registers it in multicast and optionally unicast DNS towards the IP address of the Gateway. cloud-provider-mdns is intended to simplify |
11 | 11 | local engineering, without the need of running a DNS server or manually hacking your hosts file. Basically run this, |
12 | 12 | watch it find new registrations, then type their names into your browser. |
13 | 13 |
|
14 | 14 | ## How to run this |
15 | 15 |
|
16 | 16 | > It is assumed you have something like [cloud-provider-kind](https://github.com/kubernetes-sigs/cloud-provider-kind) |
17 | 17 | > that assigns IP addresses to your Gateways so they are accessible from your host. |
| 18 | +> It is not necessary to activate the virtual environment you installed the script in. |
18 | 19 |
|
19 | 20 | 1. One-time: Build and install as described in the “How to build this” section below. |
20 | 21 | 2. Start your Kubernetes cluster and make sure your Kubernetes configuration has it set as its current context |
21 | 22 | 3. In a separate terminal, start cloud-provider-mdns and keep it running. Hit Ctrl-C to stop it. |
22 | 23 |
|
23 | | -```shell |
24 | | -$ /path/to/virtualenv/bin/cloud-provider-mdns |
25 | | -``` |
26 | | - |
27 | | -> It is not necessary to activate the virtual environment you installed the script in. |
28 | | -
|
| 24 | + ```shell |
| 25 | + $ /path/to/virtualenv/bin/cloud-provider-mdns |
| 26 | + ``` |
| 27 | + |
29 | 28 | 4. Declare a HTTPRoute with a hostname that ends in '.local' |
30 | 29 | 5. Watch the output of cloud-provider-mdns |
31 | 30 | 6. Type the name into your browser |
32 | 31 |
|
| 32 | +Registration is done in multicast DNS by default. If you wish to additionally populate a unicast nameserver then |
| 33 | +you must specify it's IP, tsig key name and secret using the CLI. A usable example unicast namesever configuration is created |
| 34 | +by [kube-eng](https://github.com/mrmatap/kube-eng). |
| 35 | +
|
33 | 36 | ## How to build this |
34 | 37 |
|
35 | 38 | Clone this repository, create a Python virtualenv (you'll need Python >= 3.12), then build and install: |
|
0 commit comments