Skip to content
Merged
6 changes: 5 additions & 1 deletion cmd/fleet-multiplane/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"go.datum.net/fleet/internal/multiplane"
"go.datum.net/fleet/internal/redfish"
"go.datum.net/fleet/internal/site"
"go.datum.net/fleet/internal/site/redfishwork"
)

func main() {
Expand All @@ -32,7 +33,7 @@ func main() {

func run() error {
if len(os.Args) < 2 {
return fmt.Errorf("usage: fleet-multiplane coordinator|site-worker|site-observer|image|boot-service|boot-withhold|boot-denials|dhcp-feed|redfish-probe|<management phase> [flags]")
return fmt.Errorf("usage: fleet-multiplane coordinator|site-worker|site-observer|image|boot-service|boot-withhold|boot-denials|dhcp-feed|dhcp-retire|redfish-probe|<management phase> [flags]")
}
fs := flag.NewFlagSet(os.Args[1], flag.ContinueOnError)
once := fs.Bool("once", false, "one attempt, for fault injection")
Expand All @@ -52,6 +53,7 @@ func run() error {
syncToken := fs.String("sync-token-file", "", "file holding the DHCP synchronizer bearer token (dhcp-feed)")
installationDeadline := fs.Duration("installation-deadline", 0, "replace the installation deadline for operations this coordinator admits (coordinator)")
skewMargin := fs.Duration("skew-margin", 0, "replace the margin after a deadline before the coordinator declares it exceeded (coordinator)")
instance := fs.String("instance", "", "DHCP instance an operator retires (dhcp-retire)")
if err := fs.Parse(os.Args[2:]); err != nil {
return err
}
Expand Down Expand Up @@ -82,6 +84,8 @@ func run() error {
return boot(os.Args[1], *origin, *extraMAC, *syncToken)
case "boot-withhold":
return armWithhold(fs.Arg(0))
case "dhcp-retire":
return redfishwork.RetireInstance(os.Getenv("FLEET_BOOT_EVIDENCE"), *instance)
case "site-worker", "site-observer":
default:
return fmt.Errorf("unknown command")
Expand Down
8 changes: 1 addition & 7 deletions cmd/fleet-multiplane/site.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,13 +253,7 @@ func boot(command, origin, extraMAC, syncToken string) error {
return err
}
if command == "dhcp-feed" {
// Reservations name each Device's provisioning attachment, which
// only the enrollment records.
enrollment, err := redfish.ParseEnrollment([]byte(os.Getenv("FLEET_REDFISH_ENROLLMENT")))
if err != nil {
return err
}
server.Enrollment = enrollment
// Reservations come from the admitted operations in the store.
token, err := os.ReadFile(syncToken)
if err != nil {
return fmt.Errorf("DHCP synchronizer token: %w", err)
Expand Down
11 changes: 11 additions & 0 deletions config/components/boot-addresses/boot-address-checker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: iam.miloapis.com/v1alpha1
kind: Role
metadata:
name: fleet.datumapis.com-boot-address-checker
annotations:
kubernetes.io/display-name: Fleet Boot Address Checker
kubernetes.io/description: The custody coordinator at a site whose DHCP Fleet synchronizes. Reads an operation's boot address claim at admission.
spec:
launchStage: Alpha
includedPermissions:
- ipam.miloapis.com/ipclaims.get
14 changes: 14 additions & 0 deletions config/components/boot-addresses/boot-address-requester.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: iam.miloapis.com/v1alpha1
kind: Role
metadata:
name: fleet.datumapis.com-boot-address-requester
annotations:
kubernetes.io/display-name: Fleet Boot Address Requester
kubernetes.io/description: The Fleet provider for Metal and the release controller at a site whose DHCP Fleet synchronizes. Claims and releases the boot address of each installation and wipe.
spec:
launchStage: Alpha
includedPermissions:
- ipam.miloapis.com/ipclaims.create
- ipam.miloapis.com/ipclaims.get
- ipam.miloapis.com/ipclaims.list
- ipam.miloapis.com/ipclaims.delete
11 changes: 11 additions & 0 deletions config/components/boot-addresses/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Roles for boot address claims, which only a site whose DHCP Fleet
# synchronizes uses (docs/operations/boot-network.md). No overlay includes
# this component, so no environment grants Fleet any IPAM permission until
# it enables boot addresses: it then includes this component and binds the
# requester role to the installation and wipe requesters and the checker
# role to the custody coordinator.
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- boot-address-requester.yaml
- boot-address-checker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,28 @@ spec:
minLength: 1
maxLength: 63
x-kubernetes-list-type: set
bootNetwork:
type: object
properties:
addressClaim:
type: object
properties:
name:
type: string
minLength: 1
maxLength: 253
required:
- name
address:
type: string
minLength: 2
maxLength: 45
x-kubernetes-validations:
- rule: isIP(self)
message: address must be one IP address without a prefix length
required:
- addressClaim
- address
required:
- creator
- deviceRef
Expand Down Expand Up @@ -714,6 +736,35 @@ spec:
minLength: 1
maxLength: 63
x-kubernetes-list-type: set
# Optional in the schema so wipes stored before it existed stay
# valid; admission refuses a wipe whose boot interface the
# Device does not record with a MAC address.
bootInterface:
type: string
minLength: 1
maxLength: 63
bootNetwork:
type: object
properties:
addressClaim:
type: object
properties:
name:
type: string
minLength: 1
maxLength: 253
required:
- name
address:
type: string
minLength: 2
maxLength: 45
x-kubernetes-validations:
- rule: isIP(self)
message: address must be one IP address without a prefix length
required:
- addressClaim
- address
required:
- creator
- deviceRef
Expand Down
9 changes: 5 additions & 4 deletions config/site/redfish/graph/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ patches:
- {name: FLEET_SITE_CREDENTIALS_NAMESPACE, value: fleet-site-credentials}
- {name: FLEET_SITE_PROJECT, value: provider}
# Explicit site enrollment: each Device maps to exactly one BMC
# endpoint, Redfish System (Id and UUID), NIC and console capture.
# The lab's dnsmasq hands out static leases, so DHCP is "static" and
# targets carry no provisioning attachment. Only target A is
# endpoint, Redfish System (Id and UUID) and console capture. The
# boot NIC comes from Device inventory. The lab's dnsmasq hands out
# static leases, so DHCP is "static" and an operation carries no
# boot address. Only target A is
# published as capacity; target B is enrolled to prove isolation.
- name: FLEET_REDFISH_ENROLLMENT
value: '{"dhcp":"static","targets":[{"device":"fleet-provider/synthetic-device-central-01","endpoint":"https://10.96.0.81:8443","systemID":"System-1","systemUUID":"7f3d0c2e-1a5b-4c6d-8e9f-0a1b2c3d4e0a","mac":"52:54:00:77:01:0a","diskBytes":2147483648,"console":"target-a.log"},{"device":"fleet-provider/synthetic-device-central-02","endpoint":"https://10.96.0.81:8443","systemID":"System-2","systemUUID":"7f3d0c2e-1a5b-4c6d-8e9f-0a1b2c3d4e0b","mac":"52:54:00:77:01:0b","diskBytes":2147483648,"console":"target-b.log"}]}'
value: '{"dhcp":"static","targets":[{"device":"fleet-provider/synthetic-device-central-01","endpoint":"https://10.96.0.81:8443","systemID":"System-1","systemUUID":"7f3d0c2e-1a5b-4c6d-8e9f-0a1b2c3d4e0a","diskBytes":2147483648,"console":"target-a.log"},{"device":"fleet-provider/synthetic-device-central-02","endpoint":"https://10.96.0.81:8443","systemID":"System-2","systemUUID":"7f3d0c2e-1a5b-4c6d-8e9f-0a1b2c3d4e0b","diskBytes":2147483648,"console":"target-b.log"}]}'
- {name: HOME, value: /tmp}
- op: replace
path: /spec/resources/9/template/spec/template/spec/containers/0/volumeMounts
Expand Down
1 change: 1 addition & 0 deletions docs/development/device-custody.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ them.
| Synthetic staging mode | **Implemented.** The manager's flag handling is unit tested, and no run exercises the mode |
| Power projector | **Implemented and verified** by the standalone smoke |
| Synchronized DHCP feed on the site store | **Implemented and verified** by a unit test. Not exercised at a site |
| Boot addresses from IPAM as installation and wipe inputs | **Implemented and verified** by tests against a real API server with a stand-in for IPAM's claim API. **Inert** end to end: no run sets a provisioning class. See [Boot network](../operations/boot-network.md) |

### MachineAllocation

Expand Down
2 changes: 1 addition & 1 deletion docs/operations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ integrations. Real provider support and live Milo acceptance tests are incomplet
| Understand the local VM site that the multi-plane run drives | [Local VM site](local-vm.md) | The workers that install a real OS over firmware PXE into a disposable libvirt domain, boot it from disk, and wipe it; the single-plane harness is retired; not KVM or hardware qualification |
| Exercise Milo, Karmada and cell-local PXE end to end with one command | [Multi-plane acceptance](multiplane.md) (`task multiplane:acceptance`) | Native project routing, the custody coordinator, federation delivery/reflection, partition, [Kubernetes site execution](site-execution.md) (Flux-owned shared services, kro-created per-operation Jobs) with worker Pod/Job interruption, delivery and reflection faults, wrong location, release with a wipe and reuse; the run on the custody path passes every phase; every service [installed by per-cluster Flux](gitops.md) from a source built from the checkout; production authority unqualified |
| Drive the same pipeline through Redfish instead of libvirt | [Redfish-mode acceptance](redfish-lab.md) (`task multiplane:redfish-acceptance`) | Redfish site workers: per-Device credentials over a pinned TLS key, one-time PXE/disk boot overrides, power, lost-response recovery and a booted wipe, against the unmodified DMTF Redfish Interface Emulator with a lab-only libvirt adapter and two persistent lab VMs; synthetic credentials and networking; the run on custody passes every phase; not physical BMC or hardware qualification |
| Publish physical-side DHCP reservations for network boot | [Boot network](boot-network.md) | Per-Device BMC endpoints and provisioning attachments, a reservation feed read from the site store that exists only while a boot is admitted, served and withdrawn evidence from the DHCP owner's Kea synchronizer; unit tested, not exercised at a site |
| Publish DHCP reservations for network boot | [Boot network](boot-network.md) | Boot addresses claimed from IPAM per installation and wipe, boot NICs from Device inventory, a reservation feed read from the site store that exists only while a boot is admitted, served and withdrawn evidence from the Kea synchronizer; tested against a real API server and unit tested, not exercised at a site |
| Plan a rack slot and register the server bound to it | [Planning and registering physical devices](physical-inventory.md) | Operator-written `DeviceClaim` and `Device` records in the provider project in Milo, with immutable identity and binding, shown read-only in the staff portal; no capacity or hardware effect; unit tested |
| Record what each Device's BMC reports | [BMC discovery](bmc-discovery.md) | Read-only Redfish discovery into Device status, with TLS public-key pinning approved per BMC and identity compared with spec; unit and TLS end-to-end tested, not qualified on vendor hardware |
| Render deployment bundles and supply environment inputs | [Deployment manifests](../../config/README.md) | Packaging and security boundaries, not runtime readiness |
Expand Down
Loading
Loading