16. Docker (ECS, ECR, Fargate) Flashcards

1
Q

What is the ECS “binpack” strategy?

A
  • ECS task placement strategy
  • place tasks based on the least available amount of CPU or memory
  • This minimizes the number of instance in use (cost savings)
  • Tries to maximize EC2 instances in use
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the ECS “spread” strategy?

A
  • place the task evenly based on the specified value

- Example: instanceId, attribute:ecs.availability-zone

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

What is the ECS “distinctInstance” constraint?

A
  • ECS task placement constraint

- place each task on a different container instance

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

What is the ECS “memberOf” constraint?

A
  • ECS task placement constraint
  • places task on instances that satisfy an expression
  • Uses the Cluster Query Language (advanced)
  • Example: only place these types of tasks on t2 instances
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is Fargate?

A
  • Serverless ECS (serverless containers / docker)
  • no more EC2 to provision!
  • AWS provisions containers for us and assigns them ENI
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the 3 ECS “flavors”?

A
  1. ECS Classic
  2. Fargate
  3. EKS
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is an ECS Cluster?

A

Multiple EC2 instances which will house the docker containers

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

What is an ECS Task Definition?

A

A JSON file that defines the configuration of (up to 10) containers you want to run

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

What is an ECS Task?

A

Tasks launch containers defined in the Task Definition.

Tasks do not remain running once their workload is complete.

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

What is an ECS Service?

A

A Service ensures tasks remain running (e.g. web-apps)

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

What is an ECS Container Agent?

A

A binary installed on each EC2 instance which monitors, starts, and stops tasks

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

If you want to run a service but it cannot have a cold start, what should you use?

A

You should use ECS.

Fargate and Lambda both have cold starts

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

What is the maximum memory of a Fargate service?

A

30 GB

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

What is the maximum memory of a Lambda service?

A

3GB

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

What is the maximum duration of a Fargate service?

A

As long as you want

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

What is the maximum duration of a Lambda service?

A

15 min

17
Q

True or False: You cannot apply an IAM role to a task in Fargate.

A

False

You CAN apply an IAM role to a task in Fargate (and ECS). You can also apply an IAM role to services.

18
Q

True or False: You can define multiple containers within a task definition.

A

True

19
Q

The (docker) IMAGES can be provided via where?

A

ECR or an official docker repository (e.g. Docker Hub)

20
Q

How many essential containers must you have in ECS?

A

You must have one essential container. If this container fails or stops then all other containers will be stopped.

21
Q

True or False: You cannot apply a Security Group to a task in Fargate.

A

False

You CAN apply a Security Group to a task in Fargate (and ECS). You can also apply a security group to services.

22
Q

What are the ECS task placement constraints?

A

distinctInstance and memberOf

23
Q

What are the ECS task placement strategies?

A

Binpack, Random, Spread