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
Output volumes (capacity, requested) along with cpu and memory when BalanceAttachedNodeVolumes is enabled. #67094
Output volumes (capacity, requested) along with cpu and memory when BalanceAttachedNodeVolumes is enabled. #67094
Conversation
resource allocation priority function.
…mory when the feature BalanceAttachedNodeVolumes is used.
/test pull-kubernetes-e2e-kops-aws |
@@ -56,20 +58,31 @@ func (r *ResourceAllocationPriority) PriorityMap( | |||
requested.Memory += nodeInfo.NonZeroRequest().Memory | |||
var score int64 | |||
// Check if the pod has volumes and this could be added to scorer function for balanced resource allocation. | |||
if len(pod.Spec.Volumes) >= 0 && nodeInfo.TransientInfo != nil { | |||
if len(pod.Spec.Volumes) >= 0 && utilfeature.DefaultFeatureGate.Enabled(features.BalanceAttachedNodeVolumes) && nodeInfo.TransientInfo != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we are checking feature gate in scorer function but it won't hurt to check it here as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @aveshagarwal
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aveshagarwal, ravisantoshgudimetla The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Automatic merge from submit-queue (batch tested with PRs 67052, 67094, 66795). If you want to cherry-pick this change to another branch, please follow the instructions here. |
This PR has 2 commits:
One commit fixes incorrect reporting of total request of cpu and memory. Without this commit, see the erroneous output where total request is more than capacity when the pod is allowed to admit.
The other commit adds outputting volumes (capacity, requested) too along with cpu and memory when BalanceAttachedNodeVolumes is enabled.
@kubernetes/sig-scheduling-pr-reviews @bsalamat @k82cn @ravisantoshgudimetla