Add load-aware primary node placement webhook for volume creation#330
Open
boddumanohar wants to merge 1 commit into
Open
Add load-aware primary node placement webhook for volume creation#330boddumanohar wants to merge 1 commit into
boddumanohar wants to merge 1 commit into
Conversation
Adds a new PVC-mutating admission webhook that computes the least-loaded eligible storage node using the same latency-deviation signal the auto-rebalancer (#130) already uses, and stamps it onto the PVC as the simplyblock.io/host-id annotation before spdk-csi's CreateVolume ever runs. This replaces sbcli's volume-count-weighted random pick with a load-aware decision when a cluster has latency benchmarking enabled, and degrades silently to today's behavior otherwise — see operator/docs/designs/design-primary-node-placement.md for the full design. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SimplyblockVolumePlacementInjector) that computes the least-loaded eligible storage node for a new volume's primary, reusing the same latency-deviation signal the auto-rebalancer (Automatic Rebalancing of Volumes (same Storage Cluster) #130) already computes, and stamps it onto the PVC as thesimplyblock.io/host-idannotation — read by spdk-csi'sCreateVolumepath (zero spdk-csi changes needed).autobalancing.StorageNodeSelectorwithSelectBestNode, ranking eligible nodes by current latency deviation (no source-node/threshold gate, unlike migration-target selection).webapi.StorageNodeInfowithLvols/LvolsMax(already returned by the backend, just not previously mapped) andIsSecondary(new backend field — see companion PR below) to filter out at-capacity and secondary nodes.operator/docs/designs/design-primary-node-placement.md.Dependency
Requires simplyblock/sbcli#1175 (exposes
is_secondaryon the v2 storage-nodes API) to be merged/deployed for the secondary-node filter to work; until then that filter defaults tofalse(fail-safe, not fail-open on that specific check) since the JSON field will simply be absent.Test plan
go build ./...andgo vet ./...make test(includes envtest-based controller suite) — all packages passmake lint(golangci-lint) — 0 issuesmake manifests/make operator-build-installerregenerated (webhook registration only; RBAC already covered by existing markers)🤖 Generated with Claude Code