ECS / Fargate Flashcards
What is ECS?
- Elastic Container Service - fully managed container service.
- The AWS Docker container Service that handles the orchestration and provisioning of Dock Containers.
What are the componets of ECS?
- Cluster
- Task Definition
- Task Service
- Container Agent
Describe an ECS cluster
Multiple EC2 instances which will house the docker containers
Describe an ECS Task Definition
- 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.
Describe an ECS Task
Launches containers defined in the Task Definition. Tasks do not remain running once the workload is complete.
Describe an ECS task service
A service is a long running task (think web app) of the same task definition.
Describe an ECS Container Agent
A Binary on each EC2 instance which monitors, starts, and stops tasks
What is an ECR
Elastic Container Registry
Like a github for docker images
Store, manage, and deploy docker container images
What is Fargate?
- 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.
What are the three main types of ECS Docker Containers?
- Classic - provision EC2 instances to run containers onto
- Fagate - ECS Serverless - no need to provision EC2
- EKS (Kubernetes) - not yet on exam
Does ECS integrate with CloudWatch?
- 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
You are looking to run Microservices with Docker containers. Which service can help you manage these containers ?
ECS - Elastic Container Service
Which ECS config must you enable in /etc/ecs/ecs.config to allow your ECS tasks to endorse IAM roles?
ECS_ENABLE_TASK_IAM_ROLE
(Just remeber task roles)
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?
Double check your IAM permissions for CodeBuild service
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?
Application Load Balancer (ALB) + ESC (dynamic port values)