-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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 support for SpotPrice and Mixed Instance ASGs #7066
Add support for SpotPrice and Mixed Instance ASGs #7066
Conversation
9e4ee16
to
700bfc6
Compare
/retest |
/test pull-kops-bazel-test |
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.
Looks great @rifelpet, thanks!
/assign @gambol99 @granular-ryanbonham
700bfc6
to
0326348
Compare
0326348
to
160f236
Compare
160f236
to
adef332
Compare
I rebased and added two new integration tests, one using only mixed instances and one using mixed instances and maxPrice. To aid in review, heres the diff between the two test directories:
|
Great fix @rifelpet! Thanks for the contribution, as always! /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mikesplain, rifelpet The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@mikesplain I was planning on cherry-picking this to 1.14 and 1.13. Do you think it should be in 1.12 as well? |
…-origin-release-1.14 Automated cherry pick of #7066: Add support for SpotPrice and Mixed Instance ASGs
…-origin-release-1.13 Automated cherry pick of #7066: Add support for SpotPrice and Mixed Instance ASGs
fixes #7049
I initially added SpotPrice to the LaunchTemplate directly like this:
https://github.com/rifelpet/kops/blob/a83a178dad892da9d194764fb1ea91eba70c51bb/upup/pkg/fi/cloudup/awstasks/launchtemplate_target_api.go#L120-L127
but that resulted in the following error from AWS:
So instead it needs to be in the ASG's
MixedInstancesPolicy.InstancesDistribution
.This now correctly adds the spot price to the mixed instances ASG:
Notes:
cluster update
s:SpotMaxPrice
's type in Terraform and CloudFormation outputs to string, but it didn't appear to actually get used anywhere so I think thats ok. It is indeed a string in the Terraform provider:https://github.com/terraform-providers/terraform-provider-aws/blob/240d623a35b18f8a83b0803c8d5b0e3a7f273547/aws/resource_aws_launch_template.go#L289-L292
While adding integration tests I discovered another bug in which Kops was not adding
node_autoscaling_group_ids
,node_security_group_ids
, andnode_subnet_ids
terraform outputs when using launch templates. This fixes that as well.Without the two fixes, the new integration tests fails with: