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

Include sidecar containers requests and limits #2848

Merged
merged 2 commits into from
Oct 13, 2024

Conversation

ebisso
Copy link
Contributor

@ebisso ebisso commented Aug 24, 2024

Description

With sidecar containers that went Beta in kubernetes 1.29, the Pod 'summary' values for resource requests, limits and percentage are skewed. While the actual cpu/memory usage is a sum of all containers in the pod, the request and limits does not currently include sidecars.

Proposition

Add req/lim of sidecar containers to the sum of req/lim used for the Pod render view.

Alternative

I considered the alternative of simply excluding cpu/mem usage of containers, only for the percentage calculations on the Pod view. Therefore instead of including sidecars in the sum of req/lim, we could instead discard metrics of sidecar containers when we compute the %CPU/L, etc... However, it feels like we would loose information by doing this, as sidecars are no different than the regular containers for the health of an application, and are often critical to the health of a workload (e.g. istio)

Reference:

https://kubernetes.io/docs/concepts/workloads/pods/sidecar-containers/#resource-sharing-within-containers

Copy link

@KevinGimbel KevinGimbel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 👍

Copy link
Owner

@derailed derailed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ebisso Thank you for this update Eric!
I think the approach makes sense, just need a bit of TLC...

internal/render/pod.go Show resolved Hide resolved
internal/render/pod.go Show resolved Hide resolved
@ebisso
Copy link
Contributor Author

ebisso commented Aug 28, 2024

I noticed that the pr build was broken by a previous merge. I made separate pull request to fix it #2856

@derailed
Copy link
Owner

@ebisso I think we may want to rebase to pick up your latest pr. Thank you!

@ebisso
Copy link
Contributor Author

ebisso commented Aug 29, 2024

@derailed I rebased on master, it should be good to go now! Thanks!

@ebisso ebisso requested a review from derailed September 1, 2024 22:23
Copy link
Owner

@derailed derailed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ebisso Thank you for the updates!

@ebisso ebisso closed this Sep 9, 2024
@ebisso ebisso reopened this Sep 9, 2024
@derailed derailed merged commit 8a16b57 into derailed:master Oct 13, 2024
4 checks passed
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

Successfully merging this pull request may close these issues.

3 participants