Configuring ClusterId via Custom Resources: Exploring Options #10082
Replies: 3 comments 12 replies
-
The cluster ID is generated as unique. So I'm not sure what is the exact problem you are trying to solve. |
Beta Was this translation helpful? Give feedback.
-
So after running in to an issue with our KRaft cluster, we ended up needing to restore our cluster from a backup. Our B/DR system uses velero to backup our PVCs & PVs and relies on FluxCD to restore the k8s resources to the same point in time as the backup was made. This implies that strimzi's However this is not a given due to the fact that the clusterID is randomly generated. This makes restoring a strimzi Kafka cluster from data disks a painful process with a race-condition after FluxCD applies the Kafka CR (between the user setting the clusterID within the Kafka.status subresource and strimzi's cluster-operator starting the cluster). I'm not sure what the benefit of having the clusterID be random is tbh and would really like to see the Kafka CR spec expanded to allow manually setting a clusterID value. An alternative could also be to change the operator to not generate a random ID but rather something deterministic based on the name, possibly requiring the configuration of a random-seed strimzi-wide. Is there any reason not to allow manually setting this value, seeing as you currently can do it by directly manipulating Kafka.status which just seems like an absolute hack tbh. Slack conversation about restoring and the clusterID problem: https://cloud-native.slack.com/archives/CMH3Q3SNP/p1720463076090579?thread_ts=1720455627.117929&cid=CMH3Q3SNP |
Beta Was this translation helpful? Give feedback.
-
Hi. |
Beta Was this translation helpful? Give feedback.
-
Strimzi generates a unique clusterId for each Kafka cluster it manages. This identifier can be retrieved using the
kubectl get kafka
command, where you'll observe a randomly generated string by the Strimzi operator.kubectl get kafka my-cluster-2 -n strimzi-2 -o=jsonpath='{.status.clusterId}'
Similarly, you can obtain the clusterId for Kafka node pools with:
kubectl get kafkanodepool my-pool-2 -o=jsonpath='{.status.clusterId}'
Now, let's discuss the possibility of overriding the clusterId with a user-defined value via Strimzi's CR configurations. Is this feature currently supported?
This will be useful for scenarios where you want more control over the cluster id. One such example could be creating stretch clusters where all brokers across different Kubernetes environments must use the same cluster id.
Beta Was this translation helpful? Give feedback.
All reactions