Repository navigation
feat(site): Run each site's Kea centrally - #197
Conversation
02cfd99 to
a67a47f
Compare
dcd1e10 to
9cf7324
Compare
a67a47f to
7133e23
Compare
9cf7324 to
8338335
Compare
7a1d49b to
6bc39b4
Compare
83393e9 to
b30485e
Compare
f417f2d to
ce8b479
Compare
ecv
left a comment
There was a problem hiding this comment.
Approve.
Central Kea per site is isolated by construction and well guarded: the base config has no pools (only reserved MACs are answered, asserted in hack/validate-site-dhcp-render.sh), each site runs its own Kea StatefulSet (two replicas), base subnets and relay filter, Feed refuses a duplicate MAC or address, and the feed serves only names in the enrollment's expected set. Nothing deploys it, and the new CI check renders every root to prove that. I mutated the instance-name check on the feed, the served-feed echo check, the issued-after-publish gate, the rejected-contact gate, the Serves check on published reservations, the two-subnets check and the duplicate-address check; each failed a test.
- Outage behavior is fail-safe for address reuse, not for exposure: when the feed or WAN is down, Kea keeps serving its last applied reservation past
Expiresand after the boot closed, becausedhcpsync.configignoresExpires. The address stays claimed (withdrawal cannot be proven, so the operation goes unknown and the hold keeps the claim), so it cannot reach another Device, but the stale reservation stays live for as long as the outage lasts.
Follow-ups:
- Drop reservations whose
Expireshas passed in the synchronizer, so a feed outage ends a boot window at the DHCP server and not only in the bookkeeping. - One bearer token is shared by every instance of a site and the instance name is a self-asserted header, so any instance (or token holder) can fetch and report under a sibling's name and complete the withdrawal proof for it. Instance names also repeat across sites (
fleet-site-dhcp-0/-1), so separation between sites rests only on each site's feed URL, token and CA: a Kea handed another site's credentials is accepted as that site's instance. Issue a token per instance and bind the site and instance name to it. - The Kea container runs as UID 0 with only
NET_BIND_SERVICEadded; the render check should also assert a NetworkPolicy limiting ingress to UDP 67 and egress to the feed on 8081, since the central namespace is shared with other work. The namespace is a fixedfleet-site, so two sites in one central cluster collide; say how a second site is namespaced. - "Synchronized Redfish acceptance and the Kea lab pass" is unchecked. Keep it unchecked until a run passes, and record it before any site is set to synchronized.
- A replica whose synchronizer stopped while Kea keeps serving is undetected (already noted in the body); an on-call alert on a missing report from any expected instance is the cheap mitigation.
Add a site DHCP component: the reservation feed beside the boot service, now served only over TLS, and Kea DHCPv4 instances with their synchronizers on host-networked nodes. The synchronizer gains a CA option and Kea 2.6's socket path. A render check runs in CI, and a lab runs real Kea, the synchronizer and the feed with a DHCP client to prove a boot NIC is answered only while its admission is open. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Kea 2.6 refuses a control socket directory that is not 0750, and an emptyDir is created 0777, so Kea's command sets the mode first. The lab now runs Kea with the component's capabilities and socket directory and requires the client's "no lease" for every refusal. The render check covers the mode, volume mounts and selectors, and the docs state the relay filter, required Secrets, rotation, and what the lab proves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The feed reads only the site store and writes reports beside the boot evidence, but it built a full boot server, so it needed a boot origin and the installer artifacts that the feed container does not have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add run.sh --redfish --synced-dhcp. The lab network loses its own DHCP; Kea and the synchronizer run in the runtime Pod on the lab bridge, the reservation feed runs beside the boot service, and a synthetic IPAM stand-in binds boot address claims. A new phase requires each install and wipe to carry its own claim, Kea to serve each reservation only while its boot is open, and firmware to lease from Kea, not dnsmasq. The feed becomes its own component, shared with the site Kea one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Require a Kea lease for the boot MAC at each operation's address granted inside that operation's boot window, for every operation that powered on for a network boot, two installations and two wipes. Start Kea only once the lab bridge has its address, describe the held second installation plainly, and mark the synced mode as not yet run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Operations no longer carry their claim's UID, so the synced DHCP phase requires distinct claim names, which derive from distinct operations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DHCP no longer runs at the site. The Kea component deploys once per site to a central cluster: no host networking, Kea on a UDP socket for relayed requests only and not authoritative, and several replicas behind one UDP 67 load-balancer address that the site's relays reach over the WAN link. Client-IP affinity keeps each relay on one replica, so the replicas give availability, not load sharing per relay. The synchronizer reaches the site's feed over TLS at FLEET_DHCP_FEED_URL, and the feed component stays beside the boot service. The example base configuration drops the TFTP server and answers the UEFI HTTP boot vendor class with the boot service's loader URL. The docs state the reply path, the WAN dependency, why the fence and the withdrawal proof still hold, and that serving the HTTP boot loader from a central boot service is still proposed. The render check covers the new shape. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A synced Redfish enrollment now names its expected DHCP instances (dhcpInstances). The workers and the reservation feed read the same enrollment. The feed serves a feed only to an expected instance, named on the request, and refuses and does not retain a report from any other. Every served feed carries the time it was issued, outside its revision. Withdrawal is proven only when every expected instance's latest report is of a feed issued after the admission was stored and serves none of the Device's reservations. An expected instance that never reported, or that fetched the reservation and stopped before reporting, keeps the outcome unknown. The admission records when it was stored (published), because its creation time is read before the store write. Retiring an instance is now only shrinking the expected set; the dhcp-retire command and the lab's retire path are gone, and retained retirement records are ignored. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Removing a name from dhcpInstances drops that instance from the
withdrawal proof, but not its replica, which could keep serving its last
reservations behind the shared load balancer.
The feed now retains each authenticated contact it refuses for a missing
or undeclared instance, {at, instance, rejected: true}, synced before the
403, at most once per instance name every 30 seconds. A failure to
retain still refuses; unauthenticated requests are never recorded.
The withdrawal gate blocks while any refused contact was retained at or
after the admission was published, and passes no earlier than 45
seconds after it, so the rate limit cannot hide a replica that is still
polling. Refused contacts are never evidence of serving or withdrawal.
A replica whose synchronizer stopped while Kea keeps serving is still
not seen; the docs state that limit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Client-IP affinity sends all of one relay's traffic to one Kea instance, so the replicas give availability, not load sharing per relay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An expected instance that applied the empty feed before an admission was published and never fetched the reservation's revision kept a latest report issued before publication, and never reported again, so the withdrawal proof waited forever on a healthy instance. The synchronizer now also reports its applied feed again, with the issue time of its latest fetch, once that time is newer than its last report's and the refresh interval (default 30 s, -refresh) has passed. A changed revision is still reported at once, and a refused report is not taken as sent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A token holder could post an empty feed with any issue time and satisfy the withdrawal proof. The feed now remembers, in memory, the last 32 (issue time, revision) pairs it served to each instance and refuses with 409, without retaining it, a report matching none. After a feed restart reports are refused until the instance fetches again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The withdrawal rule compares against the admission's publication time. The single-clock assumption rests on the feed and workers sharing a ReadWriteOnce volume, so one node. State the refresh interval and the log growth it causes, the 409 for unbound reports, and that production Kea uses a UDP socket with NET_BIND_SERVICE only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The site now keys each admission's records by its kind, name and fence, not by the operation's object UID. The synchronized DHCP check reads each operation's boot record and boot log under that key, and runs only in the scenario groups that release the lab target. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A render check builds every kustomization root under config/ and fails if any root other than the DHCP components, their example and the Redfish lab's synchronized mode renders a Kea server, the synchronizer, the reservation feed, a UDP 67 listener or a synced enrollment. Each opt-in root must render one, so the list stays exact. CI runs it beside the DHCP render check. The feed's refusal of a static enrollment moves into one function with a test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The check now finds the feed and the synchronizer by binary name, by path or inside a shell command, and Kea by image or command. It flags UDP 67 on a container or a Service's target port, the lab's synced DHCP switch, and any role granting IPAM permissions outside the boot address roles. It also renders roots under every kustomization file name. The synchronized DHCP evidence skips refused contacts, which carry no feed, and the boot network doc says which lab mode sets a boot address class. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
283073c to
5617a92
Compare
ecv
left a comment
There was a problem hiding this comment.
Approve.
Rebase onto the merged power stack. Range-diff against my last review shows only conflict resolutions: the site component now sits after redfishKinds, and the lab coordinator role gains devicepoweroperations alongside the other kinds. No behaviour change in this PR's own commits.
Each site's DHCP service can now run in a central cluster: several Kea instances behind one address that the site's relays reach over its WAN link, each fed the site's reservations by a synchronizer, with the reservation feed beside the site's boot service. A synchronized site names the DHCP instances it expects, and a reservation counts as withdrawn only once every one of them reports a feed issued after it, so retiring an instance means stopping it and then removing its name. It also adds a Redfish lab mode where Kea is the guest's only DHCP, which has not passed a run yet. Stacked on #194.
Related to #186
How it stays inactive
Nothing deploys it. Only the DHCP components, their render example and the lab's synchronized mode include any of it, no environment configuration sets a site to synchronized DHCP, and the feed refuses to start for a site whose enrollment leaves DHCP to the site. A new CI check renders every configuration root in the repository and fails if any other root starts a Kea server, the synchronizer, the feed, a DHCP listener, a synchronized enrollment or lab switch, or grants IPAM permissions. Adding the feed to a site without its two Secrets stops that site's boot service, so nothing but an explicit choice may include it.
Decisions for a person
Test plan
gh pr checksentry green on the head, including the default-off render check and the multi-plane acceptance🤖 Generated with Claude Code