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.
Asked
Active
Viewed 749 times
3
-
can you provide code, or at least a link to it? (e.g., the cloudformation template) – tedder42 Jul 16 '15 at 04:00
-
Sure, https://s3.amazonaws.com/downloads.mesosphere.io/dcos/stable/single-master.cloudformation.json – gkumar7 Jul 16 '15 at 13:52
1 Answers
5
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
}
}

tedder42
- 23,519
- 13
- 86
- 102