-
Notifications
You must be signed in to change notification settings - Fork 28
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
Consider supporting spot-instances #18
Comments
@eytan-avisror I wonder if it's possible to use the functionality as is right now by having the spot termination event trigger a TerminateInstanceInAutoScalingGroup using a Lambda for instance. When the termination kicks in, lifecycle-manager should kick in as well I suppose? |
@siwyd Technically speaking, you could definitely do that, lifecycle-hook should fire on any call to I think the problem with spot is that we can only hold the termination back for up to finite amount of time, so supporting these events will always be 'best-effort' (unlike an on-demand instance which we can delay the termination by how ever much is needed), but for most cases (especially when using spot and being aware of possible down time) this should be good enough. |
https://github.com/keikoproj/minion-manager covers the act of switching from on-demand to spot and uses Watching CloudWatch events would give us a 2 minute time window to drain/deregister, however due to amount of time it can possibly take to deregister and drain ALB targets, the 2 minutes won't be enough - however we will most likely have enough time to drain the node from pods and start the target group draining, which will definitely improve the situation where those instances are abruptly killed. |
Here is an example of how we can implement basic support for this in lifecycle-manager. The creation of this rule will happen from the outside, similar to creating the hook config on the scaling groups.
This seems pretty easy to do as we already have all the code in place, all we need is parsing for this new type of event (which has a different schema than a lifecycle event, so will require it's own struct |
We should have minion-manager (https://github.com/keikoproj/minion-manager) terminate instances when it gets the termination handler. Lifecycle-manager's role comes in after termination and will pick up any hook regardless of whether it's spot or not |
It's seems not supported yet in 0.4.0 version or did I missed something? |
@janavenkat we decided not to implement this. atleast not using the above proposal (using cloudwatch events). |
Yeah I checked that but not sure it will handle alb draining |
Is this a BUG REPORT or FEATURE REQUEST?:
Feature Request
Currently lifecycle-manager has no support for spot-instance graceful termination, we should consider adding this support if it makes sense.
We should check what happens today when spot instances gets pulled - are lifecycle hooks honored in this case? if not is there a way we can synchronously run the same actions of drain & deregister?
If not, should it be a best-effort attempt triggered by a Cloudwatch event?
Need to investigate and consider an appropriate solution
The text was updated successfully, but these errors were encountered: