ECS Flashcards
What is ECS “Cluster Query Language” used for?
Cluster queries are expressions that allow you to group objects. For example, you can group container instances by attributes such as Availability Zone, instance type, or custom metadata. For more information, see Attributes.
After you have defined a group of container instances, you can customize Amazon ECS to place tasks on container instances based on group.
What is an ECS “Cluster?”
A group of container instances. A cluster can:
– be a mix of EC2 and Fargate
– run multiple tasks
What is the relationship between a container, a Docker Image, and a Dockerfile?
A Dockerfile is used to create a Docker Image (each step creates file system layers). A container is a running copy of a Docker Image, similar to how an EC2 instance is a running copy of an EBS boot disk.
One exception to the generality: In addition to the Docker Image layers, a Docker Container includes one additional Read / Write Layer which differentiates two Containers
ECS runs in which two modes?
EC2 and Fargate
What is a “container definition?” What purpose does it serve?
It tells ECS where your container definition is (i.e., in a registry), which port the container uses,
What is an ECS task?
A self-contained application. Stores whatever container definitions are used to make up that one application. A “task definition” stores a lot of configuration information about the task (including an IAM Role the task can assume)
What does an ECS Service govern?
How we want an ECS task to scale. Can allow multiple tasks to run, even behind a load balancer. What you would use for business-critical applications running in AWS.
With EC2 Mode of ECS, who provisions the underlying EC2 instances, and who manages them?
ECS will PROVISION them, but YOU must manage them. They will appear in your account. ECS will do the following: Container Placement and Orchestration, Cluster Management, Placement Engine.
With ECS Fargate, where are the containers launched
In a “shared Fargate infrastructure platform.” Still use targets and services to define what you want to run, but these are deployed to the shared Fargate platform.
Each task (running in the Fargate instance) is “injected” into your VPC using an ENI (with an IP address in the VPC).
Where do you configure the permissions ECS needs to access other AWS services?
In the ECS Task “Task Role” (in the Task Definition)
How many roles does (a) ECS on EC2 and (b) ECS Fargate require?
ECS on EC2 requires two:
– one in the Instance Profile
– one in the Task Definition
ECS on Fargate only requires one in the Task Definition