New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kubelet crashes trying to free memory under MemoryPressure #58541
Comments
helpers.go:612 contains the following code for i := range pod.Spec.Containers {
switch resourceName {
case v1.ResourceMemory:
containerValue.Add(*pod.Spec.Containers[i].Resources.Requests.Memory())
case resourceDisk:
containerValue.Add(*pod.Spec.Containers[i].Resources.Requests.StorageEphemeral())
}
}
initValue := resource.Quantity{Format: resource.BinarySI}
for i := range pod.Spec.InitContainers {
switch resourceName {
case v1.ResourceMemory:
containerValue.Add(*pod.Spec.Containers[i].Resources.Requests.Memory())
^^^^^^^^^^^^^^^^^^^^^^^^^ this is line 612
case resourceDisk:
containerValue.Add(*pod.Spec.Containers[i].Resources.Requests.StorageEphemeral())
}
} I think there is a bug in that it is iterating through InitContainers but getting resources of regular containers. I have a pod that has 3 initContainers. Looks like this could be a copy&paste error. |
/sig node |
indeed there's a mismatch between initContainers and spec containers, I'll take a look. |
@yastij looks like we need to do the following
and the problem was introduced in 8b3bd5a cc @dashpole |
@dims - Indeed, I'll open a PR for this |
reopening until it is cherrypicked to 1.9 |
It was cherry-picked in 1.9.3. |
/close |
Is this a BUG REPORT or FEATURE REQUEST?:
/kind bug
What happened:
Kubelet constantly crashes trying to evict pods under memory pressure
What you expected to happen:
kubelet to be able to evict pods
How to reproduce it (as minimally and precisely as possible):
Fresh 1.9.1 Kubernetes, installed via kubeadm
Here are relevant eviction parameters for kubelet
Anything else we need to know?:
Environment:
kubectl version
):Gentoo
uname -a
):The text was updated successfully, but these errors were encountered: