Skip to content

vmcluster: support storage node pools - #2313

Open
AndrewChubatiuk wants to merge 1 commit into
masterfrom
support-storage-pools
Open

vmcluster: support storage node pools#2313
AndrewChubatiuk wants to merge 1 commit into
masterfrom
support-storage-pools

Conversation

@AndrewChubatiuk

@AndrewChubatiuk AndrewChubatiuk commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

fixes #741

Adds pools to VMCluster, allowing to run multiple isolated groups of vmstorage nodes (and optionally dedicated vminsert nodes) within a single cluster. Each pool is queried by vmselect as a named storage group, enabling multi-retention.

Each entry in spec.pools has a name, an optional vmstorage override (merges onto the top-level spec.vmstorage), and an optional vminsert override (merges onto the top-level spec.vminsert).
When any pool is defined, the top-level vmstorage StatefulSet is not deployed; pools replace it entirely.
The top-level vminsert Deployment is deployed as a shared insert only when no pool defines its own dedicated vminsert.
vmstorage.retentionPeriod inside a pool overrides the cluster-level spec.retentionPeriod for that pool, enabling per-pool retention.

Pool resources are named vm<component>-<cluster>-<pool> (e.g. vmstorage-prod-hot).
An app.kubernetes.io/pool=<name> label is added to both the StatefulSet/Deployment selector and pod template labels, keeping per-pool selectors disjoint.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 9 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread api/operator/v1beta1/vmcluster_types.go
Comment thread internal/controller/operator/factory/vmcluster/vmcluster_pools.go Outdated
Comment thread internal/controller/operator/factory/vmcluster/vmcluster_pools.go Outdated
@AndrewChubatiuk
AndrewChubatiuk force-pushed the support-storage-pools branch 2 times, most recently from cdeed73 to e6a9c61 Compare June 22, 2026 10:15

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 10 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread api/operator/v1beta1/vmcluster_types.go Outdated
@AndrewChubatiuk
AndrewChubatiuk force-pushed the support-storage-pools branch from e6a9c61 to 49538a8 Compare June 22, 2026 11:24

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 17 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread internal/controller/operator/factory/vmcluster/vmcluster_pools.go Outdated
Comment thread api/operator/v1beta1/vmcluster_types.go
@AndrewChubatiuk
AndrewChubatiuk force-pushed the support-storage-pools branch from 49538a8 to 1d48e0f Compare June 22, 2026 12:06

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 17 files

Re-trigger cubic

@AndrewChubatiuk
AndrewChubatiuk force-pushed the support-storage-pools branch 3 times, most recently from 7016ee6 to 1131f28 Compare June 25, 2026 12:44
@AndrewChubatiuk
AndrewChubatiuk force-pushed the support-storage-pools branch from 1131f28 to 36b8de5 Compare July 1, 2026 07:12
@AndrewChubatiuk

Copy link
Copy Markdown
Contributor Author

@vrutkovs need your feedback on this

@vrutkovs

vrutkovs commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

I'd like to have this merged after release is cut, but in general it looks okay

@AndrewChubatiuk

Copy link
Copy Markdown
Contributor Author

sure, no rush, just wanted to get some feedback

@AndrewChubatiuk
AndrewChubatiuk force-pushed the support-storage-pools branch 3 times, most recently from d24c1aa to cfca541 Compare July 21, 2026 19:38
Comment thread api/operator/v1beta1/vmcluster_types.go Outdated
return vms.Validate()
}

func (vmi *VMInsert) validate() error {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No license verification? Seems we're only doing this for discovery, but imo its worth having for every type of vminsert

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is needed to validate enterprise version dependent features, so in vminsert this check is redundant

Comment thread api/operator/v1beta1/vmcluster_types.go Outdated
Comment thread docs/CHANGELOG.md Outdated
}, svc.Labels)
}})

// pools: two pools with shared vminsert — pool STSes get pool label, instance label stays the cluster name, top-level vmstorage not created

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be verifying the storageNode args for vminserts in all tests

Comment thread api/operator/v1beta1/vmcluster_types.go Outdated
// Used as a suffix for generated resource names and as a storage group name in vmselect.
// Must be a lowercase alphanumeric DNS label; hyphens allowed in the interior.
// +kubebuilder:validation:Pattern:="^[a-z0-9]([a-z0-9-]*[a-z0-9])?$"
// +kubebuilder:validation:MaxLength=32

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cluster name is unlimited, why would we limit it here? VMStorage names are very easy to overflow btw, this should be limited to 16 to make "vmstorage-" STS fit in 63 chars max

{Verb: "Get", Kind: "VMServiceScrape", Resource: vmselectName},
{Verb: "Create", Kind: "VMServiceScrape", Resource: vmselectName},

// VMInsert

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets comment here that pool logic has changed the order of reconciliation and vmselect is now checked later

},
})

// pools: pool with dedicated vminsert — pool insert created, top-level vminsert skipped

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't that leave the second pool outside of the ingestion path? I think it would be more explicit to require defining vminsert for every pool

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated tests

@AndrewChubatiuk
AndrewChubatiuk force-pushed the support-storage-pools branch 3 times, most recently from 3e33f11 to c271a21 Compare July 22, 2026 09:41
@AndrewChubatiuk
AndrewChubatiuk force-pushed the support-storage-pools branch from c271a21 to ff10e07 Compare July 22, 2026 12:25
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.

Multiple statefulsets for vmstorage nodes on vmcluster

2 participants