是否可以将DCOS模板更改为使用spot实例?我环顾四周,似乎没有多少有关这方面的资料。
发布于 2015-07-16 17:12:44
好的,给定DCOS模板,奴隶的LaunchConfiguration看起来是这样的:(我把它缩短了一些)
"MasterLaunchConfig": {
"Type": "AWS::AutoScaling::LaunchConfiguration",
"Properties": {
"IamInstanceProfile": { "Ref": "MasterInstanceProfile" },
"SecurityGroups": [ ... ],
"ImageId": { ... },
"InstanceType": { ... },
"KeyName": { "Ref": "KeyName" },
"UserData": { ... }
}
}首先,只需在其中添加SpotPrice属性即可。显然,SpotPrice的价值是您想要支付的最高价格。您可能需要在自动标度方面做更多的工作,特别是使用警报和一天中的时间。这是您的新LaunchConfiguration,现货价格为每小时1美元:
"MasterLaunchConfig": {
"Type": "AWS::AutoScaling::LaunchConfiguration",
"Properties": {
"IamInstanceProfile": { "Ref": "MasterInstanceProfile" },
"SecurityGroups": [ ... ],
"ImageId": { ... },
"InstanceType": { ... },
"KeyName": { "Ref": "KeyName" },
"UserData": { ... },
"SpotPrice": 1.00
}
}https://stackoverflow.com/questions/31409463
复制相似问题