Include sidecar containers requests and limits #2848
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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