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 --grace-period parameter #16

Merged
merged 2 commits into from Feb 19, 2019
Merged

Conversation

kimxogus
Copy link
Contributor

No description provided.

entrypoint.sh Outdated
@@ -111,7 +111,7 @@ fi

# Drain the node.
# https://kubernetes.io/docs/tasks/administer-cluster/safely-drain-node/#use-kubectl-drain-to-remove-a-node-from-service
kubectl drain ${NODE_NAME} --force --ignore-daemonsets --delete-local-data
kubectl drain ${NODE_NAME} --force --ignore-daemonsets --delete-local-data --grace-period=120
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for contributing! 😁

Adding a grace period of two minutes per pod seems optimistic when AWS gives you a total of two minutes' warning before terminating the instance.

Would be better if you make it an optional setting, read via env var. Would you mind doing that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for good suggestion :)

I made it env var option GRACE_PERIOD with default value 120

Choose a reason for hiding this comment

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

Isn't 120 a little too high still?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

can you suggest proper value? 110 or 100?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@egeland can you review?

Choose a reason for hiding this comment

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

Ideally we could calculate it from the $NOTICE_URL request, since that'd be more precise.
Although, that endpoint seems deprecated in favor of the instance-action endpoint.

@egeland egeland merged commit 2bb9786 into kube-aws:master Feb 19, 2019
@kimxogus kimxogus deleted the feat/grace-period branch February 20, 2019 01:06
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.

None yet

4 participants