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
A library function to calculate Pod resource utilization #124537
Comments
/sig scheduling |
cc @liggitt for any concerns |
+1, I think this would be helpful to have as a generic library function to generate resource requirements for pods. |
/sig node |
I think the hard part of this would be the same as why we can't move validation into staging. Some of those fields may not belong in staging like pod validation opts. |
This one is easier. It's based on versioned types. |
+1 I'm +1 for having this but I think maybe we need to move both |
We also wanted to implement this: #115643 Those are not mutually exclusive, just pointing that for many use cases reading pod status may be a better idea. |
btw, this function by itself was a result of the big effort: #115367 |
I think kubectl also faces this problem:
and also in admission:
We now maintain this same function in three different places, I'll try if we can merge these three function into one in pkg |
/triage accepted Reusing the same code in scheduler and kubelet would be highly beneficial in quite a few flows |
/assign |
I've created #124609 to simply move both To fully solve this problem, we need to replace the function pointed out in #124537 (comment) with the function in I tend to replace them after #124609 if we all agree the movement, to reduce the complexity of #124609. |
What would you like to be added?
We currently have this function
kubernetes/pkg/api/v1/resource/helpers.go
Line 50 in ae02f87
It is used by both kube-scheduler and kubelet to calculate resource utilization.
It would be useful to have it in a library package, such as
k8s.io/component-helpers
.Why is this needed?
Multiple downstream projects need to calculate resource utilization, for quota management, billing, etc.
The resource calculation might always change, so these projects always have to catch up. The most recent change that I'm aware of is sidecar containers.
The text was updated successfully, but these errors were encountered: