Add options to allow CPU limits to be different than requests. #6519
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.
Why are the changes needed?
This is a user request to let the CPU limit differ from the CPU request. Note this change is only for CPU. Please see this blog for additional background.
Please keep in mind also that Flyte "limits" are not limits in the K8s sense - they're limits on requests. Flyte then proceeds to set Pod limits equal to requests. The reason Flyte does this is because of how K8s QoS works. Limits that are higher than requests result in a lower class leading to potentially higher eviction.
If turned on, tasks that do not request a CPU limit will now not get a CPU limit. Please be aware that K8s will reject scheduling any such pod if there's a resource quota that specifies a CPU limit in the pod's namespace.
What changes were proposed in this pull request?
Alternatives considered
TaskMetadata
. This was deemed too intrusive of a change for a feature that may be hard to use at this time. Would be a substantially larger change.How was this patch tested?
Tested on internal clusters.
Setup process
Both feature flags need to be turned on to enable this behavior.
For Admin:
For propeller
Screenshots
Check all the applicable boxes
Related PRs
Docs link
Summary by Bito
This pull request introduces a feature in Flyte that allows CPU limits to differ from CPU requests, enhancing resource management flexibility. It includes new configuration flags, updates to the execution manager, and comprehensive tests to ensure the new functionality works correctly without disrupting existing behavior.