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

Add option to also deregister the terminating instance from all ELBs #5

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

piontec
Copy link

@piontec piontec commented Oct 18, 2018

This becomes essential when instances are exposed with ELB: after getting the termination signal, the instance is drained and soon will be terminated. Still, kube-proxy keeps running on the instance, so it's not removed from ELB. WHen isntance stops, ELB must detect failure on its own, which introduces a delay of at least 10s. With this PR terminating instances can deregister themselfs from all ELBs before they will be reclaimed by AWS.

Copy link
Contributor

@JoelSpeed JoelSpeed left a comment

Choose a reason for hiding this comment

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

I've just got a few minor questions on this but am fairly happy with the PR in general.

Would you be able to add something to the ReadMe on this new feature?

Out of interest, have you tried externalTrafficPolicy: local on your Kubernetes services, we don't see this problem and I believe it's because we have the external policy set. It means that kube-proxy only responds to requests if the service target exists on the node, so draining the node causes ELB health check failures.

@@ -20,9 +20,6 @@ node it is running on before the node is taken away by AWS.
## Usage

### Deploy to Kubernetes
A docker image is available at `quay.io/pusher/k8s-spot-termination-handler`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of interest, why are you removing this comment?

@@ -12,6 +12,7 @@ rules:
verbs:
- get
- update
- patch
Copy link
Contributor

Choose a reason for hiding this comment

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

I can't see any reason to add this extra verb unless you've run into errors with RBAC using this helper?

print('Node Drain successful')
else:
print('Node drain failed, will retry')
continue
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this continue necessary?

@pusher-ci
Copy link

@piontec: PR needs rebase.

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.

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

Successfully merging this pull request may close these issues.

None yet

4 participants