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:
parent
b218b56063
commit
6782b7fb42
15 changed files with 491 additions and 81 deletions
|
@ -112,7 +112,7 @@ func (k *Kubernetes) Services(ctx context.Context, state request.Request, exact
|
|||
|
||||
case dns.TypeNS:
|
||||
// We can only get here if the qname equals the zone, see ServeDNS in handler.go.
|
||||
nss := k.nsAddrs(false, state.Zone)
|
||||
nss := k.nsAddrs(false, false, state.Zone)
|
||||
var svcs []msg.Service
|
||||
for _, ns := range nss {
|
||||
if ns.Header().Rrtype == dns.TypeA {
|
||||
|
@ -127,7 +127,7 @@ func (k *Kubernetes) Services(ctx context.Context, state request.Request, exact
|
|||
}
|
||||
|
||||
if isDefaultNS(state.Name(), state.Zone) {
|
||||
nss := k.nsAddrs(false, state.Zone)
|
||||
nss := k.nsAddrs(false, false, state.Zone)
|
||||
var svcs []msg.Service
|
||||
for _, ns := range nss {
|
||||
if ns.Header().Rrtype == dns.TypeA && state.QType() == dns.TypeA {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue