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

Machine deletion: try up to n times to delete the Node, then move on #1446

Closed
ncdc opened this issue Sep 26, 2019 · 13 comments · Fixed by #1452
Closed

Machine deletion: try up to n times to delete the Node, then move on #1446

ncdc opened this issue Sep 26, 2019 · 13 comments · Fixed by #1452
Assignees
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Milestone

Comments

@ncdc
Copy link
Contributor

ncdc commented Sep 26, 2019

What steps did you take and what happened:

  1. Do something catastrophic such as manually deleting a CAPA cluster's ELB
  2. kubectl delete machine/foo
  3. Error in the logs (note, this is from v1alpha1, but the issue is still in v1alpha2):
I0814 17:10:39.243788       1 instances.go:67] [machine-actuator]/cluster.k8s.io/v1alpha1/4d95faba9cb7ee388671ac3cef6ee79b39c25f15/bf038fa5/worker-bf038fa5-nodepool-bf038fa5default-6c86565b8rvqdh "level"=2 "msg"="Looking for existing machine instance by tags"  
I0814 17:10:39.288157       1 machine_controller.go:181] Deleting node "ip-10-0-0-20.us-west-2.compute.internal" for machine "worker-bf038fa5-nodepool-bf038fa5default-6c86565b8rvqdh"
E0814 17:10:39.301721       1 machine_controller.go:183] Error deleting node "ip-10-0-0-20.us-west-2.compute.internal" for machine "worker-bf038fa5-nodepool-bf038fa5default-6c86565b8rvqdh": Delete 
https://bf038fa5-apiserver-261840232.us-west-2.elb.amazonaws.com:6443/api/v1/nodes/ip-10-0-0-20.us-west-2.compute.internal
: dial tcp: lookup bf038fa5-apiserver-261840232.us-west-2.elb.amazonaws.com
on 10.96.0.10:53: no such host
  1. The Machine is never deleted

What did you expect to happen:
This error shouldn't block Machine deletion

Anything else you would like to add:
I think it would be reasonable to attempt to delete the Node multiple times over the span of 30-60 seconds. If the deletion fails, we can record an Event, then allow the Machine deletion to continue.

Environment:

  • Cluster-api version: v0.1.x and v0.2.x

/kind bug

xref kubernetes-sigs/cluster-api-provider-aws#1084 (comment) and my next comment as well

@ncdc ncdc added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. labels Sep 26, 2019
@ncdc ncdc added this to the v0.2.x milestone Sep 26, 2019
@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Sep 26, 2019
@tahsinrahman
Copy link
Contributor

/assign

@tahsinrahman
Copy link
Contributor

@vincepri
Copy link
Member

That seems AWS specific function, for this we should probably just retry a specific number of times. We should be able to use https://github.com/kubernetes/apimachinery/blob/master/pkg/util/wait/wait.go#L333 to achieve this, wdyt?

@tahsinrahman
Copy link
Contributor

yes, i'm actually talking about this!

@tahsinrahman
Copy link
Contributor

any suggestion for interval and timeout duration?

@vincepri
Copy link
Member

Sounds good, I saw the linked aws code and was confused :D

I'd retry maybe every 2 seconds and for max 10? @ncdc

@ncdc
Copy link
Contributor Author

ncdc commented Sep 26, 2019

Do you think it makes sense to try for up to either 30 or 60 seconds? Or is it more likely that if it fails once, it will probably fail every time, in which case trying for that long is an unnecessary delay?

@ncdc
Copy link
Contributor Author

ncdc commented Sep 26, 2019

Or should we just try once and not even bother with any more attempts?

@vincepri
Copy link
Member

Once might be a temporary failure, I'd limit it the retries to 10-15 seconds, if it fails for that long there is a good chance that we won't be able to reach it

@ncdc
Copy link
Contributor Author

ncdc commented Sep 26, 2019

Ok, I'm good with interval=2s, timeout=10s

@tahsinrahman
Copy link
Contributor

Should we do the same for bastion?

@ncdc
Copy link
Contributor Author

ncdc commented Sep 26, 2019

The bastion is CAPA specific and is unrelated to this issue (the bastion doesn't have a corresponding Kubernetes Node).

@tahsinrahman
Copy link
Contributor

oops, I mistook it as a capa issue, thats why i was linking the capa function :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants