plugin/kubernetes: Add support for topology-aware headless services via "az-pinned" subdomains (#8388)

This commit is contained in:
rpb-ant
2026-08-10 16:24:50 -04:00
committed by GitHub
parent b2ef1a13e8
commit c2ca1b2c23
10 changed files with 624 additions and 39 deletions

View File

@@ -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
}