Skip to content

support multi-node Garage clusters in the GarageCluster layout - #16

Draft
stplasim wants to merge 1 commit into
mainfrom
multi-node-layout
Draft

stplasim wants to merge 1 commit into
mainfrom
multi-node-layout

Conversation

@stplasim

Copy link
Copy Markdown
Contributor

The GarageCluster now manages the layout of a Garage cluster with any number of nodes. It still only attaches to a Garage that something else deployed, through the Admin API, so it works with the AboutBits chart, the official chart or any other setup.

Spec and status

  • spec.minNodes: the first layout waits until this many nodes are connected, so all of them get their role in one layout version.
  • spec.zoneRedundancy: maximum or a number of zones. If it is not set, Garage's own value is left as it is.
  • spec.removedNodes: node ids to take out of the layout. A node is removed only when it is listed here. Otherwise a node removed by hand would get its role back at the next resync.
  • status.nodes lists each node with its id, hostname, up, draining, zone and capacity. It replaces status.nodeId.

Reconcile flow

  • Every connected node without a role gets the role from spec.layout. A role changed by hand is reset.
  • The changes are staged, checked with PreviewClusterLayoutChanges and only then applied. If Garage rejects them, they are reverted with RevertClusterLayout and the resource goes to ERROR with Garage's message. Nothing stays staged.
  • Outdated node guard: behind a Service that balances over all nodes, the request may reach a node that lost its metadata and is alone at an older layout version. The operator then waits as PENDING and writes nothing. Both GetClusterStatus and GetClusterLayout are checked.
  • A removed node shows draining: true right away. While a node drains, the status is refreshed every 15 seconds, so it tells when the node can be shut down. Garage can take minutes for the handover.

Test cluster

A three-node Garage runs as a Compose Dev Services profile next to the single node. GarageClusterMultiNodeTest runs against it.

Upgrading

The legacy status.nodeId still counts for the check that no other GarageCluster manages the same Garage. It is cleared at the first reconcile, so existing single-node resources need no change.

Not verified

Checkstyle could not run locally, because the shared config needs GitHub Packages credentials.

🤖 Generated with Claude Code

The operator still only attaches to a Garage that something else deployed.
A node leaves the layout only when it is listed in spec.removedNodes, since
otherwise a node removed by hand would get its role back at the next resync.

Assisted-by: Claude:claude-opus-5-5
@stplasim
stplasim marked this pull request as draft November 18, 2026 17:50
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