31
AWS Cloud Kata for Start-Ups and Developers Taipei ݣ۹

AWS Elastic Beanstalk運作微服務與Docker

Embed Size (px)

Citation preview

Page 1: AWS Elastic Beanstalk運作微服務與Docker

AWS Cloud Kata for Start-Ups and Developers

Taipei

Page 2: AWS Elastic Beanstalk運作微服務與Docker

AWS Cloud Kata for Start-Ups and Developers

Taipei

AWS Elastic Beanstalk Multi-container Microservices with Docker

KJ Wu Solutions Architect Amazon Web Services

Page 3: AWS Elastic Beanstalk運作微服務與Docker

AWS Cloud Kata for Start-Ups and Developers

  Elastic Beanstalk vs DIY   How to use Elastic Beanstalk   Multi-container Docker with AWS Elastic Beanstalk   Recently added Features

Agenda

Page 4: AWS Elastic Beanstalk運作微服務與Docker

AWS Cloud Kata for Start-Ups and Developers

Web Services

APP DEPLOYMENT ENVIRONMENTS INFRASTRUCTURE

Page 5: AWS Elastic Beanstalk運作微服務與Docker

AWS Cloud Kata for Start-Ups and Developers

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

DevOps changes how you are used to working

Page 6: AWS Elastic Beanstalk運作微服務與Docker

AWS Cloud Kata for Start-Ups and Developers

What if you could just focus on your app ?

APP and a TOOLBOX for

DEPLOYMENT, ENVIRONMENTS and INFRASTRUCTURE

Page 7: AWS Elastic Beanstalk運作微服務與Docker

AWS Cloud Kata for Start-Ups and Developers

YES! You can, with AWS Elastic Beanstalk!

APP AWS Elastic Beanstalk

Page 8: AWS Elastic Beanstalk運作微服務與Docker

AWS Cloud Kata for Start-Ups and Developers

Okay let’s get started!

Page 9: AWS Elastic Beanstalk運作微服務與Docker

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 10: AWS Elastic Beanstalk運作微服務與Docker

AWS Cloud Kata for Start-Ups and Developers

AWS Elastic Beanstalk Your 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 11: AWS Elastic Beanstalk運作微服務與Docker

AWS Cloud Kata for Start-Ups and Developers

Components of a Web App •  Three tier architecture:

•  Web Server •  App Server •  Database

•  Components •  Application Compute •  Database Engine •  Storage and Delivery

Page 12: AWS Elastic Beanstalk運作微服務與Docker

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 13: AWS Elastic Beanstalk運作微服務與Docker

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 14: AWS Elastic Beanstalk運作微服務與Docker

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 15: AWS Elastic Beanstalk運作微服務與Docker

AWS Cloud Kata for Start-Ups and Developers

The Common Used Deployment Options

Page 16: AWS Elastic Beanstalk運作微服務與Docker

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

$pipinstallawsebcli

Page 17: AWS Elastic Beanstalk運作微服務與Docker

AWS Cloud Kata for Start-Ups and Developers

Example: CLI workflow

Initial app deployment:

$gitinit. $gitadd.Initialize your Git repository 01 Add your code 04

$ebinit $gitcommit–m“v1.0”Create your Elastic Beanstalk app 02 Commit 05

Follow the prompts to configure the environment 03 Create the resources and launch the

application 06

$ebcreate

Page 18: AWS Elastic Beanstalk運作微服務與Docker

AWS Cloud Kata for Start-Ups and Developers

Example: CLI workflow

Update your app:

Update your code 01

$gitadd.$gitcommit–m“v2.0”$ebdeploy

Push the new code 02

Monitor the deployment progress 03

$ebstatus

Page 19: AWS Elastic Beanstalk運作微服務與Docker

AWS Cloud Kata for Start-Ups and Developers

Docker with AWS Elastic Beanstalk

Page 20: AWS Elastic Beanstalk運作微服務與Docker

AWS Cloud Kata for Start-Ups and Developers

Docker with AWS Elastic Beanstalk

 Single Docker Container

 Multiple Docker Containers

Page 21: AWS Elastic Beanstalk運作微服務與Docker

AWS Cloud Kata for Start-Ups and Developers

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   Supports multiple ELB

listeners for inbound traffic   Provides out of the box auto

scaling for ECS Tasks

Task 1-1 Task 1-2

Container 1 Container 1

ELB

Instance 1 Instance 2

Container 2

Container 3

Container 2

Container 3

Page 22: AWS Elastic Beanstalk運作微服務與Docker

AWS Cloud Kata for Start-Ups and Developers

Multi Container Dockerrun.aws.json

{ "AWSEBDockerrunVersion": 2, [...] }

the value "2" for multicontainer Docker environments

Page 23: AWS Elastic Beanstalk運作微服務與Docker

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: AWS Elastic Beanstalk運作微服務與Docker

AWS Cloud Kata for Start-Ups and Developers

Multi Container Dockerrun.aws.json "links": [

"php-app", "list-service", "search-service”

]

Page 25: AWS Elastic Beanstalk運作微服務與Docker

AWS Cloud Kata for Start-Ups and Developers

Multi Container Dockerrun.aws.json

"mountPoints": [

{ "sourceVolume": "php-app", "containerPath": "/var/www/html", "readOnly": true }

]

"volumes": [ { "name": "php-app", "host": { "sourcePath": "/var/app/current/php-app" } } ]

Page 26: AWS Elastic Beanstalk運作微服務與Docker

AWS Cloud Kata for Start-Ups and Developers

Nginx Proxy Example: bit.ly[….]

Page 27: AWS Elastic Beanstalk運作微服務與Docker

AWS Cloud Kata for Start-Ups and Developers

Live Demo

Slightly more difficult…

Page 28: AWS Elastic Beanstalk運作微服務與Docker

AWS Cloud Kata for Start-Ups and Developers

New Features

  Support for EC2 Container Registry   Managed Updates   New Deployment Options   Support for Application Load Balancer

Page 29: AWS Elastic Beanstalk運作微服務與Docker

AWS Cloud Kata for Start-Ups and Developers

New Deployment Options Rolling with additional batch

Rolling: Immutable

Page 30: AWS Elastic Beanstalk運作微服務與Docker

AWS Cloud Kata for Start-Ups and Developers

Questions? KJ Wu Solutions Architect, AWS

Page 31: AWS Elastic Beanstalk運作微服務與Docker

AWS Cloud Kata for Start-Ups and Developers

THANK YOU! Please remember to fill out evaluations