aws elastic beanstalk - running microservices and docker

29
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Adhiraj Singh | Sr. Product Manager | AWS Elastic Beanstalk 06/21/2016 AWS Elastic Beanstalk (EB) Running Microservices and Docker

Upload: amazon-web-services

Post on 16-Apr-2017

4.378 views

Category:

Technology


4 download

TRANSCRIPT

Page 1: AWS Elastic Beanstalk - Running Microservices and Docker

© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Adhiraj Singh | Sr. Product Manager | AWS Elastic Beanstalk

06/21/2016

AWS Elastic Beanstalk (EB)Running Microservices and Docker

Page 2: AWS Elastic Beanstalk - Running Microservices and Docker
Page 3: AWS Elastic Beanstalk - Running Microservices and Docker

Agenda

• Elastic Beanstalk vs DIY

• How to use Elastic Beanstalk

• Multi-Container Docker with AWS Elastic Beanstalk

• Recently added features

• Customer Feature - Sean O’Brien (Prezi)

Page 4: AWS Elastic Beanstalk - Running Microservices and Docker

Developer Challenges

• Complexity of deploying code, provisioning

and managing infrastructure

• Expertise and time needed to manage and

configure servers, databases, load

balancers, firewalls, and networks

• How to automate application scaling

Page 5: AWS Elastic Beanstalk - Running Microservices and Docker

What is Elastic Beanstalk?

AWS Elastic Beanstalk is an easy-to-use service for

deploying and scaling web applications and services.

Page 6: AWS Elastic Beanstalk - Running Microservices and Docker

AWS Elastic Beanstalk vs. Do It Yourself

Your code

HTTP Server

Application Server

Language Interpreter

Operating System

Host

Elastic Beanstalk configures each

EC2 instance in your

environment with the components

necessary to run applications for

the selected platform.

Focus on building your

application

Provided by you

Provided and managed by AWS Elastic Beanstalk (EB)

On-instance configuration

Page 7: AWS Elastic Beanstalk - Running Microservices and Docker

AWS Elastic Beanstalk vs. Do It Yourself

• Preconfigured Infrastructure

• Single Instance (Dev, Low Cost)

• Load Balanced, Auto Scaling (Production)

• Web & Worker tiers

• Elastic Beanstalk provisions necessary

infrastructure resources such as the load

balancer, auto scaling group, security

groups, database (optional), etc.

• Provides a unique domain name for your

application

(e.g.: youapp.regionx.elasticbeanstalk.com)

Infrastructure stack

Page 8: AWS Elastic Beanstalk - Running Microservices and Docker

Common Use Cases

• Websites

• API backends

• Mobile backends

• Asynchronous workers

Page 9: AWS Elastic Beanstalk - Running Microservices and Docker

Customers

Page 10: AWS Elastic Beanstalk - Running Microservices and Docker

Elastic Beanstalk Benefits

Fast & simple

to begin

Developer

productivity

Impossible

to outgrow

Complete

resource control

No additional charge to use.

You only pay for underlying AWS resources (i.e.: EC2 instances, S3, etc.)

Page 11: AWS Elastic Beanstalk - Running Microservices and Docker

How do I get started with Elastic Beanstalk?

Page 12: AWS Elastic Beanstalk - Running Microservices and Docker

Information required to deploy application

01

02

03

04

Region

Stack (container) type

Single InstanceLoad Balanced with

auto-scalingOR

Database (RDS) Optional

Your codeSupported Platforms

Page 13: AWS Elastic Beanstalk - Running Microservices and Docker

Building applications with Elastic Beanstalk

Service Repos:

/myapp

/myapp/browserClient

/myapp/browserServer

/myapp/androidUI

/myapp/api

/myapp/notifications

/myapp/adminPortal

Application: api

Environment

prod-api V1

Environment

dev-api V1.1

Environment

browserClient V2

Environment

browserClient V2.1

Environment

dev-api V1.2

Environment

browserClient V3

Application: browser

Page 14: AWS Elastic Beanstalk - Running Microservices and Docker

How to deploy applications

1. Via AWS Management Console

2. Via AWS Toolkit for Eclipse and Visual

Studio IDE

3. Via AWS SDK’s and CLI

4. Via EB command line interface

$ eb deploy

Page 15: AWS Elastic Beanstalk - Running Microservices and Docker

Deploy Sample Application (EB CLI)

Initial application deployment workflow

$ git clone https://github.com/awslabs/eb-node-express-sample.git

Download sample application02

$ eb init

Create your Elastic Beanstalk app03

Follow the prompts to configure the

environment04

05 Create the resources and launch the

application

$ eb create

$ pip install --upgrade awsebcli

Install the AWS Elastic Beanstalk

command line interface (EB CLI)

01

Page 16: AWS Elastic Beanstalk - Running Microservices and Docker

Update Sample Application (EB CLI)

Update application workflow

Update your code01

$ git add .$ git commit –m “v2.0”$ eb deploy

Add & commit code to repository02

Open application once deployment

completes.

03

$ eb open

Page 17: AWS Elastic Beanstalk - Running Microservices and Docker

Docker with AWS Elastic Beanstalk

Page 18: AWS Elastic Beanstalk - Running Microservices and Docker

Docker Platform Configurations

• Single Container Docker

• Multi-Container Docker

Page 19: AWS Elastic Beanstalk - Running Microservices and Docker

Multi Container: Architecture

• Each environment has its own ECS Cluster

• Supports a single ECS Task definition per environment

• The ECS Task is defined in the Dockerrun.aws.json file

• Uses a flood scheduling mechanism

• Provides out of the box auto scaling for ECS Tasks

Elastic Beanstalk Environment

Auto Scaling Group / ECS Cluster

Instance 1 Instance 2

app1.elasticbeanstalk.com

Elastic Load Balancing

Container 2Container 1

Container 3

Container 2Container 1

Container 3

Page 20: AWS Elastic Beanstalk - Running Microservices and Docker

Multi Container: Dockerrun.aws.json

{"AWSEBDockerrunVersion": 2,"volumes": [

{"name": "node-app","host": {

"sourcePath": "/var/app/current/node-app"}

},{

"name": "tomcat-app","host": {

"sourcePath": "/var/app/current/tomcat-app"}

}],"containerDefinitions": [

{"name": "node-app","image": "node:0.12","essential": true,"memory": 128,"portMappings": [

{"hostPort": 80,"containerPort": 8000

}],"command": [

"/bin/bash","/usr/src/app/run.sh"

],"mountPoints": [

{"sourceVolume": "node-app","containerPath": "/usr/src/app"

}]

},{

"name": "tomcat-app","image": "tomcat:8.0","essential": true,"memory": 256,"portMappings": [

{"hostPort": 8080,"containerPort": 8080

}],"mountPoints": [

{"sourceVolume": "awseb-logs-tomcat-app","containerPath": "/usr/local/tomcat/logs"

},{

"sourceVolume": "tomcat-app","containerPath": "/usr/local/tomcat/webapps/ROOT","readOnly": true

}]

}]

}

Multi Container requires version 2

Page 21: AWS Elastic Beanstalk - Running Microservices and Docker

Multi Container with Elastic Beanstalk : Demo

Nginx Proxy ExampleCode at: https://github.com/awslabs/eb-docker-nginx-proxy

Page 22: AWS Elastic Beanstalk - Running Microservices and Docker

Benefits of using Multi-Container Docker with

Elastic Beanstalk

• Automation of capacity provisioning, load balancing,

scaling, and application health monitoring

• One stop management of your application in an

environment that supports range of services that are

integrated with Elastic Beanstalk, including but not

limited to VPC, RDS, and IAM.

Page 23: AWS Elastic Beanstalk - Running Microservices and Docker

New Features

Page 25: AWS Elastic Beanstalk - Running Microservices and Docker

Questions?

How to get in touch with the EB team?

AWS Elastic Beanstalk Forum:

https://forums.aws.amazon.com/forum.jspa?forumID=86

Twitter:

@aws_eb

Page 26: AWS Elastic Beanstalk - Running Microservices and Docker

Thank You!

Page 27: AWS Elastic Beanstalk - Running Microservices and Docker

Don’t Forget Evaluations!

Page 28: AWS Elastic Beanstalk - Running Microservices and Docker

Multi Container: Virtual Hosts ExampleCode at: https://github.com/awslabs/eb-docker-virtual-hosting

Elastic Beanstalk Environment

Auto Scaling Group / ECS Cluster

Instance 1 Instance 2

80

Container 1

Container 2

Nginx

Container 1

Container 2

Nginx

container1.app1.elasticbeanstalk.com

container2.app1.elasticbeanstalk.com

Elastic Load Balancing

Page 29: AWS Elastic Beanstalk - Running Microservices and Docker

Multi Container:

Multiple Ports ExampleCode at: https://github.com/awslabs/eb-docker-multiple-ports

Elastic Beanstalk Environment

Auto Scaling Group / ECS Cluster

Instance 1 Instance 2

Node.js Node.js

Tomcat

80

8080 Tomcat

app1.elasticbeanstalk.com:80

app1.elasticbeanstalk.com:8080

Elastic Load Balancing