ECS Flashcards

1
Q

What is ECS?

A

A container management service to run, stop and manage Docker containers on a cluster.

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

What can ECS be used for?

A

ECS can be used to create a consistent deployment and build experience, manage, and scale batch and Extract-Transform-Load (ETL) workloads, and build sophisticated application architectures on a microservices model.

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

True/False. Amazon ECS is a regional service.

A

True.

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

True/False. You can only create ECS clusters within an existing VPC.

A

False. You can create ECS clusters within a new or existing VPC.

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

True/False. After a cluster is up and running, you can define task definitions and services that specify which Docker container images to run across your clusters.

A

True.

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

What is AWS’s SLA monthly uptime guarantee for ECS?

A

AWS Compute SLA guarantees a Monthly Uptime Percentage of at least 99.99% for Amazon ECS.

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

What is Amazon ECS Exec?

A

Amazon ECS Exec is a way for customers to execute commands in a container running on Amazon EC2 instances or AWS Fargate. ECS Exec gives you interactive shell or single command access to a running container.

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

Containers

A

Contain everything that your software application needs to run: code, runtime, system tools, system libraries, etc.

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

Image

A

Containers are created from a read-only template called an image.

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

How are images typically built and stored?

A

Images are typically built from a Dockerfile, a plain text file that specifies all of the components that are included in the container. These images are then stored in a registry from which they can be downloaded and run on your cluster.

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

True/False. When you launch a container instance, you have the option of passing user data to the instance. The data can be used to perform common automated configuration tasks and even run scripts when the instance boots.

A

True.

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

True/False. Docker Volumes can only be a local instance store volume and not an EBS volume or EFS volume.

A

False. Docker Volumes can be a local instance store volume, EBS volume, or EFS volume. Connect your Docker containers to these volumes using Docker drivers and plugins.

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

Task Definitions.

A

Specify various parameters for your application. It is a text file, in JSON format, that describes one or more containers, up to a maximum of ten, that form your application.

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

What parts do Task Definitions consist of?

A

-Task family – the name of the task, and each family can have multiple revisions.
-IAM task role – specifies the permissions that containers in the task should have.
-Network mode – determines how the networking is configured for your containers.
-Container definitions – specify which image to use, how much CPU and memory the container is allocated, and many more options.
-Volumes – allow you to share data between containers and even persist the data on the container instance when the containers are no longer running.
-Task placement constraints – lets you customize how your tasks are placed within the infrastructure.
-Launch types – determines which infrastructure your tasks use.

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

Task.

A

This is the instantiation of a task definition within a cluster. After you have created a task definition for your application, you can specify the number of tasks that will run on your cluster.

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

True/False. Each task that uses the Fargate launch type has its own isolation boundary and does not share the underlying kernel, CPU resources, memory resources, or elastic network interface with another task.

A

True.

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

Task Scheduler

A

Responsible for placing tasks within your cluster

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

What kind of scheduling options are available?

A

-REPLICA — places and maintains the desired number of tasks across your cluster. By default, the service scheduler spreads tasks across Availability Zones. You can use task placement strategies and constraints to customize task placement decisions.
-DAEMON — deploys exactly one task on each active container instance that meets all of the task placement constraints that you specify in your cluster. When using this strategy, there is no need to specify a desired number of tasks, a task placement strategy, or use Service Auto Scaling policies.

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

What happens when you upload a new version of your application task definition?

A

When you upload a new version of your application task definition, the ECS scheduler automatically starts new containers using the updated image and stop containers running the previous version.

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

True/False. Amazon ECS tasks running on both Amazon EC2 and AWS Fargate cannot mount Amazon Elastic File System (EFS) file systems.

A

False. Amazon ECS tasks running on both Amazon EC2 and AWS Fargate CAN mount Amazon Elastic File System (EFS) file systems.

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

Cluster.

A

is a logical grouping of resources

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

True/False. Clusters are Region-specific.

A

True.

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

True/False. Clusters cannot contain tasks using both the Fargate and EC2 launch types.

A

False. Clusters CAN contain tasks using both the Fargate and EC2 launch types.

24
Q

True/False. When using the Fargate launch type with tasks within your cluster, ECS manages your cluster resources.

A

True.

25
Q

Who manages a cluster of container instances when EC2 launch type is used?

A

When using the EC2 launch type, then your clusters are a group of container instances you manage. These clusters can contain multiple different container instance types, but each container instance may only be part of one cluster at a time.

26
Q

What must be done before deleting a cluster?

A

Before you can delete a cluster, you must delete the services and deregister the container instances inside that cluster.

27
Q

True/False. Enabling managed Amazon ECS cluster auto-scaling allows ECS to manage the scale-in and scale-out actions of the Auto Scaling group. On your behalf, Amazon ECS creates an AWS Auto Scaling scaling plan with a target tracking scaling policy based on the target capacity value that you specify.

A

True.

28
Q

What deployment strategies exist in ECS?

A

-Rolling Update
-Blue/Green Deployment with AWS CodeDeploy

29
Q

What are Rolling updates?

A

-This involves the service scheduler replacing the currently running version of the container with the latest version.
-The number of tasks ECS adds or removes from the service during a rolling update is controlled by the deployment configuration, which consists of the minimum and maximum number of tasks allowed during service deployment.

30
Q

What are Blue/Green Deployments with AWS CodeDeploy?

A

-This deployment type allows you to verify a new deployment of a service before sending production traffic to it.
-The service must be configured to use either an Application Load Balancer or Network Load Balancer.

31
Q

What is a container agent?

A

-The container agent runs on each infrastructure resource within an ECS cluster.
-It sends information about the resource’s current running tasks and resource utilization to ECS, and starts and stops tasks whenever it receives a request from ECS.
-The container agent is only supported on Amazon EC2 instances.

32
Q

What load balancers are supported by ECS?

A

Amazon ECS services support the Application Load Balancer, Network Load Balancer, and Classic Load Balancer ELBs. Application Load Balancers are used to route HTTP/HTTPS (or layer 7) traffic. Network Load Balancers are used to route TCP or UDP (or layer 4) traffic. Classic Load Balancers are used to route TCP traffic.

33
Q

What is the benefit of attaching multiple target groups to your ECS services that are running on either EC2 or Fargate?

A

This allows you to maintain a single ECS service that can serve traffic from both internal and external load balancers and support multiple path-based routing rules and applications that need to expose more than one port.

34
Q

What benefit does an application load balancer provider over a classic load balancer?

A

The Classic Load Balancer doesn’t allow you to run multiple copies of a task on the same instance. You must statically map port numbers on a container instance. However, an Application Load Balancer uses dynamic port mapping, so you can run multiple tasks from a single service on the same container instance.

35
Q

What happens when a service’s task fails the load balancer health check criteria?

A

If a service’s task fails the load balancer health check criteria, the task is stopped and restarted. This process continues until your service reaches the number of desired running tasks.

36
Q

True/False. Services with tasks that use the awsvpc network mode, such as those with the Fargate launch type, do not support Classic Load Balancers. You must use NLB instead of TCP.

A

True.

37
Q

True/False. You can use Fargate with ECS to run containers while having to manage servers or clusters of EC2 instances.

A

False. You can use Fargate with ECS to run containers without having to manage servers or clusters of EC2 instances.

38
Q

True/False. With AWS Fargate, You no longer have to provision, configure, or scale clusters of virtual machines to run containers.

A

True.

39
Q

True/False. Fargate only supports container images hosted on Elastic Container Registry (ECR).

A

False. Fargate only supports container images hosted on Elastic Container Registry (ECR) OR Docker Hub.

40
Q

What does Fargate task definitions require what the network mode be set to awsvpc?

A

awsvpc network mode provides each task with its own elastic network interface.

41
Q

What must you specify with Fargate task definitions?

A

CPU and memory at the task level.

42
Q

What log driver is supported for Fargate task definitions?

A

Fargate task definitions only support the awslogs log driver for the log configuration. This configures your Fargate tasks to send log information to Amazon CloudWatch Logs.

43
Q

True/False. Task storage is ephemeral. After a Fargate task stops, the storage is deleted.

A

True.

44
Q

True/False. Amazon ECS tasks running only on Amazon EC2 can mount Amazon Elastic File System (EFS) file systems.

A

False. Amazon ECS tasks running on both Amazon EC2 and AWS Fargate can mount Amazon Elastic File System (EFS) file systems.

45
Q

When would you put multiple containers in the same task definition?

A

-Containers share a common lifecycle.
-Containers are required to be run on the same underlying host.
-You want your containers to share resources.
-Your containers share data volumes.

Otherwise, define your containers in separate task definitions so that you can scale, provision, and de-provision them separately.

46
Q

True/False. Create task definitions that group the containers that are used for a common purpose, and separate the different components into multiple task definitions.

A

True.

47
Q

True/False. After you have your task definitions, you can create services from them to maintain the availability of your desired tasks.

A

True.

48
Q

What data volume types are support with EC2 tasks?

A

Docker volumes and Bind mounts.

49
Q

True/False. Public repositories are only supported by the EC2 Launch Type.

A

False. Private repositories are only supported by the EC2 Launch Type.

50
Q

How do you log your container instances?

A

You can configure your container instances to send log information to CloudWatch Logs. This enables you to view different logs from your container instances in one convenient location.

51
Q

True/False. With CloudWatch Alarms, watch a single metric over a time period that you specify, and perform one or more actions based on the value of the metric relative to a given threshold over a number of time periods.

A

True.

52
Q

How can you share log files between accounts?

A

Share log files between accounts, and monitor CloudTrail log files in real time by sending them to CloudWatch Logs.

53
Q

Does ECS support tagging?

A

ECS resources, including task definitions, clusters, tasks, services, and container instances, are assigned an Amazon Resource Name (ARN) and a unique resource identifier (ID). These resources can be tagged with values that you define, to help you organize and identify them.

54
Q

How does AWS charge for Fargate usage?

A

With Fargate, you pay for the amount of vCPU and memory resources that your containerized application requests. vCPU and memory resources are calculated from the time your container images are pulled until the Amazon ECS Task terminates.

55
Q

How does AWS charge for EC2 launch type usage?

A

There is no additional charge for the EC2 launch type. You pay for AWS resources (e.g. EC2 instances or EBS volumes) you create to store and run your application.