Skip to content

Package branch deployments and expose actionable diagnostics #1441

Closed

Description

@privateip

Parent: Deliver Galactic Worker with Local and Fabric delivery for tenant services

Deliverable

Opt-in manifests, branch build instructions, Worker health signals and an operator runbook for dedicated and combined placement. It satisfies the packaging and diagnostics part of the "Operate and qualify the branch" phase exit.

This Task owns the Worker, Local and Fabric diagnostics and the two placement profiles. Each service Task (#1437 to #1440) ships its own service-specific diagnostics and manifest changes. This Task wires them into the profiles.

References:

  • Manifests: config/<component>/{base,rbac,serviceaccount} and config/kustomization.yaml, checked by task test:manifests.
  • Node roles and opt-ins: docs/operations/node-labels.md (galactic.datumapis.com/node=compute|edge, gateway=enabled, nat=enabled, edge=enabled).
  • Diagnostics conventions: docs/development/conventions.md "Metrics and logging", internal/plumbing/ebpf/metrics and docs/observability/.

Work items

  • Grant galactic-worker the RBAC to create and delete BGPVRFInstances, run it with hostNetwork, and mount the ownership fence directory (/var/lib/galactic-edge/ownership) and bpffs (see Unify host VRF ownership and CNI attachment observation #1434). Rename the fence directory if the profiles need a neutral path.
  • Document that router GC skips Worker-owned VPCs, so uninstalling Worker must first return those scopes (drain or release) or their host state is never reclaimed. Cover this in the uninstall and return-to-dedicated steps and their test.
  • Run Worker with hostPID and read access to /proc, which its peer-to-pod check needs (see Implement Worker reconciliation and its authenticated service API #1433 and docs/worker/contract.md), mount the caller allowlist file and the socket directory, and grant the RBAC for TokenReview and its watches.
  • Render dedicated and combined profiles with real role selectors, service opt-ins, RBAC, devices, namespace access, capabilities and XDP dispatcher configuration. Use branch-only image tags (v0.0.0-integration-galactic-worker*).
  • Verify each shipped container can program only the resources its component needs.
  • Expose per-capability readiness, owner generation, locality decision, hook coverage and failure reason through the conventions above.
  • Write a runbook for following a flow across the TAP, public NIC, internal pair and remote locator, with safe drain, uninstall and return-to-dedicated steps.

Dependencies

Blocked by #1433, #1434, #1435 and #1436. Can run in parallel with #1437 to #1440.

Acceptance

  • task test:manifests renders both profiles, and the PR attaches the rendered manifests and commands.
  • In the Build a reproducible baseline for dedicated placement #1432 topology, both profiles install from a clean state.
  • When a hook, a route and an attachment are removed one at a time, the diagnostics identify each failure.
  • After two reconciles, a restart, a drain and removal of the branch components, unrelated routes, maps and attachments are unchanged.
  • The delivering PR targets integration/galactic-worker, carries this evidence and says Fixes datum-cloud/galactic#1441. GitHub does not auto-close from a non-default base, so close this issue explicitly when the PR merges and record the PR and merged SHA.

Activity

  1. added theissue type on Nov 18, 2026
  2. self-assigned this
    on Nov 19, 2026
  3. privateip commented on Nov 19, 2026

    @privateip
    ContributorAuthor

    Verdict: Valid. Checked against integration/galactic-worker at 6e0de37.

    What is missing on the branch today:

    • No image or manifests: there is no containers/galactic-worker, no config/galactic-worker and no publish job. The only way to run Worker is the lab-only deploy/containerlab/scripts/worker-fabric.sh, which runs the binary in Kind nodes with an admin kubeconfig.
    • No reverse transfer: docs/worker/ownership.md defines only transfers to Worker. Router GC skips every scope a galactic-worker: owner holds, including a dead incarnation's (internal/gc/gc.go), and the router treats a write it skipped for Worker as done (internal/runtime/gobgp/vrfroutes.go). After Worker is removed, those VPCs' host state is never reclaimed and their tenant routes are never rewritten.
    • No operator diagnostics: Worker's metrics count refusals, reconciles, claims and sessions. Readiness, locality, hook coverage and failure reasons are visible only to the client that owns the claim, through Observe.

    Plan (approved)

    1. Image and publish: containers/galactic-worker/Dockerfile (bpf2go for every eBPF dependency, scratch base) and a publish-galactic-worker-image job, stamped into the kustomize bundle.
    2. config/galactic-worker:
      • Pod: a DaemonSet with hostNetwork, hostPID (D21) and readOnlyRootFilesystem. All capabilities dropped, then NET_ADMIN and BPF added. SYS_ADMIN and SYS_PTRACE are added only if the lab shows they are needed.
      • Mounts: bpffs, the ownership fence directory, the state and socket directories, the CNI lock directories, /var/run/netns and the allowlist ConfigMap.
      • Socket: a fixed socket group.
      • RBAC: TokenReview create, read access to Worker's trusted sources, and BGPVRFInstance create and delete.
    3. Profiles: dedicated and combined fixtures under tests/manifests, composing the existing components with branch image tags, allowlist entries and XDP dispatcher settings. Combined placement is node=edge plus the service opt-ins, with guests pinned to the node.
    4. Least privilege: a checker run by task test:manifests compares each rendered container's capabilities, host mounts, host namespaces and RBAC verbs against a checked-in table. In the lab, kubectl auth can-i checks the grants it must not have.
    5. Diagnostics: gauges for per-capability readiness, destinations by locality and reason, Local hook coverage and scope state, plus a galactic-worker inspect subcommand (run with exec, not over a network port) that prints scope owner and generation, claims, locality, conditions and withdrawal scope.
    6. galactic-worker handback:
      • Runs only after the Worker pod is gone, and refuses while a Worker answers on the socket.
      • Removes Local links, filters and pass-through rows, and leaves Fabric rows in place.
      • Moves each Worker-owned scope to a neutral owner with a resync pending. galactic-router is then restarted.
      • GC reclaims these scopes only after handback, and a root test covers it. This is recorded as a new decision and as the reverse transfer in ownership.md.
    7. Runbook: flow tracing across the TAP, the public NIC, the internal pair and the remote locator, plus drain, uninstall with hand-back, and return to dedicated.
    8. Lab:
      • Install both profiles from a clean state.
      • Remove a hook, a route and an attachment one at a time, and check that the diagnostics identify each failure.
      • Run two reconciles, a restart, a drain and an uninstall, then diff snapshots of unrelated routes, maps and attachments.
  4. privateip commented on Nov 19, 2026

    @privateip
    ContributorAuthor

    Three changes from the approved plan, now in #1462.

    The Worker allowlist is the same in both placements. Worker checks a caller's handoff capability on every claim, Local or Fabric, so NAT needs local.veth_pair and the gateway local.tap even in dedicated placement, as the contract's own example grants. Dedicated placement is the base as shipped. The combined profile differs only in running NAT in dispatch mode beside the gateway, whose dispatcher slot Local's TAP receive needs.

    Worker runs in the socket's group (runAsGroup) instead of passing --socket-group, because changing the socket's group needs CAP_CHOWN, which the pod does not have.

    Diagnostics read fence records through a new lock-free ownership.Peek. Taking the scope lock from the diagnostics loop delayed writers enough to fail a privileged CNI attach test, which passes again with Peek. The handback also skips a scope that is moving to another writer, and stops before removing claims or pins if a Worker comes back during the run.

  5. privateip commented on Nov 20, 2026

    @privateip
    ContributorAuthor

    Delivered by #1462, merged into integration/galactic-worker as 7fb5e6a. The lab evidence for each acceptance item is in #1462 (comment), with two precisions in #1462 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions