Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Amazon ECS

ProdOps
June 09, 2015

Amazon ECS

Amazon EC2 Container Service (ECS) is a highly scalable, high performance container management service that supports Docker containers and allows you to easily run applications on a managed cluster of Amazon EC2 instances. Amazon ECS eliminates the need for you to install, operate, and scale your own cluster management infrastructure.

Presented at http://www.meetup.com/AWS-IL/events/222762990/

ProdOps

June 09, 2015
Tweet

More Decks by ProdOps

Other Decks in Technology

Transcript

  1. .co.il www. docker host docker registry docker image static website

    user data web frontend docker solves “problems” 3. execution 2. distribution 1. packaging
  2. .co.il www. static website user data web frontend queue analytics

    development environments customer data center production cluster public cloud
  3. .co.il www. discovery monitoring infrastructure provisioning migration to docker orchestration

    - legacy apps - micro services? - where is X? - who is my Y? - what is my Z? - health - performance - where? - when?
  4. .co.il www. infrastructure shipper coreos / fleet geard mesos or

    or or consul helios etcd centurion EC2 Rack space GCE Orchard Tutum Heroku
  5. .co.il www. AWS EC2 Container Service - ECS ECS coreos

    / fleet geard mesos or or or consul helios etcd centurion EC2 Rack space GCE Orchard Tutum Heroku
  6. .co.il www. ECS Terminology EC2 EC2 EC2 EC2 EC2 EC2

    EC2 EC2 EC2 Cluster container instance task definition task Scheduler container definition container definition container definition
  7. .co.il www. container instance task container instance task container instance

    task container instance task container instance task service ECS Terminology cluster
  8. .co.il www. container instance task container instance container instance container

    instance container instance ECS Container Instance task task task ECS Container Agent github.com/aws/amazon-ecs-agent • IAM Role • Security Groups • VPC NAT • AutoScaling Group
  9. .co.il www. container instance ECS Container Instance AMI ECS Container

    Agent • CoreOS • Linux with Docker • Amazon ECS-optimized AMI Region AMI Name AMI ID us-east-1 amzn-ami-2015.03.b-amazon-ecs-optimized ami-d0b9acb8 us-west-2 amzn-ami-2015.03.b-amazon-ecs-optimized ami-6b88b95b eu-west-1 amzn-ami-2015.03.b-amazon-ecs-optimized ami-ed7c149a ap-northeast-1 amzn-ami-2015.03.b-amazon-ecs-optimized ami-c6c609c6 ap-southeast-2 amzn-ami-2015.03.b-amazon-ecs-optimized ami-39017e03
  10. .co.il www. container instance ECS Cluster Configuration ECS Container Agent

    user data #/bin/sh echo ECS_CLUSTER=cluster_name >> \ /etc/ecs/ecs.config #/bin/sh aws s3 cp s3://bucket_name/ecs.config \ /etc/ecs/ecs.config
  11. .co.il www. ECS Agent Container docker run \ --name ecs-agent

    \ -d \ -v /var/run/docker.sock:/var/run/docker.sock \ -v /var/log/ecs/:/log \ -p 127.0.0.1:51678:51678 \ -v /var/lib/ecs/data:/data \ -e ECS_LOGFILE=/log/ecs-agent.log \ -e ECS_LOGLEVEL=info \ -e ECS_DATADIR=/data \ -e ECS_CLUSTER=cluster_name \ amazon/amazon-ecs-agent:latest 1 2 3 4 5 6 7 8 9 10 11 12
  12. .co.il www. docker run --name naX imgY -c 2048 -m

    512 { "family: "taskName", "containerDefinitions": [ { "name": "...naX...", "image": "...imgY...", "cpu": 2048, "memory": 512, ECS Task Definitions
  13. .co.il www. ECS Container Definitions { "links": [ "name:internalName" ],

    "portMappings": [ { "hostPort": 80, "containerPort": 80 } ],
  14. .co.il www. ECS Container Definitions { "environment": [ { "name":

    "SECRET_SAUCE", "value": "magic" } ], "command": [ "/bin/hocpocus" ],
  15. .co.il www. { "serviceName": "", "taskDefinition": "", "loadBalancers": [ {

    "loadBalancerName": "", "containerName": "", "containerPort": 0 } ], "desiredCount": 0, "clientToken": "", } ECS Service Scheduler
  16. .co.il www. $ crontab -l 0 * * * *

    aws ecs --run-task --task-definition "work:1" ECS RunTask
  17. .co.il www. • register-task-definition • list-task-definitions • describe-task-definition • register-task-definition

    • deregister-task-definition • run-task • start-task (service) • list-tasks • describe-tasks • stop-task CLI $ aws ecs • create-cluster • list-clusters • describe-clusters • delete-cluster • register-container-instance • list-container-instances • describe-container-instances • deregister-container-instance • create-service • list-services • describe-services • update-service • delete-service docs.aws.amazon.com/cli/latest/reference/ecs/
  18. .co.il www. We invite you to join Operations Israel Facebook

    group on on.fb.me/Ops-IL link to slides dvps.me/aws-ecs Thank you! www.devops.co.il