aws elastic container service - dockerhn

35
Amazon EC2 Container Service Tuna [email protected] @ngtuna11 http://www.meetup.com/Docker-Hanoi

Upload: nguyen-anh-tu

Post on 14-Apr-2017

99 views

Category:

Internet


1 download

TRANSCRIPT

Page 1: AWS Elastic Container Service - DockerHN

Amazon EC2 Container ServiceTuna

[email protected]@ngtuna11

http://www.meetup.com/Docker-Hanoi

Page 2: AWS Elastic Container Service - DockerHN

Docker ecosystemScheduling & Orchestration

Page 3: AWS Elastic Container Service - DockerHN

• Runandmanageclusterofdockercontainers

• Build-inservicescheduler,taskschedulerandstatemanager

• Orchestrationsystem• IntegratewithmultipleAWSservices.

Amazon EC2 Container Service

Page 4: AWS Elastic Container Service - DockerHN

ElasticLoadBalancingAmazonElasticBlockStoreAmazonVirtualPrivateCloudAWSIdentityandAccessManagementAWSCloudTrailAWSCloudFormationAWSCloudWatch

Designed for use with other AWS services

Page 5: AWS Elastic Container Service - DockerHN
Page 6: AWS Elastic Container Service - DockerHN
Page 7: AWS Elastic Container Service - DockerHN
Page 8: AWS Elastic Container Service - DockerHN
Page 9: AWS Elastic Container Service - DockerHN
Page 10: AWS Elastic Container Service - DockerHN
Page 11: AWS Elastic Container Service - DockerHN
Page 12: AWS Elastic Container Service - DockerHN

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

}

Page 13: AWS Elastic Container Service - DockerHN

{"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

},

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 containerto port 80 on host

10 CPU Units (1024 is full CPU),500 Megabytes of Memory

Page 14: AWS Elastic Container Service - DockerHN

{"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

}

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

Page 15: AWS Elastic Container Service - DockerHN

Tasks

Good for short-lived containers, e.g.

batch jobs

Page 16: AWS Elastic Container Service - DockerHN

Services

Good for long-running applications

and services

Page 17: AWS Elastic Container Service - DockerHN

Service Scheduler

• Manage long-running applications and services• Build-in• What it does

• Load balacing• Health management• Scale-up and scale-down• Update management

• Drain ELB

Page 18: AWS Elastic Container Service - DockerHN
Page 19: AWS Elastic Container Service - DockerHN

DIY

Page 20: AWS Elastic Container Service - DockerHN
Page 21: AWS Elastic Container Service - DockerHN

Architectural Design

Page 22: AWS Elastic Container Service - DockerHN

You want more ???

Page 23: AWS Elastic Container Service - DockerHN

Container-level autoscaling

Amazon Lambda & Amazon ECS: Excellent !!!https://aws.amazon.com/blogs/compute/scaling-amazon-ecs-services-automatically-using-amazon-cloudwatch-and-aws-lambda/

Page 24: AWS Elastic Container Service - DockerHN

Service discovery

Load Balancers

DNS

Service discovery services

Page 25: AWS Elastic Container Service - DockerHN

Service discovery

Load Balancers

ECS Service scheduler

Page 26: AWS Elastic Container Service - DockerHN

Service discovery

DNS

http://weave.works/guides/service-discovery-with-weave-aws-ecs.html

Page 27: AWS Elastic Container Service - DockerHN

Service discovery

Service discovery services

https://aws.amazon.com/blogs/compute/service-discovery-via-consul-with-amazon-ecs

Page 28: AWS Elastic Container Service - DockerHN

Monitoring & logging

Docker logs

Container logs

Page 29: AWS Elastic Container Service - DockerHN
Page 30: AWS Elastic Container Service - DockerHN
Page 31: AWS Elastic Container Service - DockerHN
Page 32: AWS Elastic Container Service - DockerHN
Page 33: AWS Elastic Container Service - DockerHN
Page 34: AWS Elastic Container Service - DockerHN

Extensible

Comprehensive APIs

Open source agent

Custom schedulers

Page 35: AWS Elastic Container Service - DockerHN

Questions