6

I'm a beginner starting to learn about Amazon EC2 and I want to get clear on the following terms, if anyone can supply a basic definition and perhaps an example to tie them together that would be phenomenal:

Task, Service, Container, Instance, Cluster (of containers), State (of a cluster, most odds), ECS.

A partial answer will also be valuable.

1
4

AWS provide different services and categories them on base of computation, storage, databases, management, Analytics, Messaging, Developer Tools etc.

ECS comes under the computing services.

Amazon EC2 Container Service (ECS) – Container Management for the AWS Cloud

Run your applications packaged as Docker containers.EC2 Container Service (or ECS for short). This service will make it easy for you to run any number of Docker containers across a managed cluster of Amazon Elastic Compute Cloud (EC2) instances using powerful APIs and other tools. You do not have to install cluster management software, purchase and maintain the cluster hardware, or match your hardware inventory to your software needs when you use ECS.

Here I will explain the steps to set up the docker based application in ECS and terminology.

  1. Cluster: A cluster is a pool of EC2 instances in a particular AWS Region, all managed by ECS. One cluster can contain multiple instance types and sizes, and can reside within one or more Availability Zones.

This is the first step to creating ECS.before anything you need cluster it can be default or you can create new one.

  1. EC2 Instance type: In cluster you need to choose the Amazon EC2 instance type for your container instances. The instance type that you select determines the resources available for your tasks to run on.

Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides secure, resizable compute capacity in the cloud.it's like your PC you can install mongo, MySQL (for MySQL RDS is best), PHP, node or whatever you want in it.While Creating EC2 you have to define which OS you want to use in ec2.You can access EC2 using pem file that will be provided by AWS during creating ec2.https://aws.amazon.com/ec2/

  1. Container: – A container is a packaged (or “Dockerized,” as the cool kids like to say) application component. Each EC2 instance in a cluster can serve as a host to one or more containers. For every task definition, you need to specify container which tells about CPU, memory and other resources.

  2. ECR Registries Amazon EC2 Container Registry (Amazon ECR) is a managed AWS Docker registry service that is secure, scalable, and reliable. Amazon ECR supports private Docker repositories with resource-based permissions using AWS IAM so that specific users or Amazon EC2 instances can access repositories and images. Developers can use the Docker CLI to push, pull, and manage images.

Once the above environment is ready you can place task or start services.

  1. Task definition: A task definition is like a blueprint for your application. In this step, you will specify a task definition so Amazon ECS knows which Docker image to use for containers, how many containers to use in the task, and the resource allocation for each container.

  2. service services manage the task that you have created.once you have created a task definition, you will configure the Amazon ECS service. A service launches and maintains copies of the task definition in your cluster. For example, by running an application as a service, Amazon ECS will auto-recover any stopped tasks and maintain the number of copies you specify.

NOTE: Elastic load Balancing can be setup before any thing done. when you want to create services you can configure with load balancer.load balancer conttain target group and container which need to be balanced.https://aws.amazon.com/elasticloadbalancing/

  1. Elastic Load Balancing Elastic Load Balancing automatically distributes incoming application traffic across multiple Amazon EC2 instances. It enables you to achieve fault tolerance in your applications, seamlessly providing the required amount of load balancing capacity needed to route application traffic
1
  • EC2 (Elastic Compute Cloud) Instance - A Virtual Machine server
  • ELB (Elastic Load Balancer) - A service in EC2 which manages incoming traffic using DNS and managed instances (not seen to the user). Redirects HTTP/TCP requests to instances registered in the ELB. Includes health-check mechanism to include/exclude EC2 instances.
  • ALB Target Group - A group of EC2 instances, usually containing duplicates of a service listening on a specific TCP port. Includes health-check mechanism.
  • ALB (Application Load Balancer) - A new generation of ELB. Allows to map multiple URL paths, and Host: headers to Target Groups of EC2 instances.
  • EBS (Elastic Block Storage) - An attachable disk for EC2 instances
  • ASG (Auto Scaling Group) - A mechanism to create/increase/decrease the number of EC2 instances in a group.
  • Launch Configuration - Template describing how to create EC2 in ASG.
  • Image (Usually Docker Image) - A special format of file you can "pull" and "push" to a Docker Registry. Contains "user-space" executables, libraries and files.
  • Container (Usually Docker Container) - An execution of an Image, running under a Docker Daemon service.
  • ECS (Elastic Container Service) - Orchestrator for Docker containers in EC2.
  • ECS Cluster - Collection of EC2 (usually in ASG) that ECS uses for running containers.
  • ECS Host - One EC2 instances out of all the instances registered in ECS Cluster.
  • ECS Task Definition - A template on how to run a specific container. Includes most of the arguments/parameters you can find with docker run command.
  • ECS Task - A running container somewhere in the ECS cluster. Usually used to run containers on a schedule, or one-offs.
  • ECS Service - A service that manages running of ECS Tasks. Can also register listening ports of containers in a specific ALB Target Group.
  • ECS Agent - Opensource service, running as a container on each ECS Host. Responsible to receive commands from ECS service regarding containers to run/stop/etc...
  • ECR (Elastic Container Registry) - A managed service in ECS used to store/push/pull Docker images. Similar to Docker Hub, Quay, and other artifact storage services used to manage images as a service.
4
  • I tried starting from basics and only refer to terminology I defined above when explaining terms below. May 16 '17 at 15:51
  • That's a good documentation summary, but that doesn't bring actionable information for a beginner. At this length a paragraph on how all this glue together (or not, ecs doesn't need ec2 instance, they're hidden from end User) would help the OP understanding the whole picture better than a dictionary of services imho
    – Tensibai
    May 18 '17 at 20:58
  • @Tensibai when using ECS, the EC2 instances are not hidden from the user. They are a regular Auto Scaling group you will see in your EC2 console. May 23 '17 at 15:50
  • I should have said "handled by AWS for the user" instead of "hidden", the point being you should not have to manage them. (unless I did miss a change in how ECS works)
    – Tensibai
    May 23 '17 at 15:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.