In this exam cram, we're going to cover Docker containers and ECS. So, the key features of the Elastic
Container Service are, all it provides you serverless computing with AWS Fargate managed for you and fully
scalable. Fully managed container orchestration.
The control plane is managed for you. And Docker support,
you can run and manage Docker containers with integration into the Docker compose CLI.
You also get Windows Container Support. ECS supports management of Windows containers.
You get Elastic Load Balancer integration so you can distribute traffic across containers using either
an ALB or an NLB.
You get Amazon ECS anywhere, which is brand new.
It enables the use of the ECS control plane to manage on-premises implementations.
So the various components are, you have a cluster.
It's a logical grouping of EC2 instances.
Those are the instances on which the containers will run. A container instance
is an EC2 instance that runs the ECS agent.
So, your cluster is essentially a grouping of those container instances.
A task definition is a blueprint that describes how a Docker container should launch, and the task
itself is a running container using settings from a task definition.
A service is used to define long running tasks, and you can control how many tasks you want to run.
You can also use auto scaling and elastic load balancing.
Now, the launch types are important to remember. These determine the type of infrastructure on which
your tasks and services are hosted.
There are two.
You've got the Amazon EC2 launch type or Fargate. With EC2, you explicitly provision EC2
instances, and you're responsible for upgrading, patching, and taking care of that pool of instances.
You have to handle cluster optimization, but you get more granular control over infrastructure.
With Fargate, the control plane asks for resources and Fargate provisions, so it's fully serverless.
Fargate provisions the compute as needed and handles all cluster optimization.
You have limited control as the infrastructure is automated, but also you have less management overhead.
Moving on to ECS images, containers are created from Read-Only templates called an image, which has
the instructions for creating a Docker container. Images are built from a Docker file. And only Docker containers
are currently supported.
An image contains the instructions for creating the container.
Images are stored in a registry such as Docker Hub or the Elastic Container Registry.
ECR is a managed AWS Docker registry service that is secure, scalable, and reliable, and it's also
private. ECS tasks.
A task definition is required to run Docker containers in ECS.
It's a text file in JSON format that describes one or more containers up to 10. Task definitions
use Docker images to launch the actual containers. And you can specify the number of tasks to run.
So, how many containers you need.
ECS clusters are a logical grouping of container instances that you place your tasks on.
An ECS allows the definition of a specified number of tasks to run in the cluster.
Clusters can contain tasks using both Fargate and EC2. Each container
instance may only be part of one cluster at a time. And you can create IAM policies for your clusters
to allow or restrict users access to specific clusters.
The ECS container agent allows container instances to connect to the cluster.
The container agent runs on each infrastructure resource on an ECS cluster.
The container agent is included in the Amazon ECS optimized AMI.
The container agent is Linux and Windows-based. And for non-Linux instances to be used on AWS, you
must manually install the ECS container agent.
So, what about auto scaling for ECS? There's two types. You've got service and cluster auto scaling. Service
auto scaling adjusts the desired task count up or down using the application auto scaling service.
It supports target tracking, step, and scheduled scaling policies.
Cluster auto scaling uses a capacity provided to scale the number of EC2 cluster instances using EC2
auto scaling. A bit more detail.
ECS service auto scaling supports the following policies. You've got target tracking, step scaling
policies, and scheduled scaling.
So, make sure you understand the difference between these.
We went over these in quite a bit of detail in the section on auto scaling. With cluster auto scaling,
it uses a capacity provider. And that's associated with an EC2 auto scaling group. And the ASG can
automatically scale using managed scaling and managed instance
termination protection can be configured as well.
So, what about the Elastic Kubernetes Service, EKS? Well, you would use this when you need to standardize
container orchestration across multiple environments using a managed Kubernetes implementation.
So, if you see Kubernetes, then you think EKS. You can have a hybrid deployment where you manage Kubernetes
clusters and applications across hybrid environments like AWS and on-premises. Batch processing where
you're using the Kubernetes Jobs API.
It can be used for machine learning use cases and web applications as well.
The key thing to remember for the exam is that when you see that people are already using Kubernetes
and they want to maintain that same management layer, that's when you would use EKS.
So, what about ECS versus EKS?
So, both are all managed, highly available, highly scalable container platforms. With ECS, it's AWS specific
and supports Docker.
It's considered simpler to learn and use and it leverages various AWS services.
Tasks are instances of containers that run on the underlying compute, and there's limited extensibility.
With EKS, it's compatible with Kubernetes, so it's easy to lift and shift from other Kubernetes deployments.
Kubernetes is considered to be more feature rich and complex and has a steep learning curve.
EKS is a hosted Kubernetes platform that handles many things internally, so it's not necessarily got
the same integration with AWS services. Rather than tasks, on EKS you have pods. So, look out for that
terminology.
Pods are containers co-located with one another and can have shared access to each other. And EKS
is extensible via a wide variety of third party and community add-ons.
And that's it for this exam cram.