Skip to content
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

perf(creation): remove polling from creation #249

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

charliedmcb
Copy link
Collaborator

@charliedmcb charliedmcb commented Apr 3, 2024

Fixes #

Description
Currently the Azure Karpenter Provider is not able to leverage budgets for doing multi-Drift, since the core logic only looks to start a second node Drift, after the first create responds back with its Provider ID. Since we wait for the actual Async operations to Azure to complete before moving on, this means that we are delaying this response, and losing out on the possible asynchronous multi-Drift functionality within budgets.

This change removes our Polling (waiting) on the create calls to allow us to respond back with the Provider ID quickly, and take advantage of multi-Drift.

We still track the vm create async errors internally, and asynchronously to track and mark unavailable offerings.

Note: for creations that fail asynchronously it will fall back on registerationTTL to clean up any failed instances, which is currently set at 15min:

How was this change tested?
E2E run:

Also, did multiple manual tests in code spaces.
*

Does this change impact docs?

  • Yes, PR includes docs updates
  • Yes, issue opened: #
  • No

Release Note

Updates the approach for VM creation to return only after the request has been made to CRP and other resources. This unblocks processing of other nodes within Drift Disruption. However, means that async errors within the call will not be caught before returning the initial request. For creations that fail asynchronously it will fall back on registerationTTL to clean up any failed instances, which is currently set at 15min:
- https://github.com/kubernetes-sigs/karpenter/blob/3d493b30f2464833a6482b99c80117dc20a23a44/pkg/controllers/nodeclaim/lifecycle/liveness.go#L40  

Copy link
Collaborator Author

@charliedmcb charliedmcb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/test

Copy link
Collaborator Author

@charliedmcb charliedmcb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/test

Copy link
Collaborator Author

@charliedmcb charliedmcb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/test

Copy link
Collaborator Author

@charliedmcb charliedmcb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/test

@charliedmcb charliedmcb marked this pull request as ready for review October 9, 2024 16:18
@Bryce-Soghigian
Copy link
Collaborator

Bryce-Soghigian commented Oct 9, 2024

Note: for creations that fail asynchronously it will fall back on registerationTTL to clean up any failed instances, which is currently set at 15min:

This doesn't seem acceptable as for any async error that fails we will have an additional 14 minutes for a retry(Assuming 1m for create to fail) vs before it was 2s 4s 8s 16s 60s retries on nodeclaim create.

Is there a better design for dealing with the long running error messages? Can we check async for those error messages in a separate goroutine not blocking the main Create thread and report back the status, if it fails we delete the nodeclaim or something like that?

Comment on lines -383 to +384
if val, ok := nodeClaim.Labels[corev1beta1.NodePoolLabelKey]; ok {
tags[NodePoolTagKey] = &val
}
nodePoolLabel := nodeClaim.Labels[corev1beta1.NodePoolLabelKey]
tags[NodePoolTagKey] = &nodePoolLabel
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did we change this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, good catch. This is unrelated to the change.

Pretty sure its a bug I found months back. Will separate it out into a new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants