Disable HA hook dedicated listener; route HA via ctrl-agent #8
Reference in New Issue
Block a user
Delete Branch "benvin/ha-listener-bind"
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?
Why
After v0.1.4 (commit
66ae5f5) pointed HA peer URLs at per-pod ClusterIP Services, kea-dhcp4 2.6 now starts the HA service ("HA_SERVICE_STARTED server0: started high availability service in hot-standby mode as primary server") but immediately crashes at hook load:With core multi-threading enabled (the Kea 2.6 default), the HA hook opens a dedicated HTTP listener bound to this server's own peer url address. That address is now a per-pod ClusterIP — virtual (kube-proxy DNAT) and not assignable on the pod — so the bind fails. Peers must be reachable via ClusterIP, but the local listener must bind a pod-local address.
How
multi-threadingblock withhttp-dedicated-listener: false(enable-multi-threading: true). Per the Kea 2.6 docs, disabling the dedicated listener routes inbound HA traffic through kea-ctrl-agent instead of a hook-owned listener.kea-ctrl-agentsidecar already binds0.0.0.0:8000, and each per-pod Service'stargetPort 8000routesClusterIP:8000to that container. Remote peers keep reaching this server at its stable ClusterIP; nothing binds the virtual address locally.Rendered HA block now:
Tests
TestHADedicatedListenerDisabled— rendered dhcp4 config disables the dedicated listener (string assertion + parsedhigh-availability.multi-threadingmap).TestRenderCtrlAgentextended — ctrl-agent binds0.0.0.0(the pod-local address the CA-mediated HA route depends on).make test/go vet/ build all green.