astefanutti / kubebox

⎈❏ Terminal and Web console for Kubernetes
http://astefanutti.github.io/kubebox
MIT License
2.14k stars 142 forks source link

CPU limits wrong #103

Closed lduparc closed 1 year ago

lduparc commented 3 years ago

Running Kubebox (latest version)

CPU LImit (red line) display CPU request config and not real limit set in Deployment config. Checking kubernetes dashboard, cpu is well set. All ok concerning memory.

Eg:

resources:
  limits:
    cpu: 4
    memory: 4Gi
  requests:
    cpu: 1
    memory: 2Gi

Screenshot from Kubebox:

Screenshot 2020-11-11 at 12 37 57

Screenshot from Kubernetes dashboard:

Screenshot 2020-11-11 at 12 39 32
astefanutti commented 3 years ago

Interesting, it's taken from cAdvisor stats:

https://github.com/astefanutti/kubebox/blob/1e599a10d52e32cb47cec7fca90e519779aaa251/lib/ui/dashboard.js#L588

I need to dig into it to understand why that's different from the pod compute resources.

lduparc commented 3 years ago

Hi,

Thinking about this issue. FYI I'm using kubernetes 1.19 and I saw some breaing changes between kube-state-metrics & cadvisor which can explain (not sure) why we don't have the right information on Kubebox

lduparc commented 3 years ago

It's not related to kubernetes 1.19. I check kubebox version 0.7.0 and all is ok. This issue exist since version 0.8.0. Issue still exist on v0.9.0

Thanks

astefanutti commented 3 years ago

Thanks for the precision. That helps a lot. Before 0.8.0, the cAdvisor embedded into the kubelet was queried through the container stats API. Starting 0.8.0, it uses the APIs from the external cAdvisor DaemonSet.

Here is what was used from the container stats endpoint response:

https://github.com/astefanutti/kubebox/blob/01b28a2dc33831c635f4577e691c3a2bc977a6a0/lib/ui/dashboard.js#L484

While the following bit from the cAdvisor API doesn't seem to match:

https://github.com/astefanutti/kubebox/blob/1e599a10d52e32cb47cec7fca90e519779aaa251/lib/ui/dashboard.js#L588

lduparc commented 3 years ago

Hi, Hope end of year are good for you.

Any news concerning this issue ? Are you able to reproduce ?

Thanks.

astefanutti commented 3 years ago

@lduparc I don't have any update. I've mostly been AFK to enjoy end of 2020 😄. I'll work on it ASAP and keep you posted.

lduparc commented 3 years ago

Happy New Year,

Let me know if you need help to test.

astefanutti commented 1 year ago

I've removed the limits from the time series in 0448a18e9e6acabba004d44fd1d0625027ba48ed, as they tend to flatten the other ones. I may find a better way to bring the limits in the UI.