-
|
Hi Strimzi experts, We're currently on Strimzi 0.45.1, Kafka 3.9.1, Kubernetes 1.32, and recently migrated to KRaft. Unfortunately, we misconfigured our controller Our badly configured controller KafkaNodePool looks as follows: ---
apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaNodePool
metadata:
name: controller
labels:
strimzi.io/cluster: kafka-cluster
spec:
replicas: 3
roles:
- controller
storage:
type: jbod
volumes:
- id: 0
type: persistent-claim
size: 64Gi
class: kafka-controller-ebs-gp3-xfs
deleteClaim: false
template:
pod:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
strimzi.io/cluster: kafka-cluster
strimzi.io/controller-role: "true"
topologyKey: topology.kubernetes.io/zone
weight: 100
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
strimzi.io/cluster: kafka-cluster
strimzi.io/controller-role: "true"
topologyKey: "kubernetes.io/hostname"Note how each one of our Kafka controllers uses a PVC either on AWS, Azure, or GCP. To distribute the Kafka controllers from the single AZ, say 1a, in AWS evenly across zones 1a, 1b, and 1c, I thought to use the following additional topologySpreadConstraints:
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
strimzi.io/cluster: kafka-cluster
strimzi.io/controller-role: "true"
matchLabelKeys:
- pod-template-hashHowever, when I add such a kubectl annotate pod kafka-cluster-controller-N "strimzi.io/delete-pod-and-pvc=true"That is, ideally, I'd like to first delete a single Kafka controller together with its PVC and only let the strimzi operator reconcile the updated Or should I follow a completely different approach to distribute the Kafka controllers from a single AZ to different AZs ? My issue is similar to https://github.com/orgs/strimzi/discussions/11997. The solution there is to use the Any insights about how to overcome my problem are very much appreciated :-) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
What storage do you use in the different clusters? In AWS, if you use something like
Are you saying that when you add the toplogySpreadConstraint to a 3 node cluster in a single zone, it is not handled by Kubernetes because the first Pod cannot be rolled without breaking skew constraint? I never really tried that and thought about it TBH. I guess it makes some sense, although it makes things also pretty wierd. Can you use So in an environment like AWS with AZ-bound
That might work? (Please make sure to try it first in some test environment -> I did not test it, just wrote it based on my knowledge of the code base) |
Beta Was this translation helpful? Give feedback.
What storage do you use in the different clusters? In AWS, if you use something like
gp3, the volumes cannot move between the zones. That is of course a complication. But at least in GCP, there are storage types that are available across zones IIRC. So that should make things there easier, I guess?Are you saying that when you add the toplogySpreadConstraint to a 3 node cluster in a single zone, it is not handled by Kubernetes because the first Pod cannot be …