Containers on AWS: ECS, Fargate, ECR & EKS Flashcards

1
Q

Amazon ECS - EC2 Launch Type

A

Elastic Container Service
Launch docker containers on AWS
= Launch ECS Tasks on ECS clusters

EC2 Launch Type - Provision & maintain the infrastructure (EC2 instances)

Each EC2 instance needs ECS agent to register in the ECS cluster

AWS starts/stops containers

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

ECS Architecture - EC2 Launch Type

A

ECS Cluster -> EC2 instances -> ECS Agent in instances -> each new container is placed in EC2 instance

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

ECS - Fargate Launch Type

A

Launch docker containers on AWS

No provisioning infrastructure

Serverless

Just create task definitions

AWS runs ECS Tasks for you based on CPU / RAM you need

To scale - increase number of tasks

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

ECS - IAM Roles for ECS

A

EC2 instance profile (EC2 launch type only)
- used by ECS
- makes API calls to ECS
- send container logs to CLoudWatch
- pull docker image from ECR
- reference sensitive data in secrets manager or SSM parameter store.

ECS Task Role
- allows each task to have specific role
- use different roles for different ECS Services you run

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

ECS Load Balancer Integrations

A

ALB in front of the ECS Cluster which holds EC2 instances

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

Which Load Balancer is recommended for ECS?

A

Application Load balancer for most use cases

Network Load Balancer for high throughput/high performance use or to pair with AWS private Link

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

Data Volumes (EFS) for ECS

A

EFS is able to be used with an ECS Cluster, works for both EC2 and Fargate launch types, and it mounts directly onto the EC2 instance & Fargate

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

Benefit of using EFS with ECS?

A

Tasks running in any AZ will share the same data in EFS system

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

Ultimate combo for ECS and data volume?

A

Fargate and EFS = serverless

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

Use cases for EFS in ECS?

A

multi AZ persistent shared storage for containers

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

What can you NOT do with S3 and ECS?

A

cannot use S3 as a mounted file system

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

ECS Service Auto Scaling

A

auto increase/decrease desired number of ECS tasks

ECS auto scaling uses AWS app Auto Scaling
- ECS service Average CPU Utilisation
- ECS Service Average Memory Utilisation - Scale on RAM
- ALB Request count per target - metric coming from ALB

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

What is ECS Target Tracking?

A

scale based on target value for a specific CloudWatch metric

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

What is ECS Step scaling

A

scale on specified CLoudWatch Alarm

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

Scheduled scaling in ECS

A

scale based on a specific date/time (predictable changes)

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

EC2 Launch Type - Auto Scaling EC2 Instances

A

ASG Scaling
- based on CPU util
- add EC2 instances over time

ECS Cluster Capacity Provider
- used to automatically provision and scale the infrastructure for your ECS Tasks
- capacity provider paired with an ASG
- Add EC2 instances when you’re missing capacity (CPU, RAM)

17
Q

ECS Tasks invoked by Event Bridge

A

You have Region(VPC(ECS Cluster(AWS Fargate)))

Client uploads object in S3, Event gets sent to Amazon EventBridge which creates new ECS task. ECS task has a role, and its task is to access S3 & DynamoDB. Then the result is saved in AmazonDB

18
Q

ECS tasks invoked by Event Bridge Schedule

A

For example every 1 hour EventBridge runs an ECS task within AWS fargate in the ECS cluster

19
Q

ECS SQS Queue example

A

Messages get sent in SQS queue, poll messages to Service A which is within an ECS Service Auto Scaling group

20
Q

Amazon ECR (Elastic Container Registry)

A

Store and manage docker images on AWS

Private and Public repo (ECR Public Gallery)

Full integration with ECS, backed by S3

IAM access

Supports image vuln scanning, versioning, image tags, images lifecycle

21
Q

How to use ECR with ECS cluster

A

ECR repo with 2 docker images.

ECS cluster with EC2 instance and 3 containers, each container pulls the image from the ECR repo

22
Q

Amazon EKS

A

Amazon Elastic Kubernetes Service

23
Q

What is EKS used for

A

launch managed Kubernetes cluster on AWS

24
Q

EKS vs ECS

A

similar but use different API

25
Q

When is EKS good to be used for?

A

If your company is already using Kubernetes on-prem

26
Q

EKS Node Types

A

Managed Node Groups
- AWS manages them
- Part of ASG managed by EKS
- Supports on demand & spot instances

Self-Managed Nodes
- created by you, registered to EKS cluster and managed by ASG
- can use prebuilt AMI - EKS Optimised AMI
- supports on-demand & spots

AWS Fargate
- no maintenance required- no nodes managed

27
Q

Amazon EKS - Data Volumes

A

Specify StorageClass manifest on EKS cluster

Leverage Container Storage Interface (CSI)

Supports
- EBS
- EFS (Fargate)
- FSx for Lustre
- FSx for NetApp ONTAP

28
Q

AWS App Runner

A

managed service that deploys web app and APIs at scale

No infra exp required

start with source code or container image

automatically builds and deploys web app

29
Q

Benefits of AWS App Runner

A

HA
LB
Encryption
VPC access support
Connect DB, cache, message queue service