-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Use Allocatable to replace Capacity #19083
Conversation
Labelling this PR as size/M |
GCE e2e test build/test passed for commit 5a04faecbe941564e751071a6e25788c569133d3. |
glog.V(10).Infof("Cannot schedule Pod %+v, because Node %+v is full, running %v out of %v Pods.", podName(pod), node, len(existingPods), info.Status.Capacity.Pods().Value()) | ||
var allocatable api.ResourceList | ||
|
||
// In case old version kubelet does not set Allocatable |
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.
This shouldn't be necessary. This is already performed when converting to the internal API format, here.
67ca07b
to
2d8eac2
Compare
GCE e2e test build/test passed for commit 67ca07b3daaeb00dcf45dcada911e8d5abeb70c4. |
GCE e2e test build/test passed for commit 2d8eac2. |
LGTM, but @davidopp should have the final word. |
Capacity is also used in Shouldn't the logic in this PR be "if kuebelet reports allocatable, use that, otherwise use capacity" so that it doesn't break with old kubelets? |
Yeah, it is originally implemented like that, but @timstclair mentioned that |
GCE e2e test build/test passed for commit e1bda61. |
@k8s-bot unit test this |
@timothysc Seems not, I will add one |
@timothysc It just came to me that we can not control NodeStatus in e2e test. So I propose to write a integration test to cover this logic. Agreed? cc @davidopp |
@resouer sgtm |
Labelling this PR as size/L |
Labelling this PR as size/M |
GCE e2e build/test failed for commit 1a6be7f99554ca9526b88c5cd3b3fe09d3a4d334. |
GCE e2e test build/test passed for commit 4640d12ca95bd6895c497538902f8eafac5d20c5. |
ping @davidopp @timothysc updated and rebased, looks better? |
if int64(len(existingPods))+1 > info.Status.Capacity.Pods().Value() { | ||
glog.V(10).Infof("Cannot schedule Pod %+v, because Node %+v is full, running %v out of %v Pods.", podName(pod), node, len(existingPods), info.Status.Capacity.Pods().Value()) | ||
allocatable := info.Status.Allocatable | ||
|
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.
nix the extra line
minor comments. |
t.Fatalf("Failed to create node: %v", err) | ||
} | ||
|
||
// 3. create resource pod which requires more than Allocatable but less than Capacity |
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.
"more than Allocatable" doesn't make sense because you are not reporting Allocatable.
Add integration test to verify allocatable can works
GCE e2e test build/test passed for commit 0202a20. |
Fixed based on previous comments |
thx for the fixes. |
LGTM |
LGTM too. Thanks for picking up this. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e test build/test passed for commit 0202a20. |
@k8s-bot unit test this |
Use Allocatable to replace Capacity
Super! |
cc/ @derekwaynecarr too |
Awesome! On Thursday, January 21, 2016, Dawn Chen notifications@github.com wrote:
|
Fixes: #18848
Scheduler should use Allocatable instead of Capacity to make decision. But the general behavior does not need to change.
We should also make sure older kubelet can also work well with this code (use Capacity instead in this case).