mirror of
https://github.com/coredns/coredns.git
synced 2026-08-20 23:08:28 -04:00
plugin/kubernetes: Add support for topology-aware headless services via "az-pinned" subdomains (#8388)
This commit is contained in:
@@ -207,6 +207,11 @@ func ParseStanza(c *caddy.Controller) (*Kubernetes, error) {
|
||||
return nil, c.ArgErr()
|
||||
}
|
||||
k8s.opts.initEndpointsCache = false
|
||||
case "zonal":
|
||||
if len(c.RemainingArgs()) != 0 {
|
||||
return nil, c.ArgErr()
|
||||
}
|
||||
k8s.opts.zonal = true
|
||||
case "ignore":
|
||||
args := c.RemainingArgs()
|
||||
if len(args) > 0 {
|
||||
@@ -297,6 +302,13 @@ func ParseStanza(c *caddy.Controller) (*Kubernetes, error) {
|
||||
}
|
||||
}
|
||||
|
||||
if k8s.opts.zonal && !k8s.opts.initEndpointsCache {
|
||||
// Zone-scoped names are answered from the endpoint cache;
|
||||
// without it every zonal name would contradict the documented
|
||||
// noendpoints behavior (NXDOMAIN for all headless queries).
|
||||
return nil, c.Errf("zonal requires the endpoint cache; remove noendpoints")
|
||||
}
|
||||
|
||||
return k8s, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user