EC2 Container Service Flashcards
EC2 Container Service(ECS) Essentials
a container management service that supports Docker.
– allows you to easily create and manage a fleet of Docker containers on a cluster of Ec2 instances.
Why use ECS/Containers?
- create distributed applications an microservices
- Batch and ETL jobs
- Continuous integration and Deployment
Create distributed applications and Microservices
- create application architechture comprised of indepnedent tasks or processes.
- you can have separate containers for various components of your application
- this allows you to start, stop, manage, monitor, and scal each container independently.
Batch and ETL jobs
- package batch and ETl jobs into containers and deploy them into an shared EC2 clusters.
- Run different versions of the same job and nultiple jobs on the same cluster.
- Share cluster capacity with other processes and or grow job dynamically on-demand ot improve resource utilization.
Continuous Integration and Deployment
- -By using Dockers Image versioning, you can use containers for continuous integration and deployment.
- Build processes can pull, build, and create a docker image that can be deployed into your containers.
- this allows you to avoid an application from working in a developer environment and not working in a production environment because the docker daemon is the same across all environment.
Dockerfile
A Plain text file(script) that specifies all of the components that are included in the container.
- Basically it is the instructions for what will be placed inside a given container.
Container/Docker Image
a container/Docker image is built from a Docker file
The container/Docker image contains all the downloaded software, code, runtime, system tools, and libraries as outline in the Dockerfile.
Container Registry
is a repository where container/docker image are stored and accessed from when needed.
- a container registry can be
- located on AWS via the ECR service(EC2 COntainer Registry)
- a 3rd party repository like docker hub
- self-hosted registry
ECS Agent
runs on each EC2 instance in the ECS cluster
- communicates information about the instances to ECS, including: running tasks and resource Utilization
- The ECS agent is also responsible for starting/stopping tasks
Task Definition
a JSON formatted text file that contains the “blueprint” for your application, including:
- Which container/docker image to use.
- The repository(container registry) the image is located in.
- which ports should be open on the container instance.
- what data volumes should be used with the containers.
Tasks
- actual representation of the Task definition on an EC2 instance inside of your container cluster.
- The ECS agent will start/stop these tasks based on instruction/schedule.
Private Registry Authentication
The Amazon ECS container agent can authenticate with private registries, including Docker Hub, using basic authentication. When you enable private registry authentication, you can use private Docker images in your task definitions.