LoginSignup
0
0

More than 3 years have passed since last update.

ecsのクラスタがFargate Spotで100%実行する設定

Posted at

Fargateは非常に便利

だけど開発や試験的に使うだけなら、70%OFFの料金のFargate Spotでお安く使いたい。クラスタの設定を必ずFargate Spotで実行する設定の仕方は以下です。

cluster名がseleniumの場合

$ aws ecs put-cluster-capacity-providers --cluster selenium --capacity-providers FARGATE_SPOT FARGATE --default-capacity-provider-strategy capacityProvider=FARGATE_SPOT,weight=1,base=1

以下のコマンドで確認する
defaultCapacityProviderStrategyが追加されたらOK

$ aws ecs describe-clusters --clusters selenium
{
    "clusters": [
        {
            "clusterArn": "arn:aws:ecs:ap-northeast-1:999999999999:cluster/selenium",
            "clusterName": "selenium",
            "status": "ACTIVE",
            "registeredContainerInstancesCount": 0,
            "runningTasksCount": 0,
            "pendingTasksCount": 0,
            "activeServicesCount": 0,
            "statistics": [],
            "tags": [],
            "settings": [
                {
                    "name": "containerInsights",
                    "value": "disabled"
                }
            ],
            "capacityProviders": [
                "FARGATE_SPOT",
                "FARGATE"
            ],
            "defaultCapacityProviderStrategy": [
                {
                    "capacityProvider": "FARGATE_SPOT",
                    "weight": 1,
                    "base": 1
                }
            ]
        }
    ],
    "failures": []
}

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0