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

chore: Add retryable error to cloud provider #1164

Merged

Conversation

jigisha620
Copy link
Contributor

@jigisha620 jigisha620 commented Apr 3, 2024

Fixes #947

Description
The termination controller calls cloudProvider.Delete(nodeClaim) which tries to terminate the underlying instance. It will remove the finalizer once the cloudProvider.Delete() call succeeds. However, the current implementation in AWS does not wait until the instance state is actually terminated and proceeds to remove the finalizer once the ec2.TerminateInstance() call has succeeded.

The change in this PR adds a retryable error to cloudprovider which will allow Karpenter to parse instance state that has been successfully called terminate, but wasn't fully terminated. This effectively re-enqueues the node into the reconciliation loop of the termination controller.

How was this change tested?

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 3, 2024
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 3, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @jigisha620. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Apr 3, 2024
pkg/cloudprovider/types.go Outdated Show resolved Hide resolved
pkg/cloudprovider/types.go Outdated Show resolved Hide resolved
@jigisha620 jigisha620 force-pushed the feat-instance-termination branch 2 times, most recently from cc4dc61 to a2371d8 Compare April 4, 2024 19:29
Copy link
Member

@jonathan-innis jonathan-innis left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 4, 2024
@Bryce-Soghigian
Copy link
Member

Bryce-Soghigian commented Apr 4, 2024

We are also interested in a Retriable cloud provider error.

We were discussing should we drive retries for creating vms through the azure sdk or through the controller? There are some cases where we see 429 throttling errors, and being able to set a retry after on the nodeclaim would be very interesting.

Likely we will be doing some work at some point looking at the retry patterns we are using and comparing single provisioning vs adding a batch style pattern that aws provider does.

Copy link
Contributor

@njtran njtran left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@jigisha620 jigisha620 force-pushed the feat-instance-termination branch from a2371d8 to 9e8e062 Compare April 4, 2024 23:02
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 4, 2024
@jigisha620 jigisha620 force-pushed the feat-instance-termination branch from 9e8e062 to 71a1fb8 Compare April 4, 2024 23:24
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 4, 2024
Copy link
Member

@jonathan-innis jonathan-innis left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 4, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jigisha620, jonathan-innis, njtran

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:
  • OWNERS [jonathan-innis,njtran]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 702b524 into kubernetes-sigs:main Apr 4, 2024
12 checks passed
@coveralls
Copy link

coveralls commented Apr 5, 2024

Pull Request Test Coverage Report for Build 8562595230

Details

  • 9 of 17 (52.94%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 78.697%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pkg/cloudprovider/types.go 8 16 50.0%
Totals Coverage Status
Change from base Build 8560649553: 0.02%
Covered Lines: 8286
Relevant Lines: 10529

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wait for underlying instances to be terminated before removing node finalizers in termination
6 participants