Support configurable replica count in valkey-cluster-init job#17
Open
the-mentor wants to merge 1 commit into
Open
Support configurable replica count in valkey-cluster-init job#17the-mentor wants to merge 1 commit into
the-mentor wants to merge 1 commit into
Conversation
The init job hardcoded `for i in 0 1 2 3 4 5` loops, assuming exactly 6 Valkey pods. This broke DNS resolution and cluster creation for any other `valkey.replicas` value. Inject the replica count from Helm and iterate over it with a POSIX-safe while loop so the job works for any count. Co-Authored-By: Claude Opus 4.8 (1M context) <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
The
valkey-cluster-initJob hardcodedfor i in 0 1 2 3 4 5loops, assuming exactly 6 Valkey pods. Any othervalkey.replicasvalue would break:--cluster createnode list, so cluster creation would fail or omit nodes.Meanwhile the StatefulSet already scales via
.Values.valkey.replicas(default6), so the init job was the only thing pinned to 6.Changes
REPLICAS={{ .Values.valkey.replicas }}).forloops with POSIX-safewhileloops that iterate0 .. REPLICAS-1.Testing
helm template charts/substrate→ rendersREPLICAS=6(default, unchanged behavior).helm template charts/substrate --set valkey.replicas=3→ rendersREPLICAS=3with the loops iterating over it.🤖 Generated with Claude Code