SlideShare a Scribd company logo
1 of 17
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Interstella GTC
Workshop: Using Docker and Amazon ECS
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
A quick recap…
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DOCKER IMAGE
Read-only template
Used to launch container
Start with base image, additional
data/dependencies are layers added on
top
Union file system merges layers into single
image
Instructions stored in Dockerfile
bootfs
kernel
Base Image
Image
Image
W
ritable
Container
N
ode.js
N
ginx
U
buntu
References
parent
image
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DOCKERFILE
FROM dockerfile/ubuntu
RUN 
add-apt-repository -y ppa:nginx/stable && 
apt-get update && 
apt-get install -y nginx && 
rm -rf /var/lib/apt/lists/* && 
echo "ndaemon off;" >> /etc/nginx/nginx.conf && 
chown -R www-data:www-data /var/lib/nginx
VOLUME ["/etc/nginx/sites-enabled", "/etc/nginx/certs",
"/etc/nginx/conf.d", "/var/log/nginx", "/var/www/html"]
WORKDIR /etc/nginx
CMD ["nginx"]
EXPOSE 80
EXPOSE 443
Source: https://github.com/dockerfile/nginx
Pull base image
Install Nginx
Define mountable directories
Define working directory
Define default command
Expose ports
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DOCKER IMAGE REGISTRY
Images stored in a registry
Amazon EC2 Container Registry (Amazon ECR)
• Fully managed
• Secure—encryption at rest, IAM integration
• Scalable and highly available
• Integrated with Amazon ECS and Docker CLI
Docker Hub
• Public repository of images
• Provides private image storage
Amazon ECR
Docker Hub
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DOCKER ARCHITECTURE
Docker daemon manages images, containers,
networks, and volumes
Docker client (for example, CLI) communicates with
daemon through a REST API
Sample commands:
• docker build – build image from Dockerfile
• docker images – list images on Docker host
• docker run – run an image
• docker ps – list running containers
• docker stop – stop a running container
docker daemon
Docker Host
Container 1
Container 2
Container n
Ubuntu Image
Nginx Image
Custom Image
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
WELCOME TO INTERSTELLA GTC
Interstella GTC is an intergalactic trading company that
was established to import and export rare resources in
the universe.
Interstella was a thriving company but business has been
declining despite a booming economy.
You and a few other consultants have been brought on
board to turn this around. Will you be able to restore
Interstella to its former glory?
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
YOUR MISSION
Interstella 8888 operates a logistics platform to control the processing centers of the four rare resources—tiberium,
vespene gas, spice melange, and dilithium crystals. We need help deploying the platform to the AWS cloud and would
like to adopt containers as a part of the move.
Workshop #1 – Running Containers with Amazon ECS
Lab 1: Containerize the Interstella logistics software
Lab 2: Deploy containers using Amazon ECR and Amazon ECS
Bonus Lab #1: Scale the logistics platform with an ALB
Workshop #2 – Monolith to Microservices
Now that you’ve bought us some more time, it’s time to build and deploy microservices:
Lab 1: Deploy a monolith using Amazon ECS (you can skip if you completed workshop #1)
Lab 2: Incrementally build and deploy each microservice
Bonus Lab #2: Scale microservices with an ALB
Workshop #3 – CICD for Containers on AWS
Workshop #4 – Advanced Microservice Operations
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
WORKSHOP ENVIRONMENT
Public subnet – AZ #1 Public subnet – AZ #2
Amazon SNS
EC2 Instance
ECS Cluster
EC2 Instance
Amazon
ECR
Amazon API
Gateway
ORDER
Amazon S3
bucket
Amazon
DynamoDB
Amazon
ECS
Orders come into
the logistics
platform as HTTP
POST messages via
Amazon Simple
Notification Service
(Amazon SNS)
Amazon S3 hosts
web content and
utilities—API key
generator, order
subscription, order
dashboard
The logistics platform
communicates with an
order fulfillment API
running on Amazon
API Gateway. Order
data is stored in
Amazon DynamoDB.
Amazon
CloudWatch
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
LAB 1 – Containerize the application
Public subnet – AZ #1 Public subnet – AZ #2
Amazon SNS
EC2 Instance
ECS Cluster
EC2 Instance
Amazon API
Gateway
ORDER
Amazon S3
bucket
Amazon
DynamoDB
1. Construct a
Dockerfile to build a
Docker image for the
logistics platform
2. Run the container
using the Docker
client to confirm it’s
working as expected
3. Push the Docker
image up to Amazon
ECR
FULFILL
Amazon
CloudWatch
Amazon
ECR
Amazon
ECS
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
LAB 2 – Deploy the Application
Public subnet – AZ #1 Public subnet – AZ #2
Amazon SNS
EC2 Instance
ECS Cluster
EC2 Instance
Amazon
ECR
Amazon API
Gateway
ORDER
Amazon S3
bucket
Amazon
DynamoDB
Amazon
ECS
1. Construct an ECS task
definition referencing
the Docker image
pushed up to ECR
from lab 1 and
configuring logging
to Amazon
CloudWatch Logs
2. Run the task and
confirm orders are
being processed
FULFILL
Amazon
CloudWatch
LOGS
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
BONUS LAB #1 – Setup the ALB
Public subnet – AZ #1 Public subnet – AZ #2
Amazon SNS
EC2 Instance
ECS Cluster
EC2 Instance
Amazon
ECR
Amazon API
Gateway
ORDER
Amazon S3
bucket
Amazon
DynamoDB
Amazon
ECS
1. Create an Application
Load Balancer (ALB)
2. Create an ECS service
that ties in the ALB
for routing orders to
tasks and maintains a
desired task count
FULFILL
Amazon
CloudWatch
LOGS
Application
Load Balancer
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
LAB 4 – Deploy Microservices
Public subnet – AZ #1 Public subnet – AZ #2
Amazon SNS
EC2 Instance
ECS Cluster
EC2 Instance
Amazon
ECR
Amazon API
Gateway
ORDER
Amazon S3
bucket
Amazon
DynamoDB
Amazon
ECS
1. Build a Docker image for
a resource microservice
and store in ECR
2. Create an an ECS task
definition to deploy the
microservice image
3. Deploy the microservice
image using ECS to start
processing orders for that
resource
4. Modify the monolith code
to remove functionality
of the microservice;
rebuild
the monolith image and
re-deploy
M
FULFILL
Amazon
CloudWatch
m
FULFILL
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
BONUS LAB #2 – Setup the ALB
Public subnet – AZ #1 Public subnet – AZ #2
Amazon SNS
EC2 Instance
ECS Cluster
EC2 Instance
Amazon
ECR
Amazon API
Gateway
ORDER
Amazon S3
bucket
Amazon
DynamoDB
Amazon
ECS
1. Create an Application
Load Balancer (ALB)
2. Create an ECS service
that ties in the ALB
for routing orders to
monolith and resource
microservices; ALB
will use path-based
routing to route to
each microservice
target group
3. Repeat until all
microservices are
deployed
M
FULFILL
Amazon
CloudWatch Application
Load Balancer
m
FULFILL
/vespene
/melange
m
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
LOGISTICS
Instructions:
http://interstella.trade/
Orders topic:
arn:aws:sns:us-west-2:270206935686:monolith
Raise your hand if you have any questions. High-five your neighbors and
have fun!
Please fill out feedback forms once you are done! Feel free to email us
with comments/questions/feedback: aws-interstella-team@amazon.com
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
In Summary
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thank you!

More Related Content

What's hot

전 세계 팬들이 모일 수 있는 플랫폼 만들기 - 강진우 (beNX) :: AWS Community Day 2020
전 세계 팬들이 모일 수 있는 플랫폼 만들기 - 강진우 (beNX) :: AWS Community Day 2020 전 세계 팬들이 모일 수 있는 플랫폼 만들기 - 강진우 (beNX) :: AWS Community Day 2020
전 세계 팬들이 모일 수 있는 플랫폼 만들기 - 강진우 (beNX) :: AWS Community Day 2020 AWSKRUG - AWS한국사용자모임
 
DevOps 2015 - Dancing with Chef
DevOps 2015 - Dancing with ChefDevOps 2015 - Dancing with Chef
DevOps 2015 - Dancing with Chefsmalltown
 
[AWS Dev Day] 앱 현대화 | AWS Fargate를 사용한 서버리스 컨테이너 활용 하기 - 삼성전자 개발자 포털 사례 - 정영준...
[AWS Dev Day] 앱 현대화 | AWS Fargate를 사용한 서버리스 컨테이너 활용 하기 - 삼성전자 개발자 포털 사례 - 정영준...[AWS Dev Day] 앱 현대화 | AWS Fargate를 사용한 서버리스 컨테이너 활용 하기 - 삼성전자 개발자 포털 사례 - 정영준...
[AWS Dev Day] 앱 현대화 | AWS Fargate를 사용한 서버리스 컨테이너 활용 하기 - 삼성전자 개발자 포털 사례 - 정영준...Amazon Web Services Korea
 
Deploying and Managing Red Hat Enterprise Linux in Amazon Web Services
Deploying and Managing Red Hat Enterprise Linux in Amazon Web ServicesDeploying and Managing Red Hat Enterprise Linux in Amazon Web Services
Deploying and Managing Red Hat Enterprise Linux in Amazon Web ServicesDLT Solutions
 
Deploying a Kubernetes App with Amazon EKS
Deploying a Kubernetes App with Amazon EKSDeploying a Kubernetes App with Amazon EKS
Deploying a Kubernetes App with Amazon EKSLaura Frank Tacho
 
Heat and its resources
Heat and its resourcesHeat and its resources
Heat and its resourcesSangeeth Kumar
 
Amazon Elastic Beanstalk
Amazon Elastic BeanstalkAmazon Elastic Beanstalk
Amazon Elastic BeanstalkEberhard Wolff
 
Installing WordPress on AWS
Installing WordPress on AWSInstalling WordPress on AWS
Installing WordPress on AWSManish Jain
 
Developingapiplug insforcs-151112204727-lva1-app6891
Developingapiplug insforcs-151112204727-lva1-app6891Developingapiplug insforcs-151112204727-lva1-app6891
Developingapiplug insforcs-151112204727-lva1-app6891NetApp
 
"Automating AWS Infrastructure with PowerShell", Martin Beeby, AWS Dev Day Ky...
"Automating AWS Infrastructure with PowerShell", Martin Beeby, AWS Dev Day Ky..."Automating AWS Infrastructure with PowerShell", Martin Beeby, AWS Dev Day Ky...
"Automating AWS Infrastructure with PowerShell", Martin Beeby, AWS Dev Day Ky...Provectus
 
Aws meetup ssm
Aws meetup ssmAws meetup ssm
Aws meetup ssmAdam Book
 
Code Deploy
Code Deploy Code Deploy
Code Deploy HajOnSoft
 
KubeCon 2018 - Running VM Workloads Side by Side with Container Workloads
KubeCon 2018 -  Running VM Workloads Side by Side with Container Workloads KubeCon 2018 -  Running VM Workloads Side by Side with Container Workloads
KubeCon 2018 - Running VM Workloads Side by Side with Container Workloads loodse
 
Heat up your stack
Heat up your stackHeat up your stack
Heat up your stackRico Lin
 
Running your Java EE 6 applications in the Cloud (FISL 12)
Running your Java EE 6 applications in the Cloud (FISL 12)Running your Java EE 6 applications in the Cloud (FISL 12)
Running your Java EE 6 applications in the Cloud (FISL 12)Arun Gupta
 
Eric Williams (Rackspace) - Using Heat on OpenStack
Eric Williams (Rackspace) - Using Heat on OpenStackEric Williams (Rackspace) - Using Heat on OpenStack
Eric Williams (Rackspace) - Using Heat on OpenStackOutlyer
 
Deploying Rails App On Ec2
Deploying Rails App On Ec2Deploying Rails App On Ec2
Deploying Rails App On Ec2Akhil Bansal
 
Amazon Web Services EC2 Basics
Amazon Web Services EC2 BasicsAmazon Web Services EC2 Basics
Amazon Web Services EC2 BasicsOnur ŞALK
 

What's hot (19)

전 세계 팬들이 모일 수 있는 플랫폼 만들기 - 강진우 (beNX) :: AWS Community Day 2020
전 세계 팬들이 모일 수 있는 플랫폼 만들기 - 강진우 (beNX) :: AWS Community Day 2020 전 세계 팬들이 모일 수 있는 플랫폼 만들기 - 강진우 (beNX) :: AWS Community Day 2020
전 세계 팬들이 모일 수 있는 플랫폼 만들기 - 강진우 (beNX) :: AWS Community Day 2020
 
DevOps 2015 - Dancing with Chef
DevOps 2015 - Dancing with ChefDevOps 2015 - Dancing with Chef
DevOps 2015 - Dancing with Chef
 
[AWS Dev Day] 앱 현대화 | AWS Fargate를 사용한 서버리스 컨테이너 활용 하기 - 삼성전자 개발자 포털 사례 - 정영준...
[AWS Dev Day] 앱 현대화 | AWS Fargate를 사용한 서버리스 컨테이너 활용 하기 - 삼성전자 개발자 포털 사례 - 정영준...[AWS Dev Day] 앱 현대화 | AWS Fargate를 사용한 서버리스 컨테이너 활용 하기 - 삼성전자 개발자 포털 사례 - 정영준...
[AWS Dev Day] 앱 현대화 | AWS Fargate를 사용한 서버리스 컨테이너 활용 하기 - 삼성전자 개발자 포털 사례 - 정영준...
 
Programming Amazon Web Services
Programming Amazon Web ServicesProgramming Amazon Web Services
Programming Amazon Web Services
 
Deploying and Managing Red Hat Enterprise Linux in Amazon Web Services
Deploying and Managing Red Hat Enterprise Linux in Amazon Web ServicesDeploying and Managing Red Hat Enterprise Linux in Amazon Web Services
Deploying and Managing Red Hat Enterprise Linux in Amazon Web Services
 
Deploying a Kubernetes App with Amazon EKS
Deploying a Kubernetes App with Amazon EKSDeploying a Kubernetes App with Amazon EKS
Deploying a Kubernetes App with Amazon EKS
 
Heat and its resources
Heat and its resourcesHeat and its resources
Heat and its resources
 
Amazon Elastic Beanstalk
Amazon Elastic BeanstalkAmazon Elastic Beanstalk
Amazon Elastic Beanstalk
 
Installing WordPress on AWS
Installing WordPress on AWSInstalling WordPress on AWS
Installing WordPress on AWS
 
Developingapiplug insforcs-151112204727-lva1-app6891
Developingapiplug insforcs-151112204727-lva1-app6891Developingapiplug insforcs-151112204727-lva1-app6891
Developingapiplug insforcs-151112204727-lva1-app6891
 
"Automating AWS Infrastructure with PowerShell", Martin Beeby, AWS Dev Day Ky...
"Automating AWS Infrastructure with PowerShell", Martin Beeby, AWS Dev Day Ky..."Automating AWS Infrastructure with PowerShell", Martin Beeby, AWS Dev Day Ky...
"Automating AWS Infrastructure with PowerShell", Martin Beeby, AWS Dev Day Ky...
 
Aws meetup ssm
Aws meetup ssmAws meetup ssm
Aws meetup ssm
 
Code Deploy
Code Deploy Code Deploy
Code Deploy
 
KubeCon 2018 - Running VM Workloads Side by Side with Container Workloads
KubeCon 2018 -  Running VM Workloads Side by Side with Container Workloads KubeCon 2018 -  Running VM Workloads Side by Side with Container Workloads
KubeCon 2018 - Running VM Workloads Side by Side with Container Workloads
 
Heat up your stack
Heat up your stackHeat up your stack
Heat up your stack
 
Running your Java EE 6 applications in the Cloud (FISL 12)
Running your Java EE 6 applications in the Cloud (FISL 12)Running your Java EE 6 applications in the Cloud (FISL 12)
Running your Java EE 6 applications in the Cloud (FISL 12)
 
Eric Williams (Rackspace) - Using Heat on OpenStack
Eric Williams (Rackspace) - Using Heat on OpenStackEric Williams (Rackspace) - Using Heat on OpenStack
Eric Williams (Rackspace) - Using Heat on OpenStack
 
Deploying Rails App On Ec2
Deploying Rails App On Ec2Deploying Rails App On Ec2
Deploying Rails App On Ec2
 
Amazon Web Services EC2 Basics
Amazon Web Services EC2 BasicsAmazon Web Services EC2 Basics
Amazon Web Services EC2 Basics
 

Similar to Interstella GTC Workshop

Interstella GTC: Monolith to Microservices with ECS
Interstella GTC: Monolith to Microservices with ECSInterstella GTC: Monolith to Microservices with ECS
Interstella GTC: Monolith to Microservices with ECSAmazon Web Services
 
CON209_Interstella 8888 Learn How to Use Docker on AWS
CON209_Interstella 8888 Learn How to Use Docker on AWSCON209_Interstella 8888 Learn How to Use Docker on AWS
CON209_Interstella 8888 Learn How to Use Docker on AWSAmazon Web Services
 
CON209_Interstella 8888 Learn How to Use Docker on AWS
CON209_Interstella 8888 Learn How to Use Docker on AWSCON209_Interstella 8888 Learn How to Use Docker on AWS
CON209_Interstella 8888 Learn How to Use Docker on AWSAmazon Web Services
 
Mythical Mysfits: Monolith to Microservices with Docker and Fargate - MAD305 ...
Mythical Mysfits: Monolith to Microservices with Docker and Fargate - MAD305 ...Mythical Mysfits: Monolith to Microservices with Docker and Fargate - MAD305 ...
Mythical Mysfits: Monolith to Microservices with Docker and Fargate - MAD305 ...Amazon Web Services
 
Mythical Mysfits: Monolith to Microservice with Docker and AWS Fargate (CON21...
Mythical Mysfits: Monolith to Microservice with Docker and AWS Fargate (CON21...Mythical Mysfits: Monolith to Microservice with Docker and AWS Fargate (CON21...
Mythical Mysfits: Monolith to Microservice with Docker and AWS Fargate (CON21...Amazon Web Services
 
CON319_Interstella GTC CICD for Containers on AWS
CON319_Interstella GTC CICD for Containers on AWSCON319_Interstella GTC CICD for Containers on AWS
CON319_Interstella GTC CICD for Containers on AWSAmazon Web Services
 
Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017
Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017
Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017Amazon Web Services
 
Semplificare la gestione dei container con i servizi AWS
Semplificare la gestione dei container con i servizi AWSSemplificare la gestione dei container con i servizi AWS
Semplificare la gestione dei container con i servizi AWSAmazon Web Services
 
From Docker Straight to AWS
From Docker Straight to AWSFrom Docker Straight to AWS
From Docker Straight to AWSDevOps.com
 
SRV314 Containerized App Development with AWS Fargate
SRV314 Containerized App Development with AWS FargateSRV314 Containerized App Development with AWS Fargate
SRV314 Containerized App Development with AWS FargateAmazon Web Services
 
Running Containers in a Hybrid Environment
Running Containers in a Hybrid EnvironmentRunning Containers in a Hybrid Environment
Running Containers in a Hybrid EnvironmentAmazon Web Services
 
Deep dive ECS & Fargate Deep Dive
Deep dive ECS & Fargate Deep DiveDeep dive ECS & Fargate Deep Dive
Deep dive ECS & Fargate Deep DiveAmazon Web Services
 
Comparing Compute Options for Microservices - AWS Summti Sydney 2018
Comparing Compute Options for Microservices - AWS Summti Sydney 2018Comparing Compute Options for Microservices - AWS Summti Sydney 2018
Comparing Compute Options for Microservices - AWS Summti Sydney 2018Amazon Web Services
 
Breaking the Monolith Using AWS Container Services
Breaking the Monolith Using AWS Container ServicesBreaking the Monolith Using AWS Container Services
Breaking the Monolith Using AWS Container ServicesAmazon Web Services
 
AWS 微服務中的 Container 選項比較 (Level 400)
AWS 微服務中的 Container 選項比較   (Level 400)AWS 微服務中的 Container 選項比較   (Level 400)
AWS 微服務中的 Container 選項比較 (Level 400)Amazon Web Services
 
Containerizing Legacy .NET Workloads (CON348-R1) - AWS re:Invent 2018
Containerizing Legacy .NET Workloads (CON348-R1) - AWS re:Invent 2018Containerizing Legacy .NET Workloads (CON348-R1) - AWS re:Invent 2018
Containerizing Legacy .NET Workloads (CON348-R1) - AWS re:Invent 2018Amazon Web Services
 

Similar to Interstella GTC Workshop (20)

Interstella GTC: Monolith to Microservices with ECS
Interstella GTC: Monolith to Microservices with ECSInterstella GTC: Monolith to Microservices with ECS
Interstella GTC: Monolith to Microservices with ECS
 
CON209_Interstella 8888 Learn How to Use Docker on AWS
CON209_Interstella 8888 Learn How to Use Docker on AWSCON209_Interstella 8888 Learn How to Use Docker on AWS
CON209_Interstella 8888 Learn How to Use Docker on AWS
 
CON209_Interstella 8888 Learn How to Use Docker on AWS
CON209_Interstella 8888 Learn How to Use Docker on AWSCON209_Interstella 8888 Learn How to Use Docker on AWS
CON209_Interstella 8888 Learn How to Use Docker on AWS
 
Mythical Mysfits: Monolith to Microservices with Docker and Fargate - MAD305 ...
Mythical Mysfits: Monolith to Microservices with Docker and Fargate - MAD305 ...Mythical Mysfits: Monolith to Microservices with Docker and Fargate - MAD305 ...
Mythical Mysfits: Monolith to Microservices with Docker and Fargate - MAD305 ...
 
Mythical Mysfits: Monolith to Microservice with Docker and AWS Fargate (CON21...
Mythical Mysfits: Monolith to Microservice with Docker and AWS Fargate (CON21...Mythical Mysfits: Monolith to Microservice with Docker and AWS Fargate (CON21...
Mythical Mysfits: Monolith to Microservice with Docker and AWS Fargate (CON21...
 
CON319_Interstella GTC CICD for Containers on AWS
CON319_Interstella GTC CICD for Containers on AWSCON319_Interstella GTC CICD for Containers on AWS
CON319_Interstella GTC CICD for Containers on AWS
 
Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017
Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017
Interstella 8888: CICD for Containers on AWS - CON319 - re:Invent 2017
 
Semplificare la gestione dei container con i servizi AWS
Semplificare la gestione dei container con i servizi AWSSemplificare la gestione dei container con i servizi AWS
Semplificare la gestione dei container con i servizi AWS
 
From Docker Straight to AWS
From Docker Straight to AWSFrom Docker Straight to AWS
From Docker Straight to AWS
 
Shipping logs to splunk from a container in aws howto
Shipping logs to splunk from a container in aws howtoShipping logs to splunk from a container in aws howto
Shipping logs to splunk from a container in aws howto
 
SRV314 Containerized App Development with AWS Fargate
SRV314 Containerized App Development with AWS FargateSRV314 Containerized App Development with AWS Fargate
SRV314 Containerized App Development with AWS Fargate
 
應用開發新思維
應用開發新思維應用開發新思維
應用開發新思維
 
Introducing AWS Fargate
Introducing AWS FargateIntroducing AWS Fargate
Introducing AWS Fargate
 
Introducing AWS Fargate
Introducing AWS FargateIntroducing AWS Fargate
Introducing AWS Fargate
 
Running Containers in a Hybrid Environment
Running Containers in a Hybrid EnvironmentRunning Containers in a Hybrid Environment
Running Containers in a Hybrid Environment
 
Deep dive ECS & Fargate Deep Dive
Deep dive ECS & Fargate Deep DiveDeep dive ECS & Fargate Deep Dive
Deep dive ECS & Fargate Deep Dive
 
Comparing Compute Options for Microservices - AWS Summti Sydney 2018
Comparing Compute Options for Microservices - AWS Summti Sydney 2018Comparing Compute Options for Microservices - AWS Summti Sydney 2018
Comparing Compute Options for Microservices - AWS Summti Sydney 2018
 
Breaking the Monolith Using AWS Container Services
Breaking the Monolith Using AWS Container ServicesBreaking the Monolith Using AWS Container Services
Breaking the Monolith Using AWS Container Services
 
AWS 微服務中的 Container 選項比較 (Level 400)
AWS 微服務中的 Container 選項比較   (Level 400)AWS 微服務中的 Container 選項比較   (Level 400)
AWS 微服務中的 Container 選項比較 (Level 400)
 
Containerizing Legacy .NET Workloads (CON348-R1) - AWS re:Invent 2018
Containerizing Legacy .NET Workloads (CON348-R1) - AWS re:Invent 2018Containerizing Legacy .NET Workloads (CON348-R1) - AWS re:Invent 2018
Containerizing Legacy .NET Workloads (CON348-R1) - AWS re:Invent 2018
 

More from Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

More from Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Interstella GTC Workshop

  • 1. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Interstella GTC Workshop: Using Docker and Amazon ECS
  • 2. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. A quick recap…
  • 3. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. DOCKER IMAGE Read-only template Used to launch container Start with base image, additional data/dependencies are layers added on top Union file system merges layers into single image Instructions stored in Dockerfile bootfs kernel Base Image Image Image W ritable Container N ode.js N ginx U buntu References parent image
  • 4. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. DOCKERFILE FROM dockerfile/ubuntu RUN add-apt-repository -y ppa:nginx/stable && apt-get update && apt-get install -y nginx && rm -rf /var/lib/apt/lists/* && echo "ndaemon off;" >> /etc/nginx/nginx.conf && chown -R www-data:www-data /var/lib/nginx VOLUME ["/etc/nginx/sites-enabled", "/etc/nginx/certs", "/etc/nginx/conf.d", "/var/log/nginx", "/var/www/html"] WORKDIR /etc/nginx CMD ["nginx"] EXPOSE 80 EXPOSE 443 Source: https://github.com/dockerfile/nginx Pull base image Install Nginx Define mountable directories Define working directory Define default command Expose ports
  • 5. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. DOCKER IMAGE REGISTRY Images stored in a registry Amazon EC2 Container Registry (Amazon ECR) • Fully managed • Secure—encryption at rest, IAM integration • Scalable and highly available • Integrated with Amazon ECS and Docker CLI Docker Hub • Public repository of images • Provides private image storage Amazon ECR Docker Hub
  • 6. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. DOCKER ARCHITECTURE Docker daemon manages images, containers, networks, and volumes Docker client (for example, CLI) communicates with daemon through a REST API Sample commands: • docker build – build image from Dockerfile • docker images – list images on Docker host • docker run – run an image • docker ps – list running containers • docker stop – stop a running container docker daemon Docker Host Container 1 Container 2 Container n Ubuntu Image Nginx Image Custom Image
  • 7. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. WELCOME TO INTERSTELLA GTC Interstella GTC is an intergalactic trading company that was established to import and export rare resources in the universe. Interstella was a thriving company but business has been declining despite a booming economy. You and a few other consultants have been brought on board to turn this around. Will you be able to restore Interstella to its former glory?
  • 8. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. YOUR MISSION Interstella 8888 operates a logistics platform to control the processing centers of the four rare resources—tiberium, vespene gas, spice melange, and dilithium crystals. We need help deploying the platform to the AWS cloud and would like to adopt containers as a part of the move. Workshop #1 – Running Containers with Amazon ECS Lab 1: Containerize the Interstella logistics software Lab 2: Deploy containers using Amazon ECR and Amazon ECS Bonus Lab #1: Scale the logistics platform with an ALB Workshop #2 – Monolith to Microservices Now that you’ve bought us some more time, it’s time to build and deploy microservices: Lab 1: Deploy a monolith using Amazon ECS (you can skip if you completed workshop #1) Lab 2: Incrementally build and deploy each microservice Bonus Lab #2: Scale microservices with an ALB Workshop #3 – CICD for Containers on AWS Workshop #4 – Advanced Microservice Operations
  • 9. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. WORKSHOP ENVIRONMENT Public subnet – AZ #1 Public subnet – AZ #2 Amazon SNS EC2 Instance ECS Cluster EC2 Instance Amazon ECR Amazon API Gateway ORDER Amazon S3 bucket Amazon DynamoDB Amazon ECS Orders come into the logistics platform as HTTP POST messages via Amazon Simple Notification Service (Amazon SNS) Amazon S3 hosts web content and utilities—API key generator, order subscription, order dashboard The logistics platform communicates with an order fulfillment API running on Amazon API Gateway. Order data is stored in Amazon DynamoDB. Amazon CloudWatch
  • 10. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. LAB 1 – Containerize the application Public subnet – AZ #1 Public subnet – AZ #2 Amazon SNS EC2 Instance ECS Cluster EC2 Instance Amazon API Gateway ORDER Amazon S3 bucket Amazon DynamoDB 1. Construct a Dockerfile to build a Docker image for the logistics platform 2. Run the container using the Docker client to confirm it’s working as expected 3. Push the Docker image up to Amazon ECR FULFILL Amazon CloudWatch Amazon ECR Amazon ECS
  • 11. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. LAB 2 – Deploy the Application Public subnet – AZ #1 Public subnet – AZ #2 Amazon SNS EC2 Instance ECS Cluster EC2 Instance Amazon ECR Amazon API Gateway ORDER Amazon S3 bucket Amazon DynamoDB Amazon ECS 1. Construct an ECS task definition referencing the Docker image pushed up to ECR from lab 1 and configuring logging to Amazon CloudWatch Logs 2. Run the task and confirm orders are being processed FULFILL Amazon CloudWatch LOGS
  • 12. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. BONUS LAB #1 – Setup the ALB Public subnet – AZ #1 Public subnet – AZ #2 Amazon SNS EC2 Instance ECS Cluster EC2 Instance Amazon ECR Amazon API Gateway ORDER Amazon S3 bucket Amazon DynamoDB Amazon ECS 1. Create an Application Load Balancer (ALB) 2. Create an ECS service that ties in the ALB for routing orders to tasks and maintains a desired task count FULFILL Amazon CloudWatch LOGS Application Load Balancer
  • 13. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. LAB 4 – Deploy Microservices Public subnet – AZ #1 Public subnet – AZ #2 Amazon SNS EC2 Instance ECS Cluster EC2 Instance Amazon ECR Amazon API Gateway ORDER Amazon S3 bucket Amazon DynamoDB Amazon ECS 1. Build a Docker image for a resource microservice and store in ECR 2. Create an an ECS task definition to deploy the microservice image 3. Deploy the microservice image using ECS to start processing orders for that resource 4. Modify the monolith code to remove functionality of the microservice; rebuild the monolith image and re-deploy M FULFILL Amazon CloudWatch m FULFILL
  • 14. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. BONUS LAB #2 – Setup the ALB Public subnet – AZ #1 Public subnet – AZ #2 Amazon SNS EC2 Instance ECS Cluster EC2 Instance Amazon ECR Amazon API Gateway ORDER Amazon S3 bucket Amazon DynamoDB Amazon ECS 1. Create an Application Load Balancer (ALB) 2. Create an ECS service that ties in the ALB for routing orders to monolith and resource microservices; ALB will use path-based routing to route to each microservice target group 3. Repeat until all microservices are deployed M FULFILL Amazon CloudWatch Application Load Balancer m FULFILL /vespene /melange m
  • 15. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. LOGISTICS Instructions: http://interstella.trade/ Orders topic: arn:aws:sns:us-west-2:270206935686:monolith Raise your hand if you have any questions. High-five your neighbors and have fun! Please fill out feedback forms once you are done! Feel free to email us with comments/questions/feedback: aws-interstella-team@amazon.com
  • 16. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. In Summary
  • 17. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Thank you!