feat(scale): add command to scale up/down node groups - #616
Open
akrem-chabchoub wants to merge 3 commits into
Open
feat(scale): add command to scale up/down node groups#616akrem-chabchoub wants to merge 3 commits into
akrem-chabchoub wants to merge 3 commits into
Conversation
Contributor
Author
|
Current Suggestion: make the Later support helm deployment, storage persistence (needed in the real cluster not locally) |
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
Adds a
beekeeper scalecommand that reconciles a single node group in an already-running Bee cluster to a desired node count, without redeploying or touching the rest of the cluster.This will support the investigations in ethersphere/bee#5396.
Today, growing or shrinking a node group means hand-editing
count:in the cluster config and re-runningcreate bee-cluster, which walks every node group in the cluster.scaletargets one node group directly and only acts on the nodes that actually need to change.How to run
Flags:
--cluster-name(required) — cluster to operate on, must already exist and be running--node-group(required) — the node group to scale (e.g.bee,light)--count(required) — desired final node count for that group--timeout(optional, default30m)Behavior — the group's nodes are named
<node-group>-0,<node-group>-1, ...:count> current size → deploys the missing nodes, growing from the last index (e.g. 8 → 16 deploysbee-8..bee-15)count< current size → deletes the highest-indexed nodes down tocount(e.g. 16 → 8 deletesbee-15..bee-8), including each node's PVC if persistence is enabled for the groupcount== current size → no-opCurrent size is never taken from the YAML config — it's discovered live by probing the cluster (
StatefulSet.Existsfrom index 0 upward until one is missing), soscaleis safe to re-run and self-corrects after a partially completed previous run.Current limitations
scaleonly deploys/deletes Kubernetes resources — it does not fund new nodes with ETH/BZZ. New nodes come up unfunded;beekeeper node-fundermust be run manually afterward to top them up. See the follow-up note below.mode: bootnodeis rejected outright. Bootnode groups use an explicitnodes:list (always a singlebootnode-0) rather than acount:, and every other node group depends on its address for peer discovery — there's no sensible grow/shrink model for it. Usedelete bee-clusterif the bootnode itself needs to go.nodes:list (instead ofcount:) are rejected —scaleonly supports count-based groups.--node-group all. Each node group must be scaled independently, one command per group; there's no bulk "scale everything" option.Getper index (0, 1, 2, ...) until a miss, rather than a singleListcall — fine at today's node counts, but worth revisiting if node groups grow very large.Follow-up needed: node-funder should support autofunding
Because
scaledoesn't fund new nodes, the current workflow is two manual steps (scalethennode-funder).