<#6519 Add options to allow CPU limits to be diffe...
# flyte-github
c
#6519 Add options to allow CPU limits to be different than requests. Pull request opened by wild-endeavor ## 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? • Add a flag in container_helper.go to allow for limit to differ. • Add two flags that gate this feature. This was done because of the decrease in QoS that this results in, and the potential for K8s scheduling errors. Alternatives considered • Task level flag, injected into
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: task_resources: allow-cpu-limit-to-float-from-request: true For propeller k8s: allow-cpu-limit-to-float-from-request: true ### Screenshots ## Check all the applicable boxes • I updated the documentation accordingly. • All new and existing tests passed. • All commits are signed-off. ## Related PRs ## Docs link https://bito.ai#summarystart| ### 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. flyteorg/flyte