ECS / Fargate Flashcards

1
Q

What is ECS?

A
  • Elastic Container Service - fully managed container service.
  • The AWS Docker container Service that handles the orchestration and provisioning of Dock Containers.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the componets of ECS?

A
  • Cluster
  • Task Definition
  • Task Service
  • Container Agent
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Describe 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
4
Q

Describe an ECS Task Definition

A
  • A JSON file that defines the configuration of (up to 10) containers that you want to run
  • Does NOT run the container, but provides the directions of HOW the container should run.
  • Should contain a Task Role which is an IAM role that tasks will use to make API requests to authorized AWS services.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Describe an ECS Task

A

Launches containers defined in the Task Definition. Tasks do not remain running once the workload is complete.

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

Describe an ECS task service

A

A service is a long running task (think web app) of the same task definition.

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

Describe an ECS Container Agent

A

A Binary 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
8
Q

What is an ECR

A

Elastic Container Registry

Like a github for docker images

Store, manage, and deploy docker container images

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

What is Fargate?

A
  • A serverless container.
  • Run containers and pay based on a duration and consumption
  • Has Cold Starts
  • Duration: can be infinite
  • Memory: Up to 30 GB of memory
  • Pricing: Pay at least 1 minute and every additional second.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the three main types of ECS Docker Containers?

A
  • Classic - provision EC2 instances to run containers onto
  • Fagate - ECS Serverless - no need to provision EC2
  • EKS (Kubernetes) - not yet on exam
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Does ECS integrate with CloudWatch?

A
  • Yes. You need to setup logging at the task definition level
  • Each container will have a different log stream.
  • EC2 Instance Profile needs to have the correct IAM permissions.
  • Use IAM Task Roles for your tasks
  • Task Placement Strategies: binpack, random, spread
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

You are looking to run Microservices with Docker containers. Which service can help you manage these containers ?

A

ECS - Elastic Container Service

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

Which ECS config must you enable in /etc/ecs/ecs.config to allow your ECS tasks to endorse IAM roles?

A

ECS_ENABLE_TASK_IAM_ROLE

(Just remeber task roles)

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

You are looking to push Docker images into ECR with your AWS CodePipeline and CodeBuild. The last step fails with an authorization issue. What is the issue?

A

Double check your IAM permissions for CodeBuild service

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

You are looking to run multiple instances of the same application on the same EC2 instance and expose it with a load balancer. The application is available as a Docker container. Which load balancer should you use?

A

Application Load Balancer (ALB) + ESC (dynamic port values)

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

You are running a web application on ECS, the Docker image is stored on ECR, and trying to launch two containers of the same type on EC2. The first container starts, but the second one doesn’t. You have checked and there’s enough CPU and RAM available on the EC2 instance. What’s the problem?

A

The host port is being defined in the task definition.

To enable random host port, set host port = 0 (or empty), which allows multiple containers of the same type to launch on the same instance The dynamic port forwarding on the ALB will know where to route the request to.

Note: Container ports still need to be defined in the task definition file.