Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spot Instances Support DCOS

Is it possible to change the DCOS template to use spot instances? I have looked around and there does not seem to be much information regarding this.

like image 235
gkumar7 Avatar asked Mar 06 '26 16:03

gkumar7


1 Answers

Okay, given the DCOS template, the LaunchConfiguration for the slaves looks like this: (I've shortened it somewhat)

"MasterLaunchConfig": {
  "Type": "AWS::AutoScaling::LaunchConfiguration",
  "Properties": {
    "IamInstanceProfile": { "Ref": "MasterInstanceProfile" },
    "SecurityGroups": [ ... ],
    "ImageId": { ... },
    "InstanceType": { ... },
    "KeyName": { "Ref": "KeyName" },
    "UserData": { ... }
  }
}

To get started, all you need to do is add the SpotPrice property in there. The value of SpotPrice is, obviously, the maximum price you want to pay. You'll probably need to do more work around autoscaling, especially with alarms and time of day. So here's your new LaunchConfiguration with a spot price of $1.00 per hour:

"MasterLaunchConfig": {
  "Type": "AWS::AutoScaling::LaunchConfiguration",
  "Properties": {
    "IamInstanceProfile": { "Ref": "MasterInstanceProfile" },
    "SecurityGroups": [ ... ],
    "ImageId": { ... },
    "InstanceType": { ... },
    "KeyName": { "Ref": "KeyName" },
    "UserData": { ... },
    "SpotPrice": 1.00
  }
}
like image 127
tedder42 Avatar answered Mar 08 '26 12:03

tedder42



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!