Container Services on AWS (AWS ECS, Fargate, ECR, EKS)
What is Docker?
Docker is a software development platform for deploying applications. Applications are packaged in containers that can be run on any OS. Applications run the same, regardless of where they’re run.
Use Case: microservice architecture, lift and shift apps from on-premises to the AWS cloud.
For getting started with Docker first we need to write a Docker file that shows what a Docker container is like. Then build the docker image. That docker image can be stored in (docker repository) docker hub, AWS ECR. After we can pull the docker image from the repository and run.
AWS ECS
ECS — Elastic Container Service. ECS is a fully managed container service that helps to deploy, manage, and scale containerized applications. we launch ECS tasks on the ECS cluster. ECS cluster has two launch types.
1. EC2 launch type — We should have maintained the infrastructure ourselves and provision.
2. Fargate launch type — There are no instances to maintain. It's serverless. We just define ECS task definition for ECS tasks. AWS will make ECS tasks based on our RAM and CPU needs.
Can used with Application and Network load balancer Infront of ECS. Then users can access ECS using a load balancer.
EFS can be used as a Data Volume to do persistent multi-AZ shared storage for our containers.
AWS S3 cannot be mounted as a file system.
ECS Cluster — The ECS Cluster acts as a resource pool for our ECS tasks.
ECS Task Definition — This defines how our Docker container should run.
ECS Service — This manages how many tasks should run simultaneously in an ECS Cluster.
AWS ECR
ECR — Elastic Container Registry. ECR is used to store and manage Docker images on AWS. We can store docker images privately or publicly. Fully integrated with AWS ECS. Access control through IAM. ECR supports image vulnerability scanning, versioning, image tags, and managing lifecycle.
AWS EKS
EKS — Elastic Kubernetes Service. EKS is used to launch and manage Kubernetes clusters on AWS. (Kubernetes is an open-source system for automatic deployments, scaling, and management of containerized, usually Docker, applications)
EKS is an alternative to ECS, a similar goal but a different API.
The use case for using EKS is if we are already using Kubernetes on-premises, already using Kubernetes in another cloud, or just want to use the Kubernetes API, and want to use AWS to manage the Kubernetes cluster.