[05] Clusters & Capacity Flashcards

1
Q

What must every task have to specify what capacity it should use when launched?

A

A capacity provider strategy, a launch type, or use the cluster’s default capacity provider strategy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Can a capacity provider be directly referenced?

A

No, only a capacity provider strategy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What tasks are not counted by capacity providers in the cluster for scaling actions?

A

Tasks using a launch type

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What do capacity provider strategies define?

A

Which capacity providers to use by specifying a weight and base for each

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Can EC2 and Fargate capacity providers be mixed?

A

No

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How are Fargate Spot interruptions sent to running tasks?

A

As a SIGTERM

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is sent after the stopTimeout configured in the task definition for a Fargate Spot interruption?

A

A SIGKILL

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What will happen if the Auto Scaling Group (ASG) for an EC2 Auto Scaling capacity provider cannot scale out to accommodate tasks?

A

The tasks will fail to transition beyond the PROVISIONING state

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does turning on managed scaling do for an EC2 Auto Scaling capacity provider?

A

The capacity provider creates a scaling policy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does managed termination protection do for an EC2 Auto Scaling capacity provider?

A

Prevents the Auto Scaling Group from terminating instances with running tasks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does managed draining allow for an EC2 Auto Scaling capacity provider?

A

Graceful termination of EC2 instances in an Auto Scaling Group by first stopping tasks running on the instance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Do instances part of a warm-pool register with the cluster until they are used?

A

No

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What happens if there is not sufficient capacity to launch tasks for services?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What happens if there is not sufficient capacity to launch standalone tasks and a launch type is used?

A

ecs:RunTask will fail

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What happens if there is not sufficient capacity to launch standalone tasks and a capacity provider is used?

A

The task will get created and be stuck in PROVISIONING

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What agents run on external instances?

A

ECS and SSM agents

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How often are IAM credentials rotated on external instances?

A

Every 30 minutes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Do external instances support load balancing?

A

No

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What operating systems are supported on external instances?

A

Linux & Windows

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What additional services can Windows instances use on external instances?

A

FSx & gMSA

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What network connectivity is required for external instances? (Multiple Choice)

A

ecs-a-..amazonaws.com, ecs-t-..amazonaws.com, ecs..amazonaws.com, ssm., ec2messages., ssmmesages.*

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What endpoints do external instances need connectivity to?

A

ecs-a-..amazonaws.com, ecs-t-..amazonaws.com, ecs..amazonaws.com, ssm., ec2messages., ssmmesages.*

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What is the ECS agent endpoint?

A

ecs-a-*..amazonaws.com

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What is the ECS telemetry endpoint?

A

ecs-t-*..amazonaws.com

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What is the ECS service endpoint?

A

ecs..amazonaws.com

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

What endpoints are required for SSM functionality?

A

ssm., ec2messages., ssmmesages.*

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

What are the possible states for a container instance in ECS?

A

REGISTERING, REGISTRATION_FAILED, ACTIVE, DRAINING, INACTIVE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

What state will a container instance be in when it is ready to run tasks?

A

ACTIVE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

When a container instance is stopped but not terminated, what happens to its status and agent connection?

A

The status remains ACTIVE but the agent connection transitions to FALSE, stopping running tasks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
30
Q

What are the steps to configure the ECS agent?

A
  1. 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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

Why should container instances be drained before updates or deregistration?

A

To gracefully replace service tasks while respecting minimumHealthyPercent and maximumPercent parameters, without affecting standalone or daemon tasks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

What happens if a container instance is deregistered without draining?

A

The tasks will become orphaned, continuing to run but not accounted for by the control plane

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
33
Q

How can you start a task at container instance launch time?

A

Add user data to introspect the container instance ID and then use ecs:StartTask to start a task on that instance

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
34
Q

What manages ENI trunking in ECS?

A

ENI trunking is fully managed by ECS, not the agent

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
35
Q

What is managed instance draining and what events trigger it?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
36
Q

What is the default setting for ECS_IMAGE_PULL_BEHAVIOR?

A

default

37
Q

What does the ‘default’ setting for ECS_IMAGE_PULL_BEHAVIOR do?

A

The image manifest will be pulled remotely first, if that fails the cached image on the instance will be used. Cached layers are still used if available.

38
Q

What does ECS create when cluster autoscaling is enabled?

A

A low metric value CloudWatch alarm, a high metric value CloudWatch alarm, and a target tracking scaling policy

39
Q

What metrics does ECS use for cluster autoscaling?

A

CapacityProviderReservation and DesiredCapacity

40
Q

What does the CapacityProviderReservation metric represent?

A

(instances needed) / (running instances)

41
Q

What does the DesiredCapacity metric represent?

A

Amount of capacity for the ASG

42
Q

What manages the minimum and maximum instance count for the ASG?

A

The ASG, not ECS

43
Q

What happens during scale-out?

A

ECS calculates how many additional instances will be required and increases the ASG’s desired count by this amount

44
Q

What blocks scale-out of a capacity provider?

A

If tasks have resource requirements greater than the smallest instance type in the ASG, or for instances within the instanceWarmupPeriod

45
Q

How many instances does ECS initially scale out to if there are no container instances running?

A

Two instances

46
Q

What does ECS wait for before considering a scale-in?

A

15 minutes

47
Q

How many datapoints does the CloudWatch scale-in alarm require before starting a scale-in?

A

15 datapoints (15 minutes)

48
Q

What is the PROVISIONING state?

A

The state a task will be in while ECS is performing additional steps

49
Q

What tasks are not accounted for during capacity provider autoscaling?

A

Tasks launched using a launch type

50
Q

What linux parameters are supported on Fargate?

A

SYS_PTRACE

51
Q

What is the purpose of enabling ECS spot instance draining?

A

To automatically drain container instances when they receive a spot interruption notice.

52
Q

What is required to enable ECS spot instance draining?

A

The ECS_ENABLE_SPOT_INSTANCE_DRAINING ECS Agent configuration, which is disabled by default.

53
Q

What instance interruption behaviour is not supported for ECS spot instance draining?

A

hibernate

54
Q

What is the purpose of ecs-init?

A

Initialises the ECS agent and ensures it keeps running.

55
Q

How does the ECS agent run on Linux?

A

As a container in host mode.

56
Q

What is the default root volume size for Amazon Linux 2023?

A

30 GiB

57
Q

What is the purpose of the root volume on Amazon Linux 2023?

A

Storing the OS and Docker images etc.

58
Q

What is the default filesystem for Amazon Linux 2023?

A

xfs

59
Q

What storage driver does Docker use on Amazon Linux 2023?

A

overlay2

60
Q

What is not available for Amazon Linux 2023 GPU instances?

A

An ECS-optimised AMI.

61
Q

What services have a directive to wait for cloud-init to finish before starting?

A

The systemd units for ECS and Docker services.

62
Q

What issue can arise from starting the agent or Docker from user data?

A

A deadlock due to waiting for cloud-init to finish.

63
Q

How can the deadlock caused by cloud-init be resolved?

A

With the –no-block flag for systemctl.

64
Q

What function does Docker use to query the available memory?

A

ReadMemInfo()

65
Q

Why is the memory available to Docker less than the instance’s memory?

A

Due to overhead from the kernel etc.

66
Q

What should the task’s memory reservation be less than?

A

The instance type’s memory.

67
Q

What parameter can be used to explicitly reserve memory for the ECS agent?

A

ECS_RESERVED_MEMORY

68
Q

What hosts should be bypassed when using a proxy for ECS on Linux?

A

169.254.169.254, 169.254.170.2 & /var/run/docker.sock

69
Q

How can the ECS agent be updated on Linux?

A

Using ecs:UpdateContainerAgent

70
Q

What allows ecs:UpdateContainerAgent to update the agent without affecting running tasks?

A

Recent agent versions save their state in ECS_DATADIR.

71
Q

What state will a task be in while ECS is performing additional steps?

A

The PROVISIONING state.

72
Q

What is the PROVISIONING state?

A

The state a task will be in while ECS is performing additional steps.

73
Q

🐈‍⬛

A

-EnableTaskENI

74
Q

What does the -EnableTaskENI parameter do?

A

It is required to support awsvpc tasks

75
Q

What is a limitation when using IAM roles for tasks on Windows?

A

The credential proxy runs on Port 80, so this port cannot be used for applications

76
Q

What special configuration is required when using IAM roles for tasks on Windows?

A

Special user data is required to configure this

77
Q

Why should you ensure the container instance has enough storage space when using Windows base images?

A

Windows base images are large (~9 GiB)

78
Q

What state will a task be in while ECS is performing additional steps?

A

PROVISIONING

79
Q

What is the PROVISIONING state?

A

The state a task will be in while ECS is performing additional steps

80
Q

What states can an ECS cluster be in?

A

ACTIVE, PROVISIONING, DEPROVISIONING, FAILED, INACTIVE

81
Q

What state will a cluster be in while ECS is creating resources for a capacity provider?

A

PROVISIONING

82
Q

What state will a cluster be in while ECS is deleting resources for a capacity provider?

A

DEPROVISIONING

83
Q

What does the FAILED cluster state indicate?

A

The resources needed for a capacity provider have failed to create

84
Q

What does the INACTIVE cluster state mean?

A

The cluster has been deleted

85
Q

Is Container Insights enabled at the cluster or service level?

A

Cluster level

86
Q

What is optionally created for a cluster?

A

A default CloudMap namespace

87
Q

How is GuardDuty Runtime Monitoring enabled for a cluster?

A

By setting the tag ‘guardDutyRuntimeMonitoringManaged’ to ‘true’

88
Q

At what level are the VPC and subnets set when using EC2 instances?

A

Cluster level

89
Q

What comes pre-installed on ECS-optimized AMIs?

A

The SSM agent