plugin/k8s_external: Resolve headless services (#5505)

*add option for resolving headless Services without external IPs in k8s_external

Signed-off-by: Tomas Kohout <tomas.kohout1995@gmail.com>
This commit is contained in:
TomasKohout
2022-08-30 20:59:27 +02:00
committed by GitHub
parent b218b56063
commit 6782b7fb42
15 changed files with 491 additions and 81 deletions

View File

@@ -2,12 +2,12 @@
## Name
*k8s_external* - resolves load balancer and external IPs from outside Kubernetes clusters.
*k8s_external* - resolves load balancer, external IPs from outside Kubernetes clusters and if enabled headless services.
## Description
This plugin allows an additional zone to resolve the external IP address(es) of a Kubernetes
service. This plugin is only useful if the *kubernetes* plugin is also loaded.
service and headless services. This plugin is only useful if the *kubernetes* plugin is also loaded.
The plugin uses an external zone to resolve in-cluster IP addresses. It only handles queries for A,
AAAA, SRV, and PTR records; all others result in NODATA responses. To make it a proper DNS zone, it handles
@@ -57,6 +57,16 @@ k8s_external [ZONE...] {
* **APEX** is the name (DNS label) to use for the apex records; it defaults to `dns`.
* `ttl` allows you to set a custom **TTL** for responses. The default is 5 (seconds).
If you want to enable headless service resolution, you can do so by adding `headless` option.
~~~
k8s_external [ZONE...] {
headless
}
~~~
* if there is a headless service with external IPs set, external IPs will be resolved
## Examples
Enable names under `example.org` to be resolved to in-cluster DNS addresses.