Skip to content

fix(cli): size brokers by the three brokers deploy emits - #583

Merged
bmscomp merged 1 commit into
mainfrom
fix/broker-sizing-share
Nov 2, 2026
Merged

bmscomp merged 1 commit into
mainfrom
fix/broker-sizing-share

Conversation

@bmscomp

@bmscomp bmscomp commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Why

Deploying on one Kubernetes node (k3d, 18 CPU) failed with kafka readiness failed: timeout waiting for pods (selector=strimzi.io/cluster=krafter). Each of the 3 brokers asked for 8 CPU / 16Gi, the node reached 98% CPU requested, the 3 controllers stayed Pending ("Insufficient cpu"), and the brokers that did start crash-looped waiting for the controller quorum.

The cause is in computeCapacityBudget: it split the broker share by BrokerReplicas × max(len(zones), 1), which is 1 with zero or one zone and 2 with two. buildBrokerPools emits 3 brokers in every case, so each broker got the whole share (clamped at 8000m / 16Gi). Broker storage was split the same way.

What changes

  • totalBrokers is BrokerReplicas × 3, matching the pools emitted. On the 18-CPU node that's about 2.9 CPU per broker.
  • TestGenerateValues_BrokerSizingMatchesThePoolsEmitted checks the split against the replicas the pools actually run for 0–3 zones, and that a single 18-CPU node fits brokers plus controllers. It fails on main for 0, 1 and 2 zones.

Not done

  • Not re-run end to end on the k3d node yet; the broken krafter release there has to be uninstalled first.
  • With more than 3 zones the budget now divides by 3 (the pools emitted) rather than by the zone count.

Checks run locally

go test ./pkg/detect/... ./cmd/..., golangci-lint run --new-from-rev=origin/main ./pkg/detect/..., scripts/check-cli-style.sh, scripts/check-cli-compat.sh.

The capacity budget split the broker CPU, memory and storage share by
BrokerReplicas × zones, which is 1 with no zones or one zone and 2 with
two. buildBrokerPools emits three brokers in every case, so each broker
was sized as if it were the only one. On a single 18-CPU k3d node that
asked for three 8-CPU brokers; the controllers never scheduled and the
brokers crash-looped waiting for a quorum, failing deploy's Kafka
readiness wait.

Divide by the three brokers instead, and test the share against the
replicas the pools actually run.
@bmscomp
bmscomp merged commit ca04202 into main Nov 2, 2026
61 checks passed
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.

1 participant