Book Image

Amazon Fargate Quick Start Guide

By : Deepak Vohra
Book Image

Amazon Fargate Quick Start Guide

By: Deepak Vohra

Overview of this book

Amazon Fargate is new launch type for the Amazon Elastic Container Service (ECS). ECS is an AWS service for Docker container orchestration. Docker is the de facto containerization framework and has revolutionized packaging and deployment of software. The introduction of Fargate has made the ECS platform serverless. The book takes you through how Amazon Fargate runs ECS services composed of tasks and Docker containers and exposes the containers to the user. Fargate has simplified the ECS platform. We will learn how Fargate creates an Elastic Network Interface (ENI) for each task and how auto scaling can be enabled for ECS tasks. You will also learn about using an IAM policy to download Docker images and send logs to CloudWatch. Finally, by the end of this book, you will have learned about how to use ECS CLI to create an ECS cluster and deploy tasks with Docker Compose.
Table of Contents (14 chapters)
Title Page
Copyright and Credits
Packt Upsell

Chapter 4. Using Auto Scaling

Amazon ECS provides built-in internal load balancing to distribute client traffic between the tasks in an ECS service. If all the client load were to be sent to a single task in a three-task service, the internal load balancer would direct some of the client traffic to the other tasks to distribute the client load evenly. 

Problem: The number of tasks in a service as configured initially is fixed. If the client load is expected to be fixed, the fixed number of tasks in an ECS service should suffice. But if client load fluctuates, the ECS service tasks do not scale automatically. If the client load were to increase, the preconfigured number of tasks may not be able to serve the client traffic.

Solution: Amazon ECS supports auto scaling using an auto scaling policy that consists of a CloudWatch alarm based on one of the ECS service metrics: CPUUtilization or MemoryUtilization. An alarm threshold must be set before any scaling action is performed; for instance, MemoryUtilization...