Day-2 operations¶
Use status and conditions as the operator's control plane. A resource can be in a valid Kubernetes state while Garage is still joining nodes, draining a layout, waiting for a repair, or losing quorum.
Inspect before changing¶
kubectl get garagecluster garage -n storage -o yaml
kubectl get garagecluster garage -n storage \
-o custom-columns=PHASE:.status.phase,READY:.status.readyReplicas,DESIRED:.status.replicas,LAYOUT:.status.layoutVersion,DIAGNOSIS:.status.layoutDiagnosis
kubectl get garagenode -n storage -o wide
kubectl get events -n storage --sort-by=.lastTimestamp | tail -50
Before a topology change, confirm:
- all expected nodes are
Connected=TrueandInLayout=True; - no prior layout version is
Draining; QuorumAtRiskis not active;StorageRolloutReady=TrueandStorageDrainReady=Truewhere relevant;- no gateway tombstones or pending factor migration block the operation.
Scale the Auto storage group¶
kubectl scale garagecluster garage -n storage --replicas=5
kubectl get garagecluster garage -n storage -w
This changes only spec.storage.replicas for the default Auto-managed storage group. It does not change node-local pool membership, Manual GarageNodes, or gateway replicas. The operator adds members before removing any and serializes layout changes.
Scale-down is refused when it would leave fewer positive-capacity roles than replication.factor. Do not remove that guard with a raw Kubernetes deletion.
Scale gateways¶
Edit the tier directly:
kubectl patch garagecluster garage -n storage --type=merge \
-p '{"spec":{"gateway":{"replicas":4}}}'
For unified Auto gateways, the operator creates or drains one gateway GarageNode at a time. For edge gateways, it manages the cluster-level gateway StatefulSet and its capacity-less roles. See gateway tombstones.
Change Garage configuration¶
Use the typed fields in GarageCluster.spec or GarageNode.spec: image, database, blocks, worker tuning, logging, endpoint ports, and environment variables. The operator renders the effective TOML and coordinates identity-bearing Pod replacement.
Operator-reserved variables are rejected because they can override mesh identity or the credentials and timeout settings used by safety proofs:
GARAGE_CONFIG_FILE;GARAGE_RPC_SECRETandGARAGE_RPC_SECRET_FILE;GARAGE_ADMIN_TOKENandGARAGE_ADMIN_TOKEN_FILE;GARAGE_METRICS_TOKENandGARAGE_METRICS_TOKEN_FILE.
Use typed Secret references instead. Existing releases with reserved overrides require the migration procedure.
Change replication factor¶
This is a destructive, disruptive layout migration. It scales storage to zero, purges each node's on-disk cluster_layout, rebuilds at the new factor, and triggers re-replication. It is Auto-only and refused for federated or node-local-pool layouts.
The factor annotation and spec edit must be one API update:
kubectl patch garagecluster garage -n storage --type=merge -p '{
"metadata":{"annotations":{"garage.rajsingh.info/purge-cluster-layout":"factor=5"}},
"spec":{"replication":{"factor":5}}
}'
Monitor the durable state machine:
The factor=N in the annotation must equal spec.replication.factor in the same update. A factor-only edit is rejected. The state machine runs Validating, ScalingDown, Purging, Verifying, RebuildingLayout, Converging, then Completed.
The operator refuses to start when:
- the cluster isn't in Auto mode, has no storage tier, has
nodeLocalPools, or hasspec.remoteClustersset; - there are fewer than N storage nodes;
- any storage node has per-node config overrides (multi-disk
dataPaths, fsync, network,publicEndpoint, logging). Its<node>-configcan't be refreshed while the node is suspended, so the node would come back at the old factor and leave the cluster with mixed factors. Remove the overrides or change the factor by hand.
With consistencyMode: dangerous, or with pending gateway tombstones, add ,force to the annotation (for example factor=3,force).
A failed or aborted migration cleans up after itself. It removes the purge init container, scales each storage StatefulSet back to 1 and lifts the per-node suspension, so the tier isn't left at zero. Abort with garage.rajsingh.info/purge-cluster-layout-abort=true only when you have to. An abort restores the workloads but can't undo a purge already written to disk. If some nodes purged before the abort, rerun the migration or repair the layout by hand.
Trigger a repair or scrub¶
kubectl annotate garagecluster garage -n storage \
garage.rajsingh.info/trigger-repair=Tables
kubectl annotate garagecluster garage -n storage \
garage.rajsingh.info/scrub-command=start
kubectl get garagecluster garage -n storage \
-o jsonpath='{.status.lastOperation}{"\n"}'
Supported repair types and recovery annotations are listed in the operations reference. trigger-repair: Scrub is not valid; use scrub-command.
Pause reconciliation¶
Maintenance suspension is version-controlled and requeues periodically without changing the managed workloads. The old pause-reconcile annotation is not honored.