cuddly-jelly-27016
02/21/2025, 9:40 AM95s Warning FailedCreate replicaset/a2bjwpn2f5h8666jxmv4-fofhakuy-0-default-worker-944f52ccec-6d86b47fff Error creating: pods "a2bjwpn2f5h8666jxmv4-fofhakuy-0-default-worker-944f52ccec-k6p94" is forbidden: failed quota: project-quota: must specify limits.cpu for: dask-worker; limits.memory for: dask-worker
85s Warning FailedCreate replicaset/a2bjwpn2f5h8666jxmv4-fofhakuy-0-default-worker-c20eb58c04-686775db55 (combined from similar events): Error creating: pods "a2bjwpn2f5h8666jxmv4-fofhakuy-0-default-worker-c20eb58c04-2kgxq" is forbidden: failed quota: project-quota: must specify limits.cpu for: dask-worker; limits.memory for: dask-worker
85s Warning FailedCreate replicaset/a2bjwpn2f5h8666jxmv4-fofhakuy-0-default-worker-944f52ccec-6d86b47fff (combined from similar events): Error creating: pods "a2bjwpn2f5h8666jxmv4-fofhakuy-0-default-worker-944f52ccec-r667v" is forbidden: failed quota: project-quota: must specify limits.cpu for: dask-worker; limits.memory for: dask-worker
What changes were proposed in this pull request?
This change follows existing container and k8s pod task logic to ensure that when one of requests or limits are not set, the unspecified value comes from the specified one, or otherwise both values come from the platform defaults.
How was this patch tested?
Ran locally on a flyte deployment, verified after changes that worker pods god scheduled
8m11s Normal SuccessfulCreate replicaset/azpkkgg9cwsr6nbmq2k5-fofhakuy-0-default-worker-c44f7b7bd9-79f8584d77 Created pod: azpkkgg9cwsr6nbmq2k5-fofhakuy-0-default-worker-c44f7b7bd9-bptqq
8m12s Normal ScalingReplicaSet deployment/azpkkgg9cwsr6nbmq2k5-fofhakuy-0-default-worker-c44f7b7bd9 Scaled up replica set azpkkgg9cwsr6nbmq2k5-fofhakuy-0-default-worker-c44f7b7bd9-79f8584d77 to 1
...
8m12s Normal SuccessfulCreate replicaset/azpkkgg9cwsr6nbmq2k5-fofhakuy-0-default-worker-1755145870-6d8c6d5b79 Created pod: azpkkgg9cwsr6nbmq2k5-fofhakuy-0-default-worker-1755145870-tltd9
Labels
Please add one or more of the following labels to categorize your PR:
• added: For new features.
• changed: For changes in existing functionality.
• deprecated: For soon-to-be-removed features.
• removed: For features being removed.
• fixed: For any bug fixed.
• security: In case of vulnerabilities
This is important to improve the readability of release notes.
Setup process
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
Summary by Bito
This PR enhances Kubernetes resource management by implementing proper resource requests and limits handling through a new ApplyK8sResourceOverrides utility. The changes focus on preventing pod scheduling failures in quota-restricted environments by ensuring both CPU and memory limits are properly specified. The implementation includes safeguards for platform-defined defaults when values are unspecified.
Unit tests added: True
Estimated effort to review (1-5, lower is better): 2
flyteorg/flytecuddly-jelly-27016
02/21/2025, 2:05 PM