Wait for HA peer DNS before starting kea-dhcp4 #5

Merged
benvin merged 1 commits from benvin/ha-peer-dns-wait into main 2026-08-08 22:43:13 +10:00
Owner

Why

After v0.1.2 fixed the socket dir perms, kea-dhcp4 reaches the HA hook and crash-loops on a cold container start. The HA hook resolves the StatefulSet peer URL hostnames once at config load, but the peer DNS records aren't resolvable in the first moment of a fresh container's network, and kea exits hard instead of retrying:

HA_CONFIGURATION_FAILED ... bad url 'http://kea-0.kea-headless.dhcp-system:8000/': Failed to convert string to address ...

Verified in-cluster: the exact rendered config passes kea-dhcp4 -t once DNS is warm (hostnames, FQDNs, and IPs all validate) — so this is purely a startup race, not an invalid config.

How

  • gate the dhcp4 entrypoint on kea-dhcp4 -t and retry (up to ~2m) until the config validates, then exec the server

Needs a v0.1.3 release so argocd-apps can bump the operator image.

## Why After v0.1.2 fixed the socket dir perms, kea-dhcp4 reaches the HA hook and crash-loops on a cold container start. The HA hook resolves the StatefulSet peer URL hostnames once at config load, but the peer DNS records aren't resolvable in the first moment of a fresh container's network, and kea exits hard instead of retrying: ``` HA_CONFIGURATION_FAILED ... bad url 'http://kea-0.kea-headless.dhcp-system:8000/': Failed to convert string to address ... ``` Verified in-cluster: the exact rendered config passes `kea-dhcp4 -t` once DNS is warm (hostnames, FQDNs, and IPs all validate) — so this is purely a startup race, not an invalid config. ## How - gate the dhcp4 entrypoint on `kea-dhcp4 -t` and retry (up to ~2m) until the config validates, then exec the server Needs a v0.1.3 release so argocd-apps can bump the operator image.
unkinben added 1 commit 2026-08-08 22:38:32 +10:00
Wait for HA peer DNS before starting kea-dhcp4
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
f20b26fd71
## Why
kea-dhcp4 crash-loops on a cold container start: the HA hook resolves the StatefulSet peer URL hostnames once at config load, but the peer DNS records are not resolvable in the first moment of a fresh container, and kea exits hard instead of retrying (HA_CONFIGURATION_FAILED / "Failed to convert string to address"). Once DNS is warm the exact config validates, so the failure is purely a startup race.

## How
- gate the dhcp4 entrypoint on `kea-dhcp4 -t` and retry until the config validates before exec'ing the server
benvin merged commit 31ac4f73b4 into main 2026-08-08 22:43:13 +10:00
benvin deleted branch benvin/ha-peer-dns-wait 2026-08-08 22:43:13 +10:00
Sign in to join this conversation.