Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
17c7d36
docs: propose secure customer BMC access
scotwells Nov 11, 2026
14ff0fb
docs: keep allocation UIDs internal
scotwells Nov 11, 2026
2740645
prototype secure machine management access
scotwells Nov 12, 2026
e3bec5b
ci: qualify secure BMC prototype branch
scotwells Nov 12, 2026
a5f75f4
ci: install tools in runner temp directory
scotwells Nov 12, 2026
2e5c110
ci: surface end-to-end failure details
scotwells Nov 12, 2026
8020e84
e2e: give Redfish validators writable workdirs
scotwells Nov 12, 2026
3dabd1a
e2e: fence gateway restart and preserve ownership
scotwells Nov 12, 2026
d896513
ci: run qualification on pull requests
scotwells Nov 12, 2026
758ebd7
Merge remote-tracking branch 'origin/main' into prototype/secure-bmc-…
scotwells Nov 12, 2026
f612f64
build: include public API in manager image
scotwells Nov 12, 2026
5781a3c
feat: federate management sessions with Karmada
scotwells Nov 12, 2026
82531f2
docs: simplify secure BMC access design
scotwells Nov 12, 2026
c06fc68
Merge remote-tracking branch 'origin/main' into prototype/secure-bmc-…
scotwells Nov 12, 2026
6a1a3b6
Merge remote-tracking branch 'origin/main' into prototype/secure-bmc-…
scotwells Nov 12, 2026
2f886b6
feat: align secure BMC access with machine allocations
scotwells Nov 12, 2026
865cb51
fix: update manager image build context
scotwells Nov 12, 2026
b70f7f3
test: allow first Karmada projection to settle
scotwells Nov 12, 2026
75ae0b9
ci: sanitize virtual BMC evidence artifacts
scotwells Nov 12, 2026
b7aea90
fix: make session binding admission idempotent
scotwells Nov 12, 2026
c0cbf80
fix: retain current service catalog dependency
scotwells Nov 12, 2026
fa5c212
feat: integrate secure BMC prototype with Metal API boundaries
scotwells Nov 12, 2026
bccf896
Merge remote-tracking branch 'origin/prototype/secure-bmc-access-ci' …
scotwells Nov 12, 2026
d652a6f
docs: detail Secure BMC production authorization plan
scotwells Nov 12, 2026
8743d40
feat: integrate secure BMC sessions with lifecycle custody
scotwells Nov 13, 2026
e93fffe
fix(e2e): require real Redfish schema coverage and preserve failure e…
scotwells Nov 13, 2026
a428b67
Wire synthetic BMC sessions through lifecycle custody
scotwells Nov 13, 2026
c86c23c
Merge remote-tracking branch 'origin/main' into t3/secure-bmc-fleet-sync
scotwells Nov 13, 2026
0063dce
test(e2e): exercise custody-backed fixtures and guarded lifecycle rel…
scotwells Nov 13, 2026
62d88c4
fix: isolate session fixture CLI flags from controller runtime
scotwells Nov 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ jobs:
with: {go-version-file: go.mod, cache: true}
- uses: imranismail/setup-kustomize@v2
with: {kustomize-version: 5.8.1}
- name: Verify session and coordination CRD generation
run: |
go run sigs.k8s.io/controller-tools/cmd/controller-gen@v0.23.0 crd paths="./internal/api/session/...;./internal/api/coordination/..." output:crd:artifacts:config=config/crd/bases
git diff --exit-code -- config/crd/bases
- run: kustomize build config/crd >/dev/null
- run: kustomize build config/federation >/dev/null
- run: kustomize build config/manager >/dev/null
- run: kustomize build config/location >/dev/null
- run: go test ./...
- run: go test -race ./...
- run: go vet ./...
Expand Down
89 changes: 89 additions & 0 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: machine-management-e2e

on:
pull_request:
push:
branches:
- main

permissions:
contents: read

jobs:
virtual-bmc:
runs-on: ubuntu-24.04
timeout-minutes: 50
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Install pinned tools
run: |
set -euxo pipefail
tools_bin="${RUNNER_TEMP}/fleet-tools"
mkdir -p "${tools_bin}"
curl -fsSL https://github.com/kubernetes-sigs/kind/releases/download/v0.33.0/kind-linux-amd64 -o "${tools_bin}/kind"
curl -fsSL https://github.com/kubernetes-sigs/kind/releases/download/v0.33.0/kind-linux-amd64.sha256sum -o /tmp/kind.sha256
sed "s#kind-linux-amd64#${tools_bin}/kind#" /tmp/kind.sha256 | sha256sum -c -
chmod 0755 "${tools_bin}/kind"
curl -fsSL https://dl.k8s.io/release/v1.37.0/bin/linux/amd64/kubectl -o "${tools_bin}/kubectl"
curl -fsSL https://dl.k8s.io/release/v1.37.0/bin/linux/amd64/kubectl.sha256 -o /tmp/kubectl.sha256
echo "$(cat /tmp/kubectl.sha256) ${tools_bin}/kubectl" | sha256sum -c -
chmod 0755 "${tools_bin}/kubectl"
helm_version=v3.17.3
curl -fsSL "https://get.helm.sh/helm-${helm_version}-linux-amd64.tar.gz" -o /tmp/helm.tgz
curl -fsSL "https://get.helm.sh/helm-${helm_version}-linux-amd64.tar.gz.sha256sum" -o /tmp/helm.sha256
helm_sha=$(awk '{print $1}' /tmp/helm.sha256)
echo "${helm_sha} /tmp/helm.tgz" | sha256sum -c -
tar -xzf /tmp/helm.tgz -C /tmp
install -m 0755 /tmp/linux-amd64/helm "${tools_bin}/helm"
GOBIN="${tools_bin}" go install github.com/go-task/task/v3/cmd/task@v3.41.0
echo "${tools_bin}" >>"${GITHUB_PATH}"
"${tools_bin}/kind" version
"${tools_bin}/kubectl" version --client
"${tools_bin}/helm" version
"${tools_bin}/task" --version
- name: Portable tests
run: |
task test
bash hack/e2e/test-common.sh
- name: Start virtual-BMC environment
run: task e2e:up
- name: End-to-end scenarios
run: |
set -o pipefail
task e2e:test 2>&1 | tee .e2e/e2e-test.log
- name: Collect diagnostics
if: always()
run: task e2e:diagnostics || true
- name: Summarize failure
if: failure()
run: |
if [[ -f .e2e/e2e-test.log ]]; then
tail -n 100 .e2e/e2e-test.log
{
tail -n 20 .e2e/e2e-test.log
if [[ -f .e2e/proxy.log ]]; then
echo "proxy log:"
tail -n 20 .e2e/proxy.log
fi
} >"${RUNNER_TEMP}/fleet-e2e-error.txt"
message=$(tr '\n' ' ' <"${RUNNER_TEMP}/fleet-e2e-error.txt" | sed 's/%/%25/g; s/\r/%0D/g; s/\n/%0A/g')
echo "::error title=E2E failure::${message}"
fi
- name: Upload diagnostics and validator reports
if: always()
uses: actions/upload-artifact@v4
with:
name: fleet-machine-management-evidence
path: |
.e2e/diagnostics
.e2e/validators
.e2e/*.log
include-hidden-files: true
if-no-files-found: ignore
- name: Tear down
if: always()
run: task e2e:down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,18 @@
/servers.com.txt

# Local outputs and scratch work
/bin/
/.e2e/
/.task/
/tmp/
/dist/
/coverage/
/worktrees/
coverage.out
*.kubeconfig
credentials.json
ready.json
ca.pem
/milo-acceptance-evidence/
**/milo-acceptance-config.json

Expand Down
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM golang:1.26.4-bookworm AS build
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
ARG PACKAGE
ARG BINARY
RUN CGO_ENABLED=0 go build -trimpath -ldflags='-s -w' -o /out/${BINARY} ${PACKAGE}

FROM debian:12.12-slim
ARG BINARY
COPY --from=build /out/${BINARY} /usr/local/bin/app
USER 65532:65532
ENTRYPOINT ["/usr/local/bin/app"]
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ rejects work that requires those integrations and makes no provider changes. See
[implementation status](docs/development/README.md) for the implemented subset and
remaining gaps.

The repository also contains a deliberately narrow prototype for
allocation-scoped customer Redfish access. Its lifecycle integration consumes
service-owned Secret custody and serializes sessions against installation and
release, rather than trusting pre-bound allocation CRDs. Production access
authorization, trusted observation resolution, and executor fencing remain
unwired; the session controller defaults to unready and denies new sessions.
An explicit [synthetic fixture mode](docs/implementation/synthetic-bmc-fixture.md)
wires the runnable prototype to real Coordinator custody without enabling a
production fallback.
See the [implemented lifecycle contract](docs/implementation/secure-bmc-lifecycle.md).

## What Fleet is for

- Plan, register, and verify physical infrastructure and its connections.
Expand Down Expand Up @@ -46,3 +57,8 @@ today. Then choose a topic:

Contributors should also read the [repository guidance](AGENTS.md) and
[implementation roadmap](docs/development/roadmap.md).

## Secure BMC prototype

See the [prototype guide](docs/implementation/machine-management-prototype.md) for
build commands, the Linux E2E harness, and exact validation limits.
58 changes: 58 additions & 0 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,64 @@
version: '3'

vars:
GO_CACHE: '{{default "/tmp/fleet-go-cache" .GO_CACHE}}'

tasks:
generate:
desc: Regenerate the provisional CRDs from Kubebuilder markers
cmds:
- go run sigs.k8s.io/controller-tools/cmd/controller-gen@v0.23.0 crd paths="./internal/api/session/...;./internal/api/coordination/..." output:crd:artifacts:config=config/crd/bases

test:
desc: Run portable unit and API/controller integration tests
cmds:
- env GOCACHE={{.GO_CACHE}} go test ./...
- git diff --check

build:
desc: Build every prototype executable
cmds:
- mkdir -p bin
- env GOCACHE={{.GO_CACHE}} go build -o bin/datumctl-fleet ./cmd/datumctl-fleet
- env GOCACHE={{.GO_CACHE}} go build -o bin/fleet-controller ./cmd/fleet-controller
- env GOCACHE={{.GO_CACHE}} go build -o bin/fleet-gateway ./cmd/fleet-gateway
- env GOCACHE={{.GO_CACHE}} go build -o bin/fleet-relay ./cmd/fleet-relay

e2e:up:
desc: Create Karmada management/member Kind clusters and the real sushy/libvirt BMC environment
cmds:
- ./hack/e2e/up.sh

e2e:test:
desc: Run every machine-management scenario and both DMTF validators
cmds:
- ./hack/e2e/test.sh

e2e:test:path:
desc: Run one E2E path (currently DIR=machine-management)
requires:
vars: [DIR]
preconditions:
- sh: test '{{.DIR}}' = machine-management
msg: 'the only implemented E2E path is DIR=machine-management'
cmds:
- ./hack/e2e/test.sh

e2e:diagnostics:
desc: Collect cluster, gateway, libvirt, and PXE evidence
cmds:
- ./hack/e2e/diagnostics.sh

e2e:down:
desc: Remove only the named Fleet E2E resources
cmds:
- ./hack/e2e/down.sh

e2e:openvpn:up:
desc: Replace the default private route with the separate OpenVPN qualification profile
cmds:
- ./hack/e2e/openvpn-up.sh

manifests:validate:
desc: Render and validate the production Fleet and Milo manifest roots.
cmds:
Expand Down
28 changes: 28 additions & 0 deletions cmd/datumctl-fleet/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// SPDX-License-Identifier: Apache-2.0

package main

import (
"errors"
"fmt"
"os"

"go.datum.net/datumctl/plugin"

fleetcmd "go.datum.net/fleet/internal/cmd/fleet"
)

var version = "dev"

func main() {
plugin.ServeManifest(plugin.Manifest{Name: "fleet", Version: version, Description: "Manage Datum Fleet machines and secure management sessions", APIVersion: 1, MinAPIVersion: 1})
if err := fleetcmd.Command().Execute(); err != nil {
var exit *fleetcmd.ExitError
if errors.As(err, &exit) {
fmt.Fprintln(os.Stderr, "Error:", exit.Err)
os.Exit(exit.Code)
}
fmt.Fprintln(os.Stderr, "Error:", err)
os.Exit(1)
}
}
90 changes: 90 additions & 0 deletions cmd/fleet-controller/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
// SPDX-License-Identifier: Apache-2.0

package main

import (
"flag"
"log/slog"
"net/http"
"os"
"time"

"k8s.io/apimachinery/pkg/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/tools/clientcmd"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/healthz"
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
"sigs.k8s.io/controller-runtime/pkg/webhook"
"sigs.k8s.io/controller-runtime/pkg/webhook/admission"

coordinationv1 "go.datum.net/fleet/internal/api/coordination/v1alpha1"
fleetv1alpha1 "go.datum.net/fleet/internal/api/session/v1alpha1"
fleetv1 "go.datum.net/fleet/internal/api/v1alpha1"
"go.datum.net/fleet/internal/controller"
"go.datum.net/fleet/internal/staging/sessionfixture"
)

func main() {
federationKubeconfig := flag.String("federation-kubeconfig", "", "kubeconfig for the Karmada federation API")
webhookCertDir := flag.String("webhook-cert-dir", "/var/run/fleet-webhook", "webhook serving certificate directory")
metrics := flag.String("metrics-bind-address", ":8080", "metrics address")
probe := flag.String("health-probe-bind-address", ":8081", "probe address")
authorityFreshness := flag.Duration("authority-freshness", 2*time.Minute, "maximum cached allocation-authority lifetime at a location")
perClaimLimit := flag.Int("per-claim-session-limit", 1, "maximum concurrent sessions for one claim")
perProjectLimit := flag.Int("per-project-session-limit", 5, "maximum concurrent sessions for one consumer project")
lifecycleMode := flag.String("lifecycle-mode", "production", "production (unready) or synthetic (test-only private fixture grants)")
privateNamespace := flag.String("private-namespace", controller.SystemNamespace, "private Coordinator Secret namespace")
flag.Parse()
if *federationKubeconfig == "" {
slog.Error("--federation-kubeconfig is required")
os.Exit(2)
}
scheme := runtime.NewScheme()
must(clientgoscheme.AddToScheme(scheme))
must(fleetv1.AddToScheme(scheme))
must(fleetv1alpha1.AddToScheme(scheme))
must(coordinationv1.AddToScheme(scheme))
federationConfig, err := clientcmd.BuildConfigFromFlags("", *federationKubeconfig)
must(err)
federationClient, err := client.New(federationConfig, client.Options{Scheme: scheme})
must(err)
wh := webhook.NewServer(webhook.Options{CertDir: *webhookCertDir})
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{Scheme: scheme, Metrics: metricsserver.Options{BindAddress: *metrics}, HealthProbeBindAddress: *probe, WebhookServer: wh})
must(err)
privateClient, err := client.New(mgr.GetConfig(), client.Options{Scheme: scheme})
must(err)
lifecycle, readiness, err := lifecycleWiring(*lifecycleMode, privateClient, *privateNamespace)
must(err)
mgr.GetWebhookServer().Register("/mutate-metal-datumapis-com-v1alpha1-machinemanagementsession", &admission.Webhook{Handler: controller.SessionAdmission{}})
must((&controller.SessionReconciler{Lifecycle: lifecycle, PerClaimLimit: *perClaimLimit, PerProjectLimit: *perProjectLimit}).SetupWithManager(mgr))
must((&controller.ProjectionReconciler{Lifecycle: lifecycle, FederationClient: federationClient, Freshness: *authorityFreshness}).SetupWithManager(mgr))
must(mgr.AddHealthzCheck("healthz", healthz.Ping))
must(mgr.AddReadyzCheck("lifecycle-authority", readiness))
slog.Info("starting Fleet session controllers")
must(mgr.Start(ctrl.SetupSignalHandler()))
}

func lifecycleWiring(mode string, kube client.Client, namespace string) (controller.SessionLifecycle, healthz.Checker, error) {
switch mode {
case "production":
return nil, func(*http.Request) error { return controller.ErrUnsupported }, nil
case "synthetic":
authority, err := sessionfixture.NewAuthority(kube, namespace)
if err != nil {
return nil, nil, err
}
slog.Warn("SYNTHETIC TEST ONLY: fixture grants replace production authorization and provider observations", "privateNamespace", namespace)
return authority, healthz.Ping, nil
default:
return nil, nil, controller.ErrUnsupported
}
}

func must(err error) {
if err != nil {
slog.Error("fatal", "error", err)
os.Exit(1)
}
}
38 changes: 38 additions & 0 deletions cmd/fleet-controller/main_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package main

import (
"errors"
"testing"

"k8s.io/apimachinery/pkg/runtime"
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
"sigs.k8s.io/controller-runtime/pkg/client/fake"

"go.datum.net/fleet/internal/controller"
)

func TestLifecycleModeIsExplicitAndFailClosed(t *testing.T) {
scheme := runtime.NewScheme()
if err := clientgoscheme.AddToScheme(scheme); err != nil {
t.Fatal(err)
}
kube := fake.NewClientBuilder().WithScheme(scheme).Build()
authority, ready, err := lifecycleWiring("production", kube, "private")
if err != nil || authority != nil || !errors.Is(ready(nil), controller.ErrUnsupported) {
t.Fatalf("production did not fail closed: %v %v", authority, err)
}
if _, _, err := lifecycleWiring("typo", kube, "private"); err == nil {
t.Fatal("unrecognized mode was accepted")
}
authority, ready, err = lifecycleWiring("synthetic", kube, "private")
if err != nil || ready(nil) != nil {
t.Fatalf("synthetic wiring: %v", err)
}
concrete, ok := authority.(*controller.LifecycleSessionAuthority)
if !ok || concrete.Coordinator == nil || concrete.Resolver == nil {
t.Fatalf("missing real custody or resolver: %T", authority)
}
if _, _, err := lifecycleWiring("synthetic", kube, ""); err == nil {
t.Fatal("accepted missing private namespace")
}
}
Loading
Loading