-
Hey everyone! We're experimenting with methods of making k8s node disruptions (such as node upgrades, termination, etc) less disruptive to our Strimzi-managed Kafka clusters. We believed that Drain Cleaner would help reduce periods of high E2E (message CreateTime to message being consumed and processed) due to giving Kafka enough time to move partition leadership gracefully. Replication doesn't matter as much here as we use Before using Drain Cleaner, we see short latency spikes when brokers go down and come back up. But with Drain Cleaner, it makes things a lot worse, we even get read-only partitions due to 2 brokers going down at the same time due to exceeding the eviction timeout. We'd like to know if we've configured the Cluster Operator correctly for using Drain Cleaner as intended. Happy to provide any relevant CO or Kafka CR configuration if needed, but we can't see any that would be relevant here upon first glance. Any assistance or debugging tips would be appreciated! Here is our setup:
Timeline of events (Not attaching logs for brevity and omitting regular reconciliation events. The terminating timestamps are an approximation from our readiness metrics):
Here are our observations:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Beta Was this translation helpful? Give feedback.
-
I guess it might be best to start addressing these one by one ...
I think this is definitely an issue. Especially if you have both ZooKeeper and Kafka on the same node and evicted in parallel and the nodes being drained one by one. The rolling update triggered by the Drain Cleaner will normally take 0-120 seconds to start. Then it will first roll the ZooKeeper pod and only then the Kafka Pod. So I think managing this within 5 minutes cannot be guaranteed, especially if the Pod might need to wait for some data to resync before being rolled, would need to pull new image etc. So I think this needs to be addressed first. I think you need to solve this first to separate the impact of the force killed pods from the regular draining.
Maybe just as a sidenote -> there is no real reason to colocate the ZooKeeper pods and Kafka pods. There is nothing like that the Kafka broker will talk only with the colocated ZooKeeper node. So this is basically as good as when they are not colocated. Not having them colocated might smooth things out with regards to the timeout. But at the same time, ZooKeeper nodes are normally quite small and might not deserve its own Kubernetes worker node. So I'm not sure what is the best architecture in your case -> I just wanted to note that the colocation dos not bring much from Kafka's perspective. |
Beta Was this translation helpful? Give feedback.
I guess it might be best to start addressing these one by one ...
I think this is definitely an issue. Especially if you have both ZooKeeper and Kafka on the same node and evicted in parallel and the nodes being drained one by one. The rolling update triggered by the Drain Cleaner will normally take 0-120 seconds to start. Then it will first roll the ZooKeeper pod and only then the Kafka Pod. So I think managing this within 5 minutes cannot be guaranteed, especially if the Pod might need to wait for some data to resync before being rolled, would need to pull …