AWS - Day1 - Tutorial - Launching my first Docker Container



John Rankin @ August 16, 2018

I went through the Deploy Docker Containers Tutorial.  

 

Heres what I've learned.  

To deploy docker containers on the AWS ,  you need the following items:

  • Amazon ECS  (Elastic Cluster Service).
    • an Identity and Access Management (IAM) role service account role will be automatically be created for this (atleast for the sample tutorial)
      • This will allow ECS to make calls to EC2 and LoadBalancer to register so they can communicate with eachother.
  • ec2 Instance
    • Where the Docker container will be executed
  • Load balancer
    • This is optional.

 

ECS Terminology  - Terminology taken from Here

  • Task definition — This a blueprint that describes how a docker container should launch. It contains settings like exposed port, docker image, cpu shares, memory requirement, command to run and environmental variables.
  • Task — This is a running container with the settings defined in the Task Definition. It can be thought of as an “instance” of a Task Definition.
  • Service — Defines long running tasks of the same Task Definition. This can be 1 running container or multiple running containers all using the same Task Definition.
  • Cluster — A logic group of EC2 instances. When an instance launches the ecs-agent software on the server registers the instance to an ECS Cluster. This is easily configurable by setting the ECS_CLUSTER variable in /etc/ecs/ecs.config described here.
  • Container Instance—This is just an EC2 instance that is part of an ECS Cluster and has docker and the ecs-agent running on it.

 

Overview of ECS terminology


Picture taken from Here

 

Amazon ECS's responsiblity is to ensure that the Docker application is deployed and executed to all Instances in the cluster.    Since the idea behind it is running an application as a service, it Amazon ECS will try to auto-recover if by any means it so happens to crash.  

Elastic Cluster Service is AWS's version of Kubernetes. The differences between them is that ECS is tightly coupled to the AWS architechure, while Kubernetes is Vendor agnostic.  Meaning, I can run Kubernetes on various Cloud platforms such as Google, Azure,  DigitalOcean, and even on a private, personal cluster.  I can assume if someone decided to use the Kubernetes they could essentially move around to different Cloud platforms and not have their application be too much affected.  Where if you develop your application using ECS, you are kind of stuck with Amazon's platform, forever.
 
From what I've also read online, that Kubernetes is very modularized when it comes to using different services.  For example, Kuberenetes you have multiple options for choosing which Load balancer service you would like to use in your cluster, but the ECS forces you to use the AWS's Elastic Load balancer service.  
 
As I am just starting out, I do not have enough adequate knowledge to validate which is actually better, but I can make a very random assumption is that Kubernetes will take time configuring your cluster to the way you want it, while ECS will be able to handle connections to other services much easier as it already knows what to do.
 
After I go through the Docker tutorials, I think I might go ahead and see if I can create Kubernetes cluster to compare the differences in not only the setup, but the functionality.
 
 
References:
 

 

 

Most Recent Posts


Blog Test

Read This
October 16, 2018

Day 7 - DynamoDB - and Working with 2 Services - Lambda

Read This
August 25, 2018

Day 6 - Lambda - Creating an API

Read This
August 23, 2018

AWS - Day 5 - S3 - Simple Storage Service

Read This
August 22, 2018

AWS - Day 4 - AWS CLI Useful Scripts

Read This
August 21, 2018

AWS - Day 3 - Create Container from another container

Read This
August 20, 2018

Day 2 - Docker Intro

Read This
August 17, 2018

AWS - Day1 - Tutorial - Launching my first Docker Container

Read This
August 16, 2018

AWS - Day 1 - Signing up and testing out their tutorials

Read This
August 16, 2018

Dynamic Programming - Edit Distance

Read This
December 19, 2016

Dynamic Programming - Fibonacci

Read This
December 19, 2016

What I Do

Read This
June 23, 2015

First Blog Post

Read This
June 23, 2015