feat: add support for dynamic KRaft quorum scaling - #1010
Draft
razvan wants to merge 9 commits into
Draft
Conversation
Controllers now run a quorum-manager sidecar that admits itself into the KRaft voter set on startup (add-controller) and removes itself before termination (remove-controller via preStop), so controller role groups can be scaled up/down on a running cluster without a full rolling restart. controller.quorum.bootstrap.servers now points at each controller role group's headless Service DNS name instead of individual pod addresses, keeping container commands stable across replica changes. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Controllers get a startupProbe (plain TCP, generous failure threshold for slow metadata-log replay on boot), a plain-TCP livenessProbe, and a readinessProbe that checks the node's Raft state via its metrics endpoint instead of a bare TCP check, so a controller stuck rejoining the quorum is correctly reported as not ready. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Controller pods now start/scale sequentially (OrderedReady) instead of in parallel, since the quorum-manager sidecar's admission flow assumes one voter joins at a time. Brokers are unaffected and keep Parallel. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Scaling controllers to 0 replicas while brokers keep running is now rejected at validation time with an actionable error, instead of failing much later and confusingly while building the broker's ConfigMap. Scaling controllers and brokers to 0 together (a coordinated whole-cluster stop) is still allowed and now actually builds, since downstream resource builders no longer assume a non-empty controller quorum whenever KRaft mode is active. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ns tests Enable the previously version-gated scale-up/down steps (Kafka 3.7 no longer needs special-casing), assert quorum voter counts via kafka-metadata-quorum.sh after each scale, and add a final step scaling both controllers and brokers to 0 to exercise the whole-cluster-stop path before namespace teardown. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Update the KRaft controller usage guide for scale-up/down support, record the design spec and implementation plan, add the CHANGELOG entries for this branch's changes, and ignore .worktrees/ for local worktree checkouts. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Member
Author
|
The failed test was due to namespace deletion timeout |
razvan
marked this pull request as draft
August 18, 2026 15:57
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.
Description
Fixes #1009
See CHANGELOG for details.
⌛ OKD integration tests
Outstanding issues
Issue 1: Controller bootstrap servers
Previously the property
controller.quorum.bootstrap.serversused to contain a list of all controller pods. This meant that adding/removing a new controller would update this property in the configmap and therestart controllerwould restart ALL controller pods. This causes a lot of disruption and leads to long teardown times when deleting a CR or a kuttl namespace.To avoid this, we now use a list of headless services (one per role group) which are much more stable as there is usually only one of them. But this uncovered a KRaft bug where a new controller tries to fetch KRaft metadata from its self and crashloops with:
Workarount: implemented a
livenessProbethat fails if the controller stays in stateunattachedfor too long.Issue 2: CR deletion
When a KAfka CR is deleted, the controllers may shut down faster than the brokers leaving them hanging.
This is especially a problem for kuttl tests.
Workaround: a preStop sleep.
Definition of Done Checklist
Author
Reviewer
Acceptance
type/deprecationlabel & add to the deprecation scheduletype/experimentallabel & add to the experimental features tracker