Cruise Control: rebalancing
A Kafka cluster of two brokers with Cruise Control, grown to three nodes and rebalanced by an approved KafkaRebalance, then grown to four and shrunk back with autoRebalance, with the replica placement read back from Kafka at every step.
Chapter 33
examples/33-cruise-control/ is a manifest overlay on the shared minikube setup in examples/_k8s: Kafka with Cruise Control, four KafkaTopic resources with two replicas, and a load Job. It runs no application. It accompanies Cruise Control: rebalancing.
It uses kustomize through kubectl, Strimzi, Kafka and Cruise Control.
cd examples/33-cruise-control
./verify.sh
What to observe
- An empty broker. After the pool grows, the new broker holds no replica.
- A proposal that moves nothing. The
KafkaRebalancereachesProposalReady, and the placement is unchanged until the approve annotation is set. - A refused scale-down. Without
autoRebalancethe broker keeps running, the pool still lists it and theKafkastatus carriesScaleDownPreventionCheck. - The operatorβs own rebalance. With
autoRebalance, a larger pool is rebalanced and a smaller one is drained before the pod is removed.
Infrastructure
The namespaces, Strimzi and Kafka bases of examples/_k8s, patches for Cruise Control and the broker pool, and four KafkaTopic resources.