forked from tektoncd/pipeline
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make generated pods only request the maximum necessary resources
Before this change, if memory or CPU requests were set in a Task's Steps, (which are Containers) the generated Pod would require the sum of all of the Steps requests to be scheduled on a Node. However, because Tekton overwrites Container entrypoints in Tasks to effectively make the Containers execute one at a time, we want to make Pods generated by the TaskRun only request the maximum resources that will be necessary for any single Container rather than the sum of all resource requests. To make this happen, when generating a Pod for a Task, we find the Step with largest cpu/memory requests among all Steps, and set the cpu/memory requests for all other steps to 0, respectively. If no Step has an explicit cpu/memory request, all requests are set to 0. If we unset resource requests instead of setting them to 0 explicitly, then the limits would be used for the requests, which would defeat the purpose of unsetting the requested values (and could end up making the Pod request more memory than it did in the first place). Fixes tektoncd#598
- Loading branch information
Showing
5 changed files
with
314 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.