1
1

More than 1 year has passed since last update.

AWS ECS の blue/greenデプロイ実行でエラー

Posted at

エラー内容

ECSでサービスを更新してblue/greenデプロイが開始した直後のエラー

A deployment group associated with an application that uses the ECS compute platform must contain a valid pair of target groups that identify a load balancer. The target ECS service must be configured using one of those two target groups.

解決

  • blue/greenデプロイに使うターゲットグループ2個両方をECSで利用しているALBに関連付ける
  • ターゲットグループの片方をECSサービスに関連付ける

で解決した

片方がECSサービスに紐づいていればデプロイによってもう片方は勝手にECSに紐づいてくれるみたいだ

Listnerのエラー

これもデプロイ実行直後のエラー

The ELB could not be updated due to the following error: Primary taskset target group must be behind listener ***.

Listenerの優先順位がおかしかったらしい。
blue/greenデプロイに使う2個のターゲットグループを両方Listenerのルールに含めてしまっていた。

リスナールールはどうする?

試行錯誤時の疑問は

  • blueとgreenを同じ優先順位にすることは出来ないがどうするのか
  • そもそもgreenをリスナールールに含めて良いのか

というものだった。だが挙動を見てみると、blue/greenデプロイが成功するとリスナールールに紐づくターゲットグループ自体が変わるようだ。

blue/greenデプロイ用にターゲットグループA/Bを用意している場合、デプロイのたびに

  • AからBへ
  • BからAへ

と変わるようだ。
つまりターゲットグループにはどちらがgreen用でどちらがblue用かの違いはなさそう。

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

Twitter

1
1
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
1
1