mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-03 10:37:21 +09:00
Fresh KRaft clusters no longer need to be alone in a namespace. Their node pools are now release-scoped (`<release>-broker`, `<release>-controller`) instead of the fixed `kafka`/`controller`, which is unique per namespace (KafkaNodePool object names are namespace-unique) and lets any number of Kafka instances coexist — every pod/PVC/Service is already prefixed by the unique cluster name. The fixed `kafka` name is still required to adopt an existing ZooKeeper cluster's `<cluster>-kafka-N` brokers and data in place during migration, and that name is namespace-unique — so only one ZooKeeper->KRaft migration can run per namespace. The broker pool name is resolved by kafka.brokerPoolName: "kafka" for a cluster that already migrated or is a classic ZK cluster about to migrate, otherwise "<release>-broker". A second migration into a namespace that already holds a "kafka" pool owned by another cluster fails the render with a clear message; fresh KRaft clusters are never affected. This replaces the previous blanket "one Kafka per namespace" guard (kafka.assertSingleInstance), which over-restricted the fresh case. The migration hook and workload monitors follow the same naming; unit tests updated. Verified on a live cluster: two fresh single-node KRaft clusters (mi-a, mi-b) installed side by side in one namespace came up with distinct node pools, pods and PVCs. Signed-off-by: Alexey Artamonov <aleksei.artamonov@aenix.io>
How to test packages local
cd packages/core/installer
make image-cozystack REGISTRY=YOUR_CUSTOM_REGISTRY
make apply
kubectl delete po -l app=source-controller -n cozy-fluxcd