You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-5Lines changed: 19 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,10 +5,9 @@
5
5
> This is a proof of concept. Do not consider it to be free of issues. It works reasonably well for registering names
6
6
> in your local Kubernetes cluster you use for engineering, such as the one created by [kube-eng](https://github.com/mrmatap/kube-eng).
7
7
8
-
This little Python script watches for Gateways and HTTP Routes part of the [Kubernetes Gateway API](https://gateway-api.sigs.k8s.io)
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 and optionally unicast DNS towards the IP address of the Gateway. cloud-provider-mdns is intended to simplify
11
-
local engineering, without the need of running a DNS server or manually hacking your hosts file. Basically run this,
8
+
This little Python script watches for Ingresses, Gateways and HTTP Routes in the Kubernetes cluster you have configured as your current context.
9
+
. It then works out the fully qualified domain name and external IP address to be registered it in multicast and/or unicast DNS towards the IP. cloud-provider-mdns is intended to simplify
10
+
local engineering. If you choose to only use Multicast DNS only then there is no need to run a local DNS server. Basically run this,
12
11
watch it find new registrations, then type their names into your browser.
13
12
14
13
## How to run this
@@ -25,14 +24,29 @@ watch it find new registrations, then type their names into your browser.
25
24
$ /path/to/virtualenv/bin/cloud-provider-mdns
26
25
```
27
26
28
-
4. Declare a HTTPRoute with a hostname that ends in'.local'
27
+
4. Declare a HTTPRoute with a hostname that ends in'.local' or an Ingress, depending on how your cluster is configured
29
28
5. Watch the output of cloud-provider-mdns
30
29
6. Type the name into your browser
31
30
32
31
Registration is donein multicast DNS by default. If you wish to additionally populate a unicast nameserver then
33
32
you must specify it's IP, tsig key name and secret using the CLI. A usable example unicast namesever configuration is created
34
33
by [kube-eng](https://github.com/mrmatap/kube-eng).
35
34
35
+
### Configuration
36
+
37
+
You can configure cloud-provider-mdns by providing a configuration file at `~/etc/cloud-provider-mdns.json` or using
38
+
environment variables.
39
+
40
+
| Field | Environment Variable | Default Value | Description |
| multicast_enable | CLOUD_PROVIDER_MDNS_MULTICAST_ENABLE | True | Enables registration in multicast DNS **for names that end in `.local`** |
43
+
| unicast_enable | CLOUD_PROVIDER_MDNS_UNICAST_ENABLE | False | Enables registration in unicast DNS **for all names that end in the specified domain** |
44
+
| unicast_ip | CLOUD_PROVIDER_MDNS_UNICAST_IP | 127.0.0.1 | IP address on which the Unicast DNS server listens on for DDNS updates |
45
+
| unicast_domain | CLOUD_PROVIDER_MDNS_UNICAST_DOMAIN | k8s | DNS Domain to update. This the zone name the unicast DNS server is authoritative for. The FQDNs to be registered can be anything, including subdomains of that domain name. |
46
+
| unicast_key_name | CLOUD_PROVIDER_MDNS_KEY_NAME | <empty> | Name of the TSIG key authorised to update the unicast_domain |
47
+
| unicast_key_secret | CLOUD_PROVIDER_MDNS_KEY_SECRET | <empty> | The TSIG key authorised to update the unicast_domain |
48
+
49
+
36
50
## How to build this
37
51
38
52
Clone this repository, create a Python virtualenv (you'll need Python >= 3.12), then build and install:
0 commit comments