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

Enable spot instance draining when it's required #58

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Lawstorant
Copy link

@Lawstorant Lawstorant commented Oct 8, 2024

what

instance_market_options are optional and not needed to launch spot instances. Current behavior can lead to sudden breaks in service and uncontrolled loss of capacity.

why

Using this module, one can create spot capacity but without the proper draining management. Fixing this will lead to more stable service when market options are not defined (because they don't have to be). There aren't any requirements to enable this setting though still omitting it with pure on-demand capacity providers doesn't hurt.

references

(this has already happened to me in testing environment)
#18
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/managed-instance-draining.html

instance_market_options are optional and not
needed to launch spot instances. Current behavior
can lead to sudden breaks in service and
uncontrolled loss of capacity.
@Lawstorant Lawstorant requested review from a team as code owners October 8, 2024 19:12
@mergify mergify bot added the triage Needs triage label Oct 8, 2024
@Gowiem Gowiem added bugfix Change that restores intended behavior patch A minor, backward compatible change labels Oct 9, 2024
@Gowiem
Copy link
Member

Gowiem commented Oct 9, 2024

/terratest

@jamengual
Copy link

Mmm, I think we are trying to apply logic to something that might not be entirely related to the intent of spot draining.
maybe we can add to var.capacity_providers_ec2 a enable_spot_instance_draining = optional(bool, false) instead?

@Lawstorant
Copy link
Author

Honestly, I don't see a reason why anybody would NOT want this option if using spot instances.

If we went the variable route, my only suggestion (from experience) would be to make it enabled by default. It just doesn't really make sense not to properly drain tasks from an instance that will be yanked in two minutes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Change that restores intended behavior patch A minor, backward compatible change triage Needs triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants