-
Notifications
You must be signed in to change notification settings - Fork 41.1k
[BugFix]Update ImageLocality plugin to account ImageVolume images #130231
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
base: master
Are you sure you want to change the base?
Conversation
|
Welcome @Barakmor1! |
Hi @Barakmor1. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/ok-to-test |
@@ -107,6 +107,13 @@ func sumImageScores(nodeInfo *framework.NodeInfo, pod *v1.Pod, totalNumNodes int | |||
sum += scaledImageScore(state, totalNumNodes) | |||
} | |||
} | |||
for _, volume := range pod.Spec.Volumes { |
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.
Not sure if should check the "ImageVolume" feature gate at here, and only account volume when it enabled.
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.
why?
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.
Alright, it's done. Is there anything else missing?
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.
None from me. Let's wait for other reviewers
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.
Well, actually I'm not sure about this.
We may have a scheduler without this fg, but both api-server and kubelet has it enabled.
In this case, kubelet will pull the images anyway.
I prefer to calculate them anyway. /cc @macsko What's your opinion?
pkg/scheduler/framework/plugins/imagelocality/image_locality_test.go
Outdated
Show resolved
Hide resolved
3b46843
to
4dd2cba
Compare
3edd74c
to
a9ec924
Compare
/cc @saschagrunert |
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.
Code LGTM. I somehow have issues to see that as a bug, but I assume that's up to the scheduler folks to decide that.
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Barakmor1, saschagrunert The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
a9ec924
to
1e467ca
Compare
nodes []*v1.Node | ||
expectedList framework.NodeScoreList | ||
name string | ||
featureEnabled bool |
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.
No need to disable this featuregate when testing cases without imageVolume. Those cases should be tested to verify they works well with this fg enabled.
I think it should be ok to just enable this fg for all cases.
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.
Wouldn't we be missing the test case that verifies everything works as expected when the feature gate is disabled?
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.
For some test we run cases twice with fg enabled/disabled to ensure this. Like this one
schedulingHintsEnablement []bool |
But since the influence of fg enablement is rather small here. I think it should be fine.
@@ -107,6 +110,16 @@ func sumImageScores(nodeInfo *framework.NodeInfo, pod *v1.Pod, totalNumNodes int | |||
sum += scaledImageScore(state, totalNumNodes) | |||
} | |||
} | |||
if utilfeature.DefaultFeatureGate.Enabled(features.ImageVolume) { |
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.
We can use the feature of the pkg/scheduler/framework/plugins/feature/feature.go
package to avoid using DefaultFeatureGate.Enabled
directly
FYI:
#130414
Hi, I'll address the comments once we reach agreement on this comment. I'm new to this repository, so any advice on how we can move forward would be appreciated. :) |
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
1e467ca
to
c8aaa02
Compare
I removed the FeatureGate status logic, as ImageVolume is expected to GA in Kubernetes 1.35. /hold |
to account for ImageVolume images when scoring and prioritizing nodes with required pod images Signed-off-by: bmordeha <bmordeha@redhat.com>
c8aaa02
to
7dbbef8
Compare
@Barakmor1: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Update ImageLocality plugin to account for ImageVolume images when scoring
and prioritizing nodes with required pod images
What type of PR is this?
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: