DevOps Training
  • DevOps
  • What is DevOps
    • What DevOps Look like
    • Why DevOps Needed
    • DevOps Automation Tools
    • DevOps Principles
  • cloud computing
    • How DevOps links with Cloud Computing
    • What is cloud computing?
      • Platform as a service (PaaS)
      • Infrastructure as a service (IaaS)
      • Software as a service (SaaS)
      • Function as a Service
      • SaaS, PaaS, IaaS
  • Version Control
    • Git as Version Control
      • Setting up Remote Repo
      • Git Hooks
      • github vs gitlab vs bitbucket
      • Quick Recap Git
  • DevOps #01 Continuous Integration
    • Continuous Integration & Continuous Delivery
      • Understanding CI Tools
      • Prerequisite
      • Continuous Integration
      • CI Tools
      • Travis-CI
        • Travis CI with S3
        • Static Site Build S3
        • Beanstalk with AWS CLI
          • Elastic Beanstalk with Travis CI
        • Travis using Code Deploy EC2
          • Github and Code Deploy
          • Travis CI with Code Deploy
      • Gitlab-CI
        • CI Setup for application
        • Gitlab Runners on EC2
        • CI Integration with AWS
          • Deploying App using Gitlab CI
          • Gitlab CI with AWS S3
          • Gitlab CI with ECS
          • CI Integration with EC2
            • Update and Clean Gitlab.yml
        • Install Gitlab on EC2
      • CI/CD using Jenkins CI
        • Jenkins Build on EC2
        • Jenkins Build EC2 Ubuntu
        • Jenkins CI/CD
          • Create a Build Item
          • Create a Build Pipleine
            • Pipeline Using Docker
            • Pipeline Examples
          • Jenkins CI with S3
            • Jenkins CI - S3
          • Jenkins CI with EC2
    • Jenkins CI Cluster Mode
    • AWS Code Pipeline CI/CD
      • AWS CI/CD Tools
        • AWS Code Build
        • AWS Code Deploy to Beanstalk
        • AWS Code Deploy to EC2
        • AWS Pipeline - Example CI/CD
  • Docker
    • Docker
      • Docker for Developers
        • Install and setup
        • Docker Commands
        • Docker Images Container
        • Docker Architecture
    • Docker Demos
      • Node JS Container
    • Docker-compose
      • Using Docker Compose
      • Docker Compose Demo
  • AWS Quick Refresh
    • AWS Quick Recap - Videos
    • AWS Quick Recap
  • AWS Architecture - Lab
    • Application Deployment - 01
    • Application Deployment - 02
    • Application 3 tier Architecture
  • Basic Networking
    • Computer Networking for Beginners
      • Basic of Networking
      • Networking Protocols
      • OSI Model
      • Network address and Host address
      • Subnetting Type
    • Network Architecture
    • Networking Layers OSI Model
    • Internet protocol
      • CIDR and subnetting
        • Examples
      • AWS VPC Subnets
  • VPC and Networking
    • AWS VPC
    • VPC Demo
      • Bastion Host | Jump Server
  • AWS Components
    • AWS Components In Depth
      • AWS Storage
        • AWS EBS
        • AWS Cloudfront
        • AWS S3
      • AWS Compute
        • ECS
        • AWS VPC
          • VPC Components
        • AWS EC2
        • AWS ELB
          • Application Load balancer
            • Example
        • AWS EC2 Auto Scaling
          • Demo
        • AWS Route 53
        • AWS Lambda Serverless
          • AWS Lambda Serverless Computing
  • Assignments
    • Assignment 01-Node JS app on EC2
    • Assignment 02-Node JS with Mysql
    • Assignment-03
  • Microservices
    • Microservices Architecture
      • Docker and Docker-Compose
      • Docker-Compose Example 01
      • Docker-Compose Example 02
      • Hand-on | Building Microservices
    • Architecture Components
  • AWS ECS
    • AWS ECS
      • Introduction of ECS
Powered by GitBook
On this page

Was this helpful?

  1. AWS ECS
  2. AWS ECS

Introduction of ECS

PreviousAWS ECS

Last updated 5 years ago

Was this helpful?

Docker

To appreciate Amazon ECS, you first have to understand Docker.

Docker is a client-server application that can be installed on Linux, Windows, and MacOS and that allows you to run Docker . Containers are lightweight environments containing everything needed to run a specific application or part of an application. Multiple different containers can be run on one machine, so long as it has the Docker software installed.

If you’re interested in how they work, and how Docker is different from a virtual machine, then this is a great place to start.Adapted from Docker’s ‘’, see here for ‘’

Using Docker containers allows teams to have a consistent development environment by abstracting away the software, operating system, and hardware configuration into a standard building block that can be run on any machine.

Each container has exactly what it needs — for example, certain versions of a language or library — and no more than it needs. Multiple containers can be used for different parts of your application if you want, and they can be set up to communicate with each other when needed.

By using specified Docker containers to run your production code, you can be sure that your development environment is exactly the same as your production environment.

As your application grows, managing the deployment, structure, scheduling, and scaling of these containers rapidly becomes very complicated. This is where a “container management service” comes in. It aims to allow simple configuration options and handles the heavy lifting while you go back to writing the app.

An intro to Amazon ECS

…a highly scalable, fast, container management service that makes it easy to run, stop, and manage Docker containers on a cluster.

It’s worth noting that it is tied into the Amazon infrastructure, unlike some other providers that allow more flexibility. However, that means it comes with excellent integration with other AWS services.

Terms and architecture

Let’s give some imaginary context for the definitions we are about to look at. Say you are building an application that runs on two Docker containers, perhaps one for the main application, and one for managing metrics. Both are needed for the application to run as intended. If you had large amounts of traffic, you might need to run several pairs of containers.

Here we come to two sets of new terms:

  • a Task Definition, Task, and Service, and

  • a Cluster, ECS Container Instance, and ECS Container Agent.

Task Definition

This is the blueprint describing which Docker containers to run and represents your application. In our example, it would be two containers. would detail the images to use, the CPU and memory to allocate, environment variables, ports to expose, and how the containers interact.

Task

An instance of a Task Definition, running the containers detailed within it. Multiple Tasks can be created by one Task Definition, as demand requires.One Task Definition creates several identical Tasks

Service

Defines the minimum and maximum Tasks from one Task Definition run at any given time, autoscaling, and load balancing. In our example, if the CPU was maxed out from the single task we had running, we may want it to add an additional Task.

We may, however, want to limit the maximum number of Tasks it can run, since we know that running extra Tasks uses additional resources that cost money.Service definition defining alarms of when to scale capacity

Now that we have our Service, its Tasks need to be run somewhere in order to be accessible. It needs to be put on a Cluster, and the container management service will handle it running across one or more ECS Container Instance(s).

ECS Container Instances and ECS Container Agents

One ECS Container Instance running 8 Tasks from multiple different Services

The Agent takes care of the communication between ECS and the instance, providing the status of running containers and managing running new ones.

Cluster

An example ECS cluster, with one Service running four Tasks across two ECS Container Instances

As seen above, a Cluster is a group of ECS Container Instances. Amazon ECS handles the logic of scheduling, maintaining, and handling scaling requests to these instances. It also takes away the work of finding the optimal placement of each Task based on your CPU and memory needs.

A Cluster can run many Services. If you have multiple applications as part of your product, you may wish to put several of them on one Cluster. This makes more efficient use of the resources available and minimizes setup time.Multiple Services allocated across multiple ECS Container Instances running on one Cluster

Conclusion

We have seen how a Dockerized application can be represented by a Task Definitionthat has a one-to-one relationship with a Service which in turn uses it to create many different Task instances.

This Service is deployed to a Cluster of ECS Container Instances that provide the pool of resources needed to run and scale your application. Additional Services can be deployed to the same Cluster.

Amazon ECS, or any container management service, aims to make this as simple as possible, abstracting away many complexities of running infrastructure at scale.A Cluster running 3 Services, each running a different amount of Tasks, across two ECS Container Instances

As your needs become more complex, the container management service ensures this remains manageable. Using its API or Management Console, you can put definitions in place to add new Container Instances as you need them. This makes sure that there are always a healthy number of Tasks running, and intelligently allocates resources across Services.

Thanks for reading!

Resources

Amazon (ECS) is, according to Amazon,

It is comparable to , , and .

ECS runs your containers on a cluster of (Elastic Compute Cloud) pre-installed with Docker. It handles installing containers, scaling, monitoring, and managing these instances through both an API and the AWS Management Console. It allows you to simplify your view of EC2 instances to a pool of resources, such as CPU and memory. The specific instance a container runs on, and maintenance of all instances, is handled by the platform. You don’t have to think about it.

This is an that has Docker and an ECS Container Agent running on it. A Container Instance can run many Tasks, from the same or different Services.

Elastic Container Service
Kubernetes
Docker Swarm
Azure Container Service
Amazon EC2
virtual machine instances
EC2 instance
Gentle Introduction to How AWS ECS Works with Example Tutorial
Deploying Clustered Akka Applications on Amazon ECS
Building Blocks of Amazon ECS
Introduction to Amazon EC2 Container Service (ECS) — Docker Management on AWS
Amazon ECS: Core Concepts
AWS EC2 for Beginners
A Better Dev/Test Experience: Docker and AWS
Cluster-Based Architectures Using Docker and Amazon EC2 Container Service
containers
intro to Docker
get started
bins/libs