Skip to content

feat: introduce ClusterOps CR to decouple cluster operations from the StorageCluster reconciler #392

Description

@geoffrey1330

Summary

Similar to how StorageNodeOps was introduced to model discrete, trackable operations on storage nodes (suspend, resume, restart, migrate), we should introduce a ClusterOps custom resource to handle cluster-level operations that are currently embedded directly in the SimplyblocksStorageCluster reconciler.

Motivation

  • The cluster controller currently mixes steady-state reconciliation with long-running, multi-step operations (e.g. Activate, Expand), making it hard to track progress, retry safely, or audit history.
  • StorageNodeOps proved this pattern works well: a dedicated CR with a phase/status state machine, a Triggered guard to prevent duplicate backend calls, and clear Succeeded/Failed terminal states.
  • Without a dedicated CR, partial failures (e.g. backend POST succeeds but status patch fails) are harder to recover from safely.

Proposed Scope

  • New ClusterOps CRD with:
    • spec.type — operation type (Activate, Expand, etc.)
    • status.phase — state machine mirroring StorageNodeOps (PendingRunningSucceeded / Failed)
    • status.triggered — guard flag to prevent duplicate backend calls on retry
  • SimplyblocksStorageCluster controller delegates operation execution to ClusterOps instead of handling it inline
  • ClusterOps controller owns the full lifecycle of each operation

Benefits

  • Per-operation history and auditability
  • Safe retries with exponential backoff without risk of duplicate backend calls
  • Cleaner separation of steady-state reconciliation from one-shot operations
  • Consistent operator pattern across node-level and cluster-level operations

Related

  • StorageNodeOps controller — reference implementation
  • SimplyblocksStorageCluster controller — current inline operation handling

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions