-
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
Move MaxNodeProvisionTime to NodeGroupAutoscalingOptions #5649
Conversation
@morshielt: GitHub didn't allow me to assign the following users: kisieland. Note that only kubernetes members with read permissions, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. 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. |
|
Welcome @morshielt! |
d3a7c8d
to
53ec856
Compare
@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. |
/assign @BigDarkClown |
/lgtm |
/assign @towca |
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'm not going to block this PR on this, but leaving 2 comments to think about. If you decide to ignore them, just drop the hold.
/approve
/hold
@@ -111,6 +115,7 @@ type ScaleUpFailure struct { | |||
// ClusterStateRegistry is a structure to keep track the current state of the cluster. | |||
type ClusterStateRegistry struct { | |||
sync.Mutex | |||
context *context.AutoscalingContext |
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'm a bit sad we need to keep the entire context as a field here. Could we have an object that is just concerned with saying what max node provision time is for a given node (or nodegroup)? The context would then be kept there, making ClusterStateRegistry
easier (well, at least not harder) to reason about.
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.
Renamed the provider interface to maxNodeProvisionTimeProvider
and introduced nodeRegistrationTimeLimitProvider
struct containing the provider and context. PTAL :)
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, although my point was really that whether or not the context is used is an implementation detail and doesn't have to be a part of the interface. So, one could imagine a staticMaxNodeProvisionTimeProvider
which just returns a constant duration, as well as more advanced implementations depending on a specific use case. Regardless of what implementation of maxNodeProvisionTimeProvider
interface is used, CSR should not require context passed to the constructor (i.e. New...
function).
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.
Thank you for the explanation - I've introduced NewDefaultMaxNodeProvisionTimeProvider
returning an instance of maxNodeProvisionTimeProvider
. It's kept as a field in ClusterStateRegistry
and it already contains the context and nodeGroupConfigProcessor
when it's assigned, so the NewClusterStateRegistry
function signature is mostly back to as it was, it only takes the maxNodeProvisionTimeProvider
as an additional argument. Please take a look :)
291c7a4
to
14dc76e
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.
Thanks, looks good overall, just two comments to consider.
cluster-autoscaler/core/scaleup/orchestrator/orchestrator_test.go
Outdated
Show resolved
Hide resolved
d1c7f07
to
ffbfc46
Compare
Looks good now, thanks! /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: BigDarkClown, morshielt, x13n 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 |
/unhold |
Which component does this PR applies to?
cluster-autoscaler
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
This PR enables setting
MaxNodeProvisionTime
per NodeGroup (it was previously set per cluster).Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Please take a look.
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
NA
/assign @kisieland