-
Notifications
You must be signed in to change notification settings - Fork 4k
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
ScaleUp for check-capacity ProvisioningRequestClass #6451
Conversation
65bfe51
to
47016c1
Compare
IMO this looks like a work in progress |
47016c1
to
cba20c1
Compare
cba20c1
to
300d99b
Compare
@Shubham82 probably my initial comment is misleading. The ScaleUp part of ProvisioningRequestClass is done, so this PR is ready for review. |
245e4cc
to
4bce196
Compare
Ok @yaroslava-serdiuk |
4bce196
to
5b43362
Compare
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.
Initial pass done
cluster-autoscaler/core/scaleup/orchestrator/wrapper_orchestrator.go
Outdated
Show resolved
Hide resolved
cluster-autoscaler/core/scaleup/orchestrator/wrapper_orchestrator.go
Outdated
Show resolved
Hide resolved
cluster-autoscaler/core/scaleup/orchestrator/wrapper_orchestrator.go
Outdated
Show resolved
Hide resolved
cluster-autoscaler/core/scaleup/orchestrator/wrapper_orchestrator.go
Outdated
Show resolved
Hide resolved
cluster-autoscaler/provisioningrequest/checkcapacity/orchestrator.go
Outdated
Show resolved
Hide resolved
cluster-autoscaler/provisioningrequest/checkcapacity/orchestrator.go
Outdated
Show resolved
Hide resolved
return nil | ||
} | ||
// scheduling the pods to reserve capacity for provisioning request with BookCapacity condition | ||
o.injector.TrySchedulePods(o.context.ClusterSnapshot, podsToCreate, scheduling.ScheduleAnywhere, false) |
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.
What is the last parameter of the function? Can we comment what is happening here?
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.
Also I see that the Function can return error, we should at least log it. And if should happen, maybe even return it
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.
Last bool value is breakOnFailure. Here we continue to try schedule pods even if some of them weren't scheduled.
cluster-autoscaler/provisioningrequest/checkcapacity/orchestrator.go
Outdated
Show resolved
Hide resolved
cluster-autoscaler/provisioningrequest/checkcapacity/condition.go
Outdated
Show resolved
Hide resolved
5b43362
to
b0c2524
Compare
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.
Left couple of comments on how to handle the conditions
cluster-autoscaler/core/scaleup/orchestrator/wrapper_orchestrator.go
Outdated
Show resolved
Hide resolved
return false | ||
} | ||
condition := pr.Conditions()[len(pr.Conditions())-1] | ||
if condition.Type == string(v1beta1.CapacityAvailable) && condition.Status == v1.ConditionTrue { |
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 should do a proper check here, see the comment below.
return false | ||
} | ||
|
||
func setCondition(pr *provreqwrapper.ProvisioningRequest, conditionType string, reason, message string) { |
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 should have the following cases in the conditions:
BookedCapacity=False -> we did not provision capacity but we tried
BookedCapacity=True -> we got capacity and it is actively booked
BookedCapacity=True && Expired=True -> The capacity expired
Failed=True -> We failed
BookedCapacity=False Failed=True -> We failed but made a try before
I would also vote for removal of the Pending=True condition as we can communicate this information by BookedCapacity=False
cluster-autoscaler/provisioningrequest/apis/autoscaling.x-k8s.io/v1beta1/types.go
Outdated
Show resolved
Hide resolved
29f6dc2
to
b493ccc
Compare
cluster-autoscaler/provisioningrequest/checkcapacity/condition.go
Outdated
Show resolved
Hide resolved
cluster-autoscaler/provisioningrequest/checkcapacity/condition.go
Outdated
Show resolved
Hide resolved
cluster-autoscaler/core/scaleup/orchestrator/wrapper_orchestrator_test.go
Show resolved
Hide resolved
cluster-autoscaler/provisioningrequest/checkcapacity/condition_test.go
Outdated
Show resolved
Hide resolved
cluster-autoscaler/provisioningrequest/checkcapacity/condition_test.go
Outdated
Show resolved
Hide resolved
b493ccc
to
cd36e07
Compare
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.
LGTM
Left couple comments for the test cases
cluster-autoscaler/provisioningrequest/checkcapacity/condition.go
Outdated
Show resolved
Hide resolved
cluster-autoscaler/provisioningrequest/checkcapacity/orchestrator.go
Outdated
Show resolved
Hide resolved
ca7bdb0
to
4e21359
Compare
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.
Couple of comments
cluster-autoscaler/provisioningrequest/checkcapacity/condition.go
Outdated
Show resolved
Hide resolved
cluster-autoscaler/provisioningrequest/checkcapacity/orchestrator.go
Outdated
Show resolved
Hide resolved
cluster-autoscaler/provisioningrequest/apis/autoscaling.x-k8s.io/v1beta1/types.go
Outdated
Show resolved
Hide resolved
bd20690
to
ebeb4a5
Compare
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.
/lgtm
@kisieland: changing LGTM is restricted to collaborators In response to this:
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/test-infra repository. |
Apply |
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.
LGTM, just a single nit + a question about potential starvation.
cluster-autoscaler/core/scaleup/orchestrator/wrapper_orchestrator_test.go
Outdated
Show resolved
Hide resolved
…tor_test.go Co-authored-by: Bartek Wróblewski <bwroblewski@google.com>
/label tide/merge-method-squash |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: BigDarkClown, kisieland, yaroslava-serdiuk 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 |
What type of PR is this?
/kind feature
Implement ScaleUp for check-capacity ProvisioningRequestClass. It will try to schedule pods on existed nodes and if it's succesful it update ProvReq status and book capacity for those pods.
What this PR does / why we need it:
part of implementation https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/proposals/provisioning-request.md
Special notes for your reviewer:
The full implementation of check-capacity is not completed yet, pods from ProvisioningRequest will be injected and processed in the following PRs. When the implementation is completed I'll add release-notes.