Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

Amazon EC2 Container Service

4.246 visualizaciones

Publicado el

AWS Technical Day - Amazon EC2 Container Service

Publicado en: Tecnología
  • Sé el primero en comentar

Amazon EC2 Container Service

  1. 1. ©2015, Amazon Web Services, Inc. or its affiliates. All rights reserved Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2 Jafar Shameem
  2. 2. Agenda • Containers • EC2 Container Service
  3. 3. Containers
  4. 4. What are containers? • OS virtualization • Process isolation • Images • AutomationServer Guest OS Bins/Libs Bins/Libs App2App1
  5. 5. Container advantages Portable Same Immutable Images. Run anywhere. Flexible Create Modular Environments. Decompose Apps Fast Speeds up build and release cycle Efficient Optimize resource utilization Server Guest OS Bins/Libs Bins/Libs App2App1
  6. 6. A container pipeline Base image Patches IT Operations Utilities
  7. 7. A container pipeline Base image Patches IT Operations Ruby Redis Logger Utilities
  8. 8. A container pipeline Base image Patches IT Operations Developer Ruby Redis Logger Utilities App
  9. 9. A container pipeline Base image Patches IT Operations Developer Ruby Redis Logger Utilities App
  10. 10. Server Guest OS Bins/Libs Bins/Libs App2App1 $ docker run myimage
  11. 11. EC2 Container Service
  12. 12. Easily Manage Clusters for Any Scale • Nothing to run • Complete state • Control and monitoring • Scale ECS List* and Describe* API actions
  13. 13. Flexible Container Placement • Applications • Batch jobs • Multiple schedulers
  14. 14. Designed for use with other AWS services • Virtual Private Cloud • Elastic Load Balancing • Elastic Block Store • IAM • CloudTrail
  15. 15. Extensible • Comprehensive APIs • Open source agent • Custom schedulers
  16. 16. Common Patterns
  17. 17. Pattern 1: Services and applications • Simple to model • Micro services • Blue / green deployments Phong Nguyen, Founder at Gilt Groupe, said, "As we Dockerize all our services, it is very important for us to have a platform that can help us speed up deployments, automate our services, and gain greater efficiencies. The new service scheduler and ELB integration make Amazon ECS an excellent platform for our services.”
  18. 18. Pattern 2: Batch jobs • Share resource pools • Ideal for bursty jobs • Spot instances “We required a solution on which we could securely and efficiently deploy Docker containers to encapsulate learner programming assignment submissions,” said Brennan Saeta, Architect at Coursera. “We are using Amazon EC2 Container Service to power our new programming assignments infrastructure for next-generation On-Demand course platform.”
  19. 19. EC2 Container Service Terminology
  20. 20. • Regional • Resource pool • Grouping of Container Instances • Start empty, dynamically scalable Key Components: Clusters
  21. 21. • Amazon EC2 instances • Docker daemon • Amazon ECS agent Key Components: Container Instances
  22. 22. Key Components: Task Definitions Volume definitions Container definitions
  23. 23. Key Components: Task Definitions { "environment": [], "name": "simple-demo", "image": "my-demo", "cpu": 10, "memory": 500, "portMappings": [ { "containerPort": 80, "hostPort": 80 } ], "mountPoints": [ { "sourceVolume": "my-vol", "containerPath": "/var/www/my- vol" } ], "entryPoint": [ "/usr/sbin/apache2", "-D", "FOREGROUND" ], "essential": true }, { "name": "busybox", "image": "busybox", "cpu": 10, "memory": 500, "volumesFrom": [ { "sourceContainer": "simple-demo" } ], "entryPoint": [ "sh", "-c" ], "command": [ "/bin/sh -c "while true; do /bin/date > /var/www/my-vol/date; sleep 1; done"" ], "essential": false }
  24. 24. { "environment": [], "name": "simple-demo", "image": “amazon/amazon-ecs-sample", "cpu": 10, "memory": 500, "portMappings": [ { "containerPort": 80, "hostPort": 80 } ], "mountPoints": [ { "sourceVolume": "my-vol", "containerPath": "/var/www/my- vol" } ], "entryPoint": [ "/usr/sbin/apache2", "-D", "FOREGROUND" ], "essential": true }, Key Components: Task Definitions [ { "image": "mysql", "name": "db", "cpu": 10, "memory": 500, "essential": true, "entryPoint": [ "/entrypoint.sh" ], "environment": [ { "name": "MYSQL_ROOT_PASSWORD", "value": "pass" } ], "portMappings": [] } ] Essential to our Task Create and mount volumes Expose port 80 in container to port 80 on host 10 CPU Units (1024 is full CPU), 500 Megabytes of Memory
  25. 25. { "name": "busybox", "image": "busybox", "cpu": 10, "memory": 500, "volumesFrom": [ { "sourceContainer": "simple-demo" } ], "entryPoint": [ "sh", "-c" ], "command": [ "/bin/sh -c "while true; do /bin/date > /var/www/my-vol/date; sleep 1; done"" ], "essential": false } Key Components: Task Definitions [ { "image": "tutum/wordpress-stackable", "name": "wordpress", "cpu": 10, "memory": 500, "essential": true, "links": [ "db" ], "entryPoint": [ "/bin/sh", "-c" ], "environment": [ … ], "portMappings": [ { "containerPort": 80, "hostPort": 80 } ] }, ] From Docker Hub Mount volume from other container Command to exec
  26. 26. • Unit of work • Grouping of related Containers • Run on Container Instances Key Components: Tasks
  27. 27. Key Components: Tasks Container Instance Schedule Shared data volume PHP App Time of day App
  28. 28. Key Components: Run a task Good for short-lived containers, e.g. batch jobs
  29. 29. Key Components: Create a Service Good for long- running applications and services
  30. 30. Key Components: Create Service • Load Balance traffic across containers • Automatically recover unhealthy containers • Discover services Elastic Load Balancing
  31. 31. Key Components: Update Service • Scale up • Scale down Elastic Load Balancing
  32. 32. Key Components: Update Service • Deploy new version • Drain connections Elastic Load Balancing
  33. 33. Key Components: Update Service • Deploy new version • Drain connections Elastic Load Balancing
  34. 34. Key Components: Update Service • Deploy new version • Drain connections Elastic Load Balancing
  35. 35. More resources • Service Discovery via Consul with ECS: – https://aws.amazon.com/blogs/compute/service-discovery-via- consul-with-amazon-ecs/ • Running an Amazon ECS Task on every instance: – https://aws.amazon.com/blogs/compute/running-an-amazon-ecs- task-on-every-instance/ • Set up a build pipeline with Jenkins and ECS: – https://blogs.aws.amazon.com/application- management/post/Tx32RHFZHXY6ME1/Set-up-a-build-pipeline- with-Jenkins-and-Amazon-ECS
  36. 36. ©2015, Amazon Web Services, Inc. or its affiliates. All rights reserved Thank You

×