Notify secondaries immediately on primary zone changes #13
Reference in New Issue
Block a user
Delete Branch "benvin/notify-secondaries"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The k8s authoritative cluster is a 3-pod set (pod-0 primary + 2 secondaries) behind one serve VIP. Records are written by RFC2136 dynamic update onto the primary only. They were reaching the secondaries only on the hardcoded 1-hour SOA refresh, because the operator configured no NOTIFY and a seed zone's only apex NS is the primary itself (so BIND's default
notify yeshad no secondary to notify). Meanwhile the serve VIP kept load-balancing queries onto the stale secondaries, which returned NXDOMAIN; downstream resolvers negatively cached that for the 300s SOA minimum. Net effect: a record (e.g.cobbler.main.unkin.net) flapped between correct and NXDOMAIN for up to an hour after every update to the zone.Changes:
notify explicit+also-notify { <secondary pod IPs> }to primary zone stanzas for catalog-member zones, so a change (in particular a dynamic update) NOTIFYs the secondaries for an immediate IXFR instead of waiting for the SOA refresh.notify explicitscopes NOTIFY to the pod IPs and keeps it off the query-serving VIP.secondaryPodIPshelper that lists the cluster's non-primary pods with an IP (sorted for stable, churn-free config). Pod-list RBAC already exists on the manager role.rndc modzone, so existing zones (main.unkin.net et al.) pick this up on the next reconcile without recreation. The zone controller's periodic requeue refreshes the also-notify set if a secondary pod IP changes.Tests: added unit tests asserting the also-notify rendering (with and without secondaries);
go build,go vet,go test ./internal/...all pass.d5e08607c1to6a07f91ea1