Skip to content

DO NOT MERGE: staging integration of the PXE stack and NetBox inventory observer - #89

Closed
scotwells wants to merge 17 commits into
mainfrom
staging/netbox-inventory
Closed

scotwells wants to merge 17 commits into
mainfrom
staging/netbox-inventory

Conversation

@scotwells

Copy link
Copy Markdown
Contributor

Purpose

This is a deployment branch, not a change proposal. Do not merge or review it as a unit. Review happens in the stacked PRs (#59 → #78 → #79 → #80 → #81 → #82 → #86 → #88).

The PR exists so CI runs on the exact commit an environment deploys. ci.yml runs only on pull requests and pushes to main. publish.yml publishes this branch as fleet-kustomize:v0.0.0-staging-netbox-inventory, plus immutable timestamped tags.

What it contains

The branch is built by merge commits. The only conflict was in config/README.md, where both sections were kept.

Keeping it current

When main or any stacked branch moves, merge it in and push:

git checkout staging/netbox-inventory
git merge origin/main origin/feat/netbox-inventory-import
git push

Each push republishes the floating tag. Delete the branch once the stack lands on main, and move environments back to v0.0.0-main.

Verification

Locally: go vet ./... and go test -race ./... pass, including the envtest suites with KUBEBUILDER_ASSETS. All kustomize build roots in ci.yml, the synthetic-staging, overlay-isolation, and standalone validators, the multiplane harness test, and doc-link validation also pass. The Docker build-context test was not run locally because there was no Docker daemon. CI results on this PR are the record.

🤖 Generated with Claude Code

scotwells and others added 17 commits November 18, 2026 13:11
Executor results now carry InputDigest, a SHA-256 commitment to the exact
request (minus its ID) computed by simulator.RequestDigest. The coordinator
rejects any terminal result whose digest does not match the request it
retained, treating the mismatch as an unknown outcome rather than success,
and returns the digest with each InstallationResult. The standalone install
phase checks the retained simulator history against it.

The executor contract documents exact-request replay and the meaning of
Lookup's not-found/unknown answers, and Lookup rejects dot-segment IDs.
Adversarial tests cover wrong-asset evidence, path-segment IDs and digest
binding of every request field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The standalone runner gains a reinstall phase: a distinct Installation that
names the initial Installation as its predecessor, on the same allocation,
recovering the same successor operation across retries and restarts. Before
each install the claim's Ready condition is set Unknown, so an unverified
completion closes readiness and keeps the capacity occupied.

hack/run-standalone-smoke.sh runs the full allocate, install, reinstall and
release lifecycle in a disposable kind cluster (task standalone:test). CI runs
its offline tests and a standalone-smoke job that executes it end to end.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The kind smoke restarts the simulator and immediately runs the recovery
phase. On a slow runner the phase's first request could reach no pod
while the Service moved to the new one, and the lifecycle correctly
reported that transport failure as an unknown outcome. The phase now
waits, without effect, until the simulator answers readiness through its
Service, so the recovery check measures recovery and not the handover.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
internal/localvm is a bounded libvirt executor behind the existing executor
contract. It boots a blank disk over iPXE from a digest-pinned installer,
admits one-time network boot only for the retained operation, verifies the
installed receipt from serial output and the domain's disappearance, then
boots disk-only. Recovery replays the retained request without a second
installer start; cleanup deletes only that binding's disks after verifying no
matching domain, and returns a request-bound clean result.

cmd/fleet-local-vm and hack/local-vm/run.sh drive allocation, install,
crash recovery, reinstall, cleanup and reuse through the shared lifecycle
library against a disposable Kubernetes API (task local-vm:acceptance, TCG
in the task-owned Colima profile). This is not KVM, hardware or production
qualification.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ned sites

One command (task multiplane:acceptance) composes the local VM executor with
native Milo project APIs, real Karmada delivery and reflection, and a
Kubernetes-native site in a dedicated Colima profile:

- internal/coordination defines the delivered handoff and journal-derived
  observation contract between management and a cell, with exact-request
  digests, epoch fencing and wrong-cell, stale and duplicate rejection.
- internal/multiplane drives allocation, install, release and reuse through
  the shared lifecycle library; Coordinator.ClaimReleased lets it avoid
  restoring protection after verified release.
- cmd/fleet-multiplane runs the management phases and the site roles.
- config/site holds the Flux-owned shared site services and a kro graph that
  creates only per-handoff RBAC and bounded worker Jobs; config/multiplane
  holds per-cluster Flux sources for Milo, Karmada, kro and the site.
- hack/multiplane runs the bounded phases, fault injection (worker Pod/Job
  interruption, delivery and reflection faults, wrong location, Flux drift,
  restart and fail-closed cases) and writes sanitized evidence.

CI runs the harness's offline tests and shellcheck. Production authority,
KVM and hardware remain unqualified.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
internal/redfish implements the executor contract over Redfish using gofish
v0.27.0 for transport and schema decoding, behind Fleet's own guards: exact
endpoint and System identity checks across every page of the Systems
collection, advertised allowable-value checks, no redirects or environment
proxy, bounded bodies and errors that never carry credentials or URLs. Each
boot override is one conditional PATCH (If-Match when an ETag is present)
with readback and no Settings fallback; each reset is one POST with no
resend. Recovery is observation-based and treats lost responses as Unknown.
On may be repeated, bounded to three attempts, only while the System is
still Off, armed and silent; this is not exactly-once delivery. Cleanup
PXE-boots a wipe environment that zeroes and reads back the disk.

task multiplane:redfish-acceptance runs the multi-plane composition with
Redfish workers that have no libvirt path, against the unmodified DMTF
Redfish Interface Emulator 1.2.2 and a lab-only libvirt adapter driving two
persistent lab VMs. Credentials are synthetic and per run. This is not
physical BMC or hardware qualification; see docs/operations/redfish-lab.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A network boot needs an address, but DHCP configured outside Fleet answers
every reboot and cannot prove provisioning access ended. Fleet now publishes
a reservation for a boot NIC only while its network boot is admitted, and
treats the DHCP owner's applied reports as evidence: no network boot before
a report shows the reservation served, and no completion until every
instance that served it reports it withdrawn.

- Enrollment records per-target BMC endpoints, endpoint-scoped System
  identity, and a static or synced DHCP mode with validated provisioning
  attachments.
- The site's dhcp-feed role serves the canonical feed and accepts
  authenticated, self-verifying applied reports on its own listener.
- fleet-dhcp-sync applies the feed to Kea through its control socket and
  reports only what Kea accepted.
- The boot network enhancement proposes the design; the operations guide
  records the implemented contract and what remains proposed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add InventoryObservation (fleet.datumapis.com/v1alpha1) and the
fleet-inventory-observer command. An operator names one NetBox device by
its stable ID; the observer copies an allowlist of recorded facts into the
observation's status with the read time, source revision, a content digest,
and the ObservedOnly-v1 trust profile.

Observations are evidence, not Devices or capacity. No controller reads
them, and they publish no supply and authorize no hardware effect. The
observer sends only GET requests to NetBox and writes only the status
subresource of existing observations in one namespace. Failed reads keep
the last facts and report Observed=False. A name or serial mismatch is an
IdentityMismatch, not an update.

config/inventory-observer packages the CRD, status-only RBAC, and a
CronJob as an opt-in root. No production root references it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Staging tracks this branch. It combines current main, which staging
already runs, with the PXE stack and the inventory observer, so moving
staging here does not drop main's multi-project manager or setup-fee
pricing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	config/README.md
Exercise the packaged Role, CRD validation, and status subresource
against a real API server: status-only writes, immutable source, stale
write conflict, and no trust-profile escalation. CI installs the
envtest assets that main already uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sources commonly ban clients that repeat failed authentication, and a
ban would also block every other client sharing the observer's egress
address. After the first 401 or 403 in a run, mark the remaining
observations SourceUnauthorized without another request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@scotwells

Copy link
Copy Markdown
Contributor Author

Closed and replaced by #91. The inventory change was reworked so that Fleet no longer integrates with an external inventory system (see #90, which replaces #88). The deploy-only branch was rebuilt from current main plus the reworked stack, and renamed to staging/inventory-integration so that neither the branch nor its published tags name that system.

@scotwells scotwells closed this Nov 19, 2026
@scotwells
scotwells deleted the staging/netbox-inventory branch November 19, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant