[05] Clusters & Capacity Flashcards
What must every task have to specify what capacity it should use when launched?
A capacity provider strategy, a launch type, or use the cluster’s default capacity provider strategy
Can a capacity provider be directly referenced?
No, only a capacity provider strategy
What tasks are not counted by capacity providers in the cluster for scaling actions?
Tasks using a launch type
What do capacity provider strategies define?
Which capacity providers to use by specifying a weight and base for each
Can EC2 and Fargate capacity providers be mixed?
No
How are Fargate Spot interruptions sent to running tasks?
As a SIGTERM
What is sent after the stopTimeout configured in the task definition for a Fargate Spot interruption?
A SIGKILL
What will happen if the Auto Scaling Group (ASG) for an EC2 Auto Scaling capacity provider cannot scale out to accommodate tasks?
The tasks will fail to transition beyond the PROVISIONING state
What does turning on managed scaling do for an EC2 Auto Scaling capacity provider?
The capacity provider creates a scaling policy
What does managed termination protection do for an EC2 Auto Scaling capacity provider?
Prevents the Auto Scaling Group from terminating instances with running tasks
What does managed draining allow for an EC2 Auto Scaling capacity provider?
Graceful termination of EC2 instances in an Auto Scaling Group by first stopping tasks running on the instance
Do instances part of a warm-pool register with the cluster until they are used?
No
What happens if there is not sufficient capacity to launch tasks for services?
The deployment will fail due to the circuit breaker. In some cases, it will launch tasks which remain in PROVISIONING (show as Pending in the Console), but in other cases it won’t try
What happens if there is not sufficient capacity to launch standalone tasks and a launch type is used?
ecs:RunTask will fail
What happens if there is not sufficient capacity to launch standalone tasks and a capacity provider is used?
The task will get created and be stuck in PROVISIONING
What agents run on external instances?
ECS and SSM agents
How often are IAM credentials rotated on external instances?
Every 30 minutes
Do external instances support load balancing?
No
What operating systems are supported on external instances?
Linux & Windows
What additional services can Windows instances use on external instances?
FSx & gMSA
What network connectivity is required for external instances? (Multiple Choice)
ecs-a-..amazonaws.com, ecs-t-..amazonaws.com, ecs..amazonaws.com, ssm., ec2messages., ssmmesages.*
What endpoints do external instances need connectivity to?
ecs-a-..amazonaws.com, ecs-t-..amazonaws.com, ecs..amazonaws.com, ssm., ec2messages., ssmmesages.*
What is the ECS agent endpoint?
ecs-a-*..amazonaws.com
What is the ECS telemetry endpoint?
ecs-t-*..amazonaws.com
What is the ECS service endpoint?
ecs..amazonaws.com
What endpoints are required for SSM functionality?
ssm., ec2messages., ssmmesages.*
What are the possible states for a container instance in ECS?
REGISTERING, REGISTRATION_FAILED, ACTIVE, DRAINING, INACTIVE
What state will a container instance be in when it is ready to run tasks?
ACTIVE
When a container instance is stopped but not terminated, what happens to its status and agent connection?
The status remains ACTIVE but the agent connection transitions to FALSE, stopping running tasks
What are the steps to configure the ECS agent?
- Stop the agent using sudo systemctl stop ecs 2. Make changes to /etc/ecs/ecs.config 3. Restart the agent using sudo systemctl start ecs
Why should container instances be drained before updates or deregistration?
To gracefully replace service tasks while respecting minimumHealthyPercent and maximumPercent parameters, without affecting standalone or daemon tasks
What happens if a container instance is deregistered without draining?
The tasks will become orphaned, continuing to run but not accounted for by the control plane
How can you start a task at container instance launch time?
Add user data to introspect the container instance ID and then use ecs:StartTask to start a task on that instance
What manages ENI trunking in ECS?
ENI trunking is fully managed by ECS, not the agent
What is managed instance draining and what events trigger it?
Managed instance draining facilitates graceful draining of instances. Events that trigger it include ASG refreshes, scale-in, health check failures, Spot capacity rebalancing, and Spot interruption.