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
Conversation
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@egeland can you review?
There was a problem hiding this comment.
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.
No description provided.