Section 17: ECS, ECR & Fargate - Docker in AWS Flashcards
What is a hypervisor?
A computer software, firmware or hardware that creates and runs virtual machines
What other name is given to a hypervisor?
Virtual Machine Monitor (VMM)
What is a host machine?
A computer on which a hypervisor runs one or more virtual machines
What is a guest machine?
A virtual machine
What is Docker?
Docker is a software development platform to deploy apps that are packaged in containers that can run on any OS
What are the benefits of using Docker?
Run on any machine No compatibility issues Predictable behavior Less work Easier to maintain and deploy Works with any language, OS and technology
Can a machine run many Docker containers at the same time?
Yes
What is the difference between a Docker image vs Docker container?
A Docker container is an actual instanciation of a Docker image
What does a Docker image packs?
The application and environment required by the application to run
Where are Docker images stored?
In Docker Repositories
What is the main public Docker Repository?
Docker Hub
What AWS service allows you to create your own private Docker repository?
AWS ECR
What does ECR stand for?
Elastic Container Registry
What does VM stand for?
Virtual Machine
How does Docker Containers differ from VMs?
VMs are sitting on an hypervisor and all have their own guest OS
Docker containers are managed by the Docker Daemon, which itself is controlled by the Docker client (CLI, AWS Console, etc.)
What is the file that allows you to create Docker images?
Dockerfile
What are the three container management platforms offered by AWS?
ECS
EKS
Fargate
What does ECS stand for?
Elastic Container Service
What does EKS stand for?
Elastic Kubernetes Service
What are ECS Clusters?
Logical grouping of EC2 instances
What kind of AMI does EC2 instances inside an ECS cluster must use?
An ECS-optimized AMI containing the ECS agent?
What is the ECS agent?
A container that runs by default on ECSโ EC2 instances that is responsible for managing containers on behalf of Amazon ECS
What does the ECS agents do when EC2 instances are created inside an ECS cluster?
They register the instances to the ECS cluster
What are ECS Task Definitions?
Metadata in JSON form to tell ECS how to run a Docker Container
What does an ECS task definition contain?
Task name Task role (optional) Task execution role Memory and CPU required Container definitions
What do container definitions contain?
Container name Image Memory limits Port mappings Environment variables
What do ECS Services do?
Define how many tasks should run and how they should be run
Ensure that the number of tasks desired is running accross our fleet of EC2 instances
What is โTask roleโ ?
The Task Role is optional IAM role that tasks can use to make API requests to authorized AWS services.
What is โTask execution roleโ ?
The Task Execution Role is the role that authorizes Amazon ECS to pull private images and publish logs for your task. This takes the place of the EC2 Instance role when running tasks.
What must be tasks definitions port mapping host port in order to make them work with an ALB?
0, they will get generated randomly and the ALB will take care of forwarding the traffic to those generated ports
What do you need to do BEFORE any push / pull to AWS ECR private repositories?
You need to retrieve an authentication token from AWS and authenticate from your Docker client to your registry using the docker CLI
aws ecr get-login-password โregion ca-central-1 | docker login โusername AWS โpassword-stdin _____________.dkr.ecr.ca-central-1.amazonaws.com/repositoryname
What docker command allows you to push an image?
docker push ____
What docker command allows you to pull an image?
docker pull ____
What is Fargate?
AWS Fargate is a serverless compute engine for containers that works with ECS and EKS
What does Fargate removes?
The need to provision and manage servers
What is the only role of the developer when using Fargate?
Creating Task Definitions
What is the file that must be configured with the cluster name when working directly with EC2 instances when working with ECS?
/etc/ecs/ecs.config
What traffic must EC2 instances security group accept when working with ECS with an ALB?
The traffic from ALL ports from the ALB
What are the two available X-Ray integration options for classic ECS clusters?
X-Ray Container as a Daemon
X-Ray Container as a โSide Carโ
What port mapping configuration should the X-Ray Container have?
{ "HostPort": 0, "containerPort": 2000, "protocol": "udp" }
What should your app container have in order to find the X-Ray Container as a Daemon?
The environment variable
AWS_XRAY_DAEMON_ADDRESS=xray-daemon:2000
And a โlinksโ array containing the value โxray-daemonโ
Can you run docker containers in EB?
Yes, either in Single or Multi Docker mode
What does your EB source code need in order to run Docker containers?
Dockerfile
Dockerrun.aws.json
How can you create a service on ECS using the CLI?
aws ecs create-service
What docker CLI cmd allows you to build a docker image?
docker build -t demo .
The . is important here