Closed florian-besser closed 1 week ago
In order to discard a potential OOMKilled, I would disable the resources limit/requests when deploying in that platform, that should give us some clues if the issue is related to that.
Disabled the limits, now waiting for issue to reappear. Note that it can take hours and days between occurrences, so no immediate feedback sadly :/
The issue reoccurred, this time I was able to capture some events with kubectl get events -n kafka --sort-by='.metadata.creationTimestamp'
:
30m Normal Sync ingress/ingress-kafka Scheduled for sync
29m Normal Killing pod/kafka-controller-0 Stopping container jmx-exporter
29m Normal Killing pod/kafka-controller-0 Stopping container kafka
29m Warning FailedToUpdateEndpoint endpoints/kafka Failed to update endpoint kafka/kafka: Operation cannot be fulfilled on endpoints "kafka": the object has been modified; please apply your changes to the latest version and try again
29m Warning RecreatingFailedPod statefulset/kafka-controller StatefulSet kafka/kafka-controller is recreating failed Pod kafka-controller-0
Note that the nodes still have a memory limit (set by AWS), so if you have any insights where I could find more information on e.g. the K8s cluster killing pods I'd be keen to look there as well. Our nodes each have 8GM RAM, so they should be able to accommodate the Kafka pods with the current settings just fine (all pods are deployed on separate nodes of course) - but there are other pods on these nodes, so it is theoretically possible that the nodes run out of memory.
I say theoretically:
kubectl top nodes
NAME CPU(cores) CPU% MEMORY(bytes) MEMORY%
ip-10-0-1-152.ap-southeast-1.compute.internal 102m 5% 1525Mi 21%
ip-10-0-1-92.ap-southeast-1.compute.internal 298m 14% 2894Mi 40%
ip-10-0-2-21.ap-southeast-1.compute.internal 203m 10% 3957Mi 55%
ip-10-0-2-83.ap-southeast-1.compute.internal 461m 23% 2766Mi 38%
ip-10-0-3-164.ap-southeast-1.compute.internal 295m 14% 2584Mi 36%
ip-10-0-3-30.ap-southeast-1.compute.internal 314m 15% 4178Mi 58%
ip-10-0-3-51.ap-southeast-1.compute.internal 207m 10% 1949Mi 27%
Our cluster automatically scales out on memory pressure, so this should not happen.
Unfortunately I'm still unsure where I should look to find more information as to why the pods failed.
Hi,
In this sense, I would double check with the infrastructure providers to see if they can help debug this kind of situations or if they can confirm this is a memory issue. If they are in the killing state it seems to me that probably at some point there is a memory peak forces the eviction.
It looks like we suffered from pod preemptions. Will continue to monitor; but this seems to be unrelated to Kafka as such. Kafka were in our case the biggest pods around which made them a prime target for preemption, plus we did not set a priority for the pods.
Thanks for letting us know!
Name and Version
oci://registry-1.docker.io/bitnamicharts/kafka:29.3.4
What architecture are you using?
arm64
What steps will reproduce the bug?
Note that this seems to be a random issue; we have deployed the chart as described in 3 environments, only one of which shows erroneous behavior.
Are you using any custom parameters or values?
What is the expected behavior?
The pods should consistently be healthy / should not die.
What do you see instead?
Seemingly randomly the pods are terminated.
I checked out
/dev/termination-log
for the root cause of the termination:At the same time I see the following in the logs:
This is a bit weird to me as a SIGKILL (137) should not allow for a graceful shutdown; the log seems to imply a SIGTERM was instead sent, enabling graceful shutdown. Still, what I'm trying to figure out is who sent that command, and why?
I thought about a potential
OOMKilled
issue, but the Prometheus graphs show the JVM memory usage was way below the maximum:Also
OOMKilled
is a SIGKILL, and thus should not yield graceful shutdowns.I did a quick
kubectl describe pod -n kafka kafka-controller-1
to check whether there's any information there:Note that I'm not seeing any reason why the previously killed pod was killed; the pod that has since replaced the killed pod is running fine.
I also checked whether the pods were terminated due to cluster scale down, but the issue persisted even after adding the
"cluster-autoscaler.kubernetes.io/safe-to-evict": "false"
annotation. Checking the autoscaler logs shows that no scale-down took place at the time.Additional information
At the moment I can say that the pods are behaving incorrectly but I'm unable to ascertain why exactly. Still, as this results in a pod being killed and restarted I categorize this as an issue for now - any help in what other pieces of info I should deliver is much appreciated.
Note that this issue only happens as far as I can see for Kafka; no other app in the K8s cluster is showing this behavior.