...
1
2A simple DNS server that can be used to find the IP address of a pod in a daemonset that is running on a given node.
3
4Requests should be of the form
5
6```
7<nodeName>.<daemonsetName>.<Namespace>.pod-locator.
8```
9
10Currently all requests that do not follow this pattern will not have an answer section.
11Currently only A type (ipv4) requests are answered.
12The server runs on port 5353.
13
14Currently any Daemonsets that are resolved using this server must be valid RFC 1123 DNS labels.
15This is in contrast to the kubernetes definition of a valid Daemonset name, which allows any valid DNS Subdomain Names.
16This means any Daemonset name that is longer that 63 characters or includes a `.` cannot be resolved using this resolver.
17
18The incoming DNS request must be a valid DNS name.
19This means its total length cannot be more than 253 characters, which means this resolver is unable to process requests for nodes with very long Node Names (Node Names must be valid DNS Subdomain Names, which means they cannot exceed 253 characters themselves, however the daemonset and namespace suffix required for this resolver will limit the length further).
20
21This resolver will accept node Names that have the `.` char.
22
23## Response format
24
25When a pod is found the response from the server includes a single DNS RR record of Type A.
26When a pod is not found the server responds with a DNS record with 0 answers.
27
28The TTL of the response is always set to 0.
29
30An example of querying the resolver and the reply using `dig` can be seen below
31
32```
33/ # dig @127.0.0.1 -p 5353 edge-worker2.vncserver.novnc-72516fb3.pod-locator.
34
35; <<>> DiG 9.16.36 <<>> @127.0.0.1 -p 5353 edge-worker2.vncserver.novnc-72516fb3.pod-locator.
36; (1 server found)
37;; global options: +cmd
38;; Got answer:
39;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 35526
40;; flags: qr rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
41;; WARNING: recursion requested but not available
42
43;; QUESTION SECTION:
44;edge-worker2.vncserver.novnc-72516fb3.pod-locator. IN A
45
46;; ANSWER SECTION:
47edge-worker2.vncserver.novnc-72516fb3.pod-locator. 0 IN A 10.244.2.4
48
49;; Query time: 0 msec
50;; SERVER: 127.0.0.1#5353(127.0.0.1)
51;; WHEN: Fri Jan 06 11:02:26 UTC 2023
52;; MSG SIZE rcvd: 132
53```
View as plain text