Closed selmertsx closed 7 years ago
最初は AutoScalingまで対応はしない。
http://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-spotfleet.html
AllocationStrategy: lowestPrice #defaultなので指定しなくてよい
ExcessCapacityTerminationPolicy: noTermination
IamFleetRole: REVIEEE_FLEET_ROLE
LaunchSpecifications:
- ImageId: ami-c393d6a4
InstanceType: m4.large
KeyName: REVIEEE_KEY
Placement:
- AvailabilityZone: ap-northeast-1a
SecurityGroups:
- GroupId: REVIEEE_EC2_GROUP
IamInstanceProfile:
- Arn: REVIEEE_INSTANCE_PROFILE_ARN
SpotPrice: 0.139
SubnetId: REVIEEE_SUBNET_ID
UserData: "echo ECS_CLUSTER=do-review-apps >> /etc/ecs/ecs.config"
SpotPrice: 0.139
TargetCapacity: INSTANCE_CAPACITY
SpotFleetのサンプル設定: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-spotfleet.html#d0e60905
SpotFleet設定サンプルその2: http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-examples.html#fleet-config1
SpotFleetRequestConfigDataのプロパティ説明 http://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-spotfleet-spotfleetrequestconfigdata.html
SpotFleetRequest全体 http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-spotfleet.html
ECS用のAMI http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html
ここらへん読んでる
http://aws.typepad.com/sajp/2016/01/powering-your-amazon-ecs-clusters-with-spot-fleet.html https://aws.amazon.com/jp/blogs/compute/dynamic-scaling-with-ec2-spot-fleet/ http://docs.aws.amazon.com/ja_jp/AmazonECS/latest/developerguide/cloudwatch_alarm_autoscaling.html
Auto Scaling と Spot Fleetは両方セットで運用することになりそう。