34
AWS Cloud Kata for Start-Ups and Developers Hong Kong Aug 3

Running Microservices and Docker with AWS Elastic Beanstalk

Embed Size (px)

Citation preview

Page 1: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

Hong Kong

Aug 3

Page 2: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

Hong Kong

AWS Elastic BeanstalkMulti-container Microservices with Docker

Alex Smith

Head of Media & Entertainment Architecture, Asia Pacific

Amazon Web Services

Page 3: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

Web Services

APP DEPLOYMENT ENVIRONMENTS INFRASTRUCTURE

Page 4: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

Developer ChallengesComplexity of deploying code,

provisioning and managing

infrastructure

Expertise and time needed to

manage and configure servers,

databases, load balancers,

firewalls, and networks

Difficulty automating application

scaling

Page 5: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

What if you could just focus on your app?

and a TOOLBOX for

DEPLOYMENT, ENVIRONMENTS and

INFRASTRUCTURE

APP

Page 6: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

You can, with AWS Elastic Beanstalk!

APP AWS Elastic Beanstalk

Page 7: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

Okay let’s get started!

Page 8: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

AWS Elastic Beanstalk

Easy to use Service

Deploy and Scale

Web Apps

Don’t Sweat the Small

Stuff

Page 9: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

AWS Elastic BeanstalkYour code

HTTP server

Application server

Language interpreter

Operating system

Host

• Each Amazon EC2

instance comes with the

necessary components

to run applications

• No more worrying about

logging into instances to

install and configure your

app stack

Focus on building your app

Page 10: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

AWS Elastic Beanstalk - EB

• Easily deploy, monitor, and scale applications

• Infrastructure provisioned and managed by EB.

You maintain complete control.

• Preconfigured application containers that are

easily customizable.

Page 11: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

AWS Elastic Beanstalk Environment

• Two tiers

• Web Server

• Worker

• Two types:

• Single instance

• Load balanced, auto scalable

• Configures Amazon Route 53

and provides a domain name

https://yourapp.elasticbeanstalk.com

Page 12: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

Application Versioning

Saved Configurations

Allow for easy duplication for

A/B testing or non-disruptive

deployments

Application Versions

All versions are stored

durably in Amazon S3.

Code can also be pushed

from a Git repository!

Page 13: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

Deployment Options

1. Via the AWS Management Console

2. Via Git / EB CLI

3. Via the AWS Toolkit for Eclipse and

the Visual Studio IDE

$ pip install awsebcli

Page 14: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

Example: CLI workflow

Initial app deployment:

$ git init . $ git add .

Initialize your Git repository01 Add your code04

$ eb init $ git commit –m "v1.0"

Create your Elastic Beanstalk app02 Commit05

Follow the prompts to configure the

environment03

Create the resources and launch the

application06

$ eb create

Page 15: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

Example: CLI workflow

Update your app:

Update your code01

$ git add .$ git commit –m "v2.0"$ eb deploy

Push the new code 02

Monitor the deployment progress03

$ eb status

Page 16: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

Example: CLI workflow

Update your app:

Update your code01

$ git add .$ git commit –m "v2.0"$ eb deploy

Push the new code 02

Monitor the deployment progress03

$ eb status

Page 17: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

More Details of EB CLI

Agile Deployment using Git and

AWS Elastic Beanstalk

http://bitly.com/summit-2016-sg

Page 18: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

Docker with

AWS Elastic Beanstalk

Page 19: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

Docker with AWS Elastic Beanstalk

Single Docker

Container

Page 20: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

Docker with AWS Elastic Beanstalk

Single Docker

Container

Multiple Docker

Containers

Page 21: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

Multi Container: Architecture

Each env: 1 ECS Cluster

1 Task Def / Env

ECS Task defined in Dockerrun.aws.json

Out of the box auto scaling for ECS Tasks

Task 1-1 Task 1-2

Container 1

C2 C3

Container 1

C2 C3

ELB

Instance 1 Instance 2

Page 22: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

Multi Container Dockerrun.aws.json

{

"AWSEBDockerrunVersion": 2,

[...]

}

Page 23: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

Multi Container Dockerrun.aws.json

"containerDefinitions": [

{

"name": "php-app",

"image": "php:fpm",

"essential": true,

"memory": 128,

},

Page 24: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

Multi Container Dockerrun.aws.json

"links": [

"php-app",

"list-service",

"search-service”

]

Page 25: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

Multi Container Dockerrun.aws.json

"mountPoints": [

{

"sourceVolume": "php-app",

"containerPath": "/var/www/html",

"readOnly": true

}

]

Page 26: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

Nginx Proxy Example: bit.ly/eb-docker-nginx

Page 27: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

Live Demo

Slightly more difficult…

Page 28: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

New Features

Page 29: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

New Features

Support for EC2 Container Registry

Managed Updates

New Deployment Options • (Immutable, Additional Batch)

Page 30: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

Three Next Steps

1. Check out the EB + Git talk from the SG Summit -

http://bitly.com/summit-2016-sg

2. Try out the “EB VirtualHosting” demo -

https://github.com/awslabs/eb-docker-virtual-hosting

3. Build your own custom web-app using EB CLI!

Page 31: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

Questions?

http://bit.ly/eb-forum

T: @aws_eb

Page 32: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

Questions?

E: [email protected]

T: @alexjs

Page 33: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

THANK YOU!

Please remember to fill out evaluations

Page 34: Running Microservices and Docker with AWS Elastic Beanstalk

AWS Cloud Kata for Start-Ups and Developers

Hong Kong

Aug 3