bottlerocket-os / bottlerocket-ecs-updater

A service to automatically manage Bottlerocket updates in an Amazon ECS cluster.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implement Node Draining and Drain-State Polling

webern opened this issue · comments

Implement:

  • Draining a node that is to be updated, ensuring it is drained only if devoid of non-service tasks.
  • Polling ECS to wait for the drain to complete.

For each of the tasks that is present on the instance, we can use the DescribeTasks API to determine whether the task is a member of a service. Tasks started by a service have the startedBy field set to a value starting with "ecs-svc/" that corresponds to an individual deployment within a service.