Skip to content
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

KubeCPUOvercommit does include DaemonSets in its calculations #718

Open
dohnto opened this issue Dec 8, 2021 · 0 comments
Open

KubeCPUOvercommit does include DaemonSets in its calculations #718

dohnto opened this issue Dec 8, 2021 · 0 comments

Comments

@dohnto
Copy link
Contributor

dohnto commented Dec 8, 2021

Hi,

we have a very small cluster with just 3 nodes and the Pod CPU Request are very carefully picked so that it cluster can handle 1 node outage.

We use kubernetes-mixins, but the the alert KubeCPUOvercommit is firing for us, because it also includes DaemonSets requests in the calculations:

Example:

Node A (allocatable=2): Pod 1 (request=0.5), Daemonset 1 (request=1)
Node B (allocatable=2): Pod 2 (request=0.5), Daemonset 1 (request=1)
Node C (allocatable=2): Pod 3 (request=0.5), Daemonset 1 (request=1)

I believe, that KubeCPUOvercommit will be evaluated as follows

sum(namespace_cpu:kube_pod_container_resource_requests:sum) - (sum(kube_node_status_allocatable{resource="cpu"}) 
 - max(kube_node_status_allocatable{resource="cpu"})) > 0
and
(sum(kube_node_status_allocatable{resource="cpu"}) - max(kube_node_status_allocatable{resource="cpu"})) > 0

=>

4.5 - (6-2) > 0 and (6 - 2)

=>

0.5 > 0 and 4 > 0

But in the example provided, it should be ok to accommodate any Pod (1..3) from lost node, because the DaemonSet is not going to be scheduled.

Theoretically I could utilize the ignoringOverprovisionedWorkloadSelector, but that sounds like an misuse of this option. And ideally, we should be able to exclude the daemonsets from the calculations and ease setting up the selectors for every single daemonset, which can be very difficult.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant