Skip to content

fix: add missing spot args for docker autoscaler#1368

Open
chrisgurley wants to merge 2 commits into
cattle-ops:mainfrom
chrisgurley:docker-as-spot-fix
Open

fix: add missing spot args for docker autoscaler#1368
chrisgurley wants to merge 2 commits into
cattle-ops:mainfrom
chrisgurley:docker-as-spot-fix

Conversation

@chrisgurley

Copy link
Copy Markdown
  • Update variables for docker_autoscaler_worker_asg to expose spot_price
  • Update aws_launch_template to add spot price if given

Description

This PR updates adds var.runner_worker_docker_autoscaler_asg.spot_price as a new valid configuration and updates the Docker Autoscaler launch template to use this value. The launch template for docker autoscaler is updated to use the same logic as var.runner_instance.spot_price.

As a note, if you attempt to use both var.runner_worker_docker_autoscaler_asg.spot_price and var.runner_worker_docker_autoscaler_asg.instance_requirements, the AWS API will reject this as you cannot set instance requirements onto an ASG while a launch template is using spot pricing.

Migrations required

No

Verification

  • Configure a runner using the module, and for the input variables, var.runner_worker_docker_autoscaler_asg, set spot_price to a reasonable number.
  runner_worker_docker_autoscaler_asg = {
    default_instance_type     = "t3.medium"
    health_check_grace_period = 30
    on_demand_base_capacity   = 0
    spot_price               = "0.17"
    spot_allocation_strategy = "lowest-price"
    subnet_ids               = local.subnets.private
  }
  • Deploy the runner along with other required settings
  • Login to the AWS account where this runner is deployed, and confirm that new spot requests are created when launching

- Update variables for `docker_autoscaler_worker_asg` to expose
  `spot_price`
- Update `aws_launch_template` to add spot price if given
@chrisgurley chrisgurley requested a review from npalm as a code owner April 2, 2026 14:50
@github-actions

github-actions Bot commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Hey @chrisgurley! 👋

Thank you for your contribution to the project. Please refer to the contribution rules for a quick overview of the process.

Make sure that this PR clearly explains:

  • the problem being solved
  • the best way a reviewer and you can test your changes

With submitting this PR you confirm that you hold the rights of the code added and agree that it will published under this LICENSE.

The following ChatOps commands are supported:

  • /help: notifies a maintainer to help you out

Simply add a comment with the command in the first line. If you need to pass more information, separate it with a blank line from the command.

This message was generated automatically. You are welcome to improve it.

@chrisgurley

Copy link
Copy Markdown
Author

/help

Hello, please let me know if there is anything else I can do to help get this PR into an approved state. Thanks!

@kayman-mk kayman-mk self-requested a review as a code owner May 14, 2026 10:21

@kayman-mk kayman-mk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good idea to amend this. Thanks!

When spot_price set AND enable_mixed_instances_policy=true with on_demand_base_capacity > 0:

  • ASG requests on-demand instances
  • Launch template forces market_type = "spot"

Is this a problem? Have you tried to create this setup? We might have to go with 2 differerent launch templates to fix that, if it is a problem.

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.

2 participants