Distribua, gerencie e escale suas aplicações com o aws elastic beanstalk
Agile Deployment using Git and AWS Elastic Beanstalk
-
Upload
amazon-web-services -
Category
Technology
-
view
371 -
download
0
Transcript of Agile Deployment using Git and AWS Elastic Beanstalk
![Page 1: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/1.jpg)
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
May 2016
Agile Deployment using Git and
AWS Elastic Beanstalk
Alex Smith - @alexjs – [email protected]
![Page 2: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/2.jpg)
Web Services
APP DEPLOYMENT ENVIRONMENTS INFRASTRUCTURE
![Page 3: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/3.jpg)
What if you could just focus on your app ?
APPand a TOOLBOX for
DEPLOYMENT, ENVIRONMENTS and INFRASTRUCTURE
![Page 4: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/4.jpg)
You can, with AWS Elastic Beanstalk!
APP AWS Elastic Beanstalk
![Page 5: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/5.jpg)
Okay let’s get started!
![Page 6: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/6.jpg)
Components of a Web App
• Three tier architecture:
• Web Server
• App Server
• Database
• Components
• Application Compute
• Database Engine
• Storage and Delivery
![Page 7: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/7.jpg)
Components of a Web App
• Three tier architecture:
• Web Server
• App Server
• Database
• Components
• Application Compute
• Database Engine
• Storage & Delivery
![Page 8: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/8.jpg)
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 customisable.
![Page 9: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/9.jpg)
AWS Elastic Beanstalk Environment
• Two tiers:
• Web Server
• Worker
• Two types:
• Single instance
• Load balanced, auto scaling
• Configures Amazon Route 53
and provides a domain name
https://yourapp.elasticbeanstalk.com
![Page 10: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/10.jpg)
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 11: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/11.jpg)
AWS Elastic Beanstalk Instance Configuration
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 12: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/12.jpg)
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 13: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/13.jpg)
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 14: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/14.jpg)
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 15: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/15.jpg)
Live Demo
http://bit.ly/summit2016-helloworld
![Page 16: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/16.jpg)
Hello world
![Page 17: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/17.jpg)
Lets build a simple chat app!
![Page 18: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/18.jpg)
• Scalable and Highly Available
Lets build a simple chat app!
![Page 19: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/19.jpg)
• Scalable and Highly Available
• Database
Lets build a simple chat app!
![Page 20: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/20.jpg)
• Scalable and Highly Available
• Database
• WebSockets
Lets build a simple chat app!
![Page 21: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/21.jpg)
• Scalable and Highly Available
• Database
• WebSockets
Lets use a web framework: SailsJS
“The web framework of your dreams.
Built for developers by developers.”http://sailsjs.org
Lets build a simple chat app!
![Page 22: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/22.jpg)
Customisation via .ebextensions
• Customize AWS Elastic Beanstalk resources
• Examples:
• Deploy your resources in a custom VPC
• Configure your auto-scaling rules
• Much more
• Simple Chat:
• Custom VPC
• Configure ELB for websockets
![Page 23: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/23.jpg)
Live Demo
http://bit.ly/summit2016-simplechat
![Page 24: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/24.jpg)
Components of a Web App
• Three tier architecture:
• Web Server
• App Server
• Database
• Components
• Application Compute
• Database Engine
![Page 25: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/25.jpg)
Amazon RDS
Amazon RDS
• Fully managed relational database
• Automated full daily backups and 5 min
incremental point in time recovery
• Highly available through Multi-AZ with
automatic failover to standby database
• Easily create cross-region read replicas
• Managed underlying storage layer with
configurable IOPS performance
Aurora MariaDB
![Page 26: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/26.jpg)
Using Elastic Beanstalk with Amazon RDS
• Support for running Amazon RDS instances in your AWS Elastic
Beanstalk environment.
• RDS connection details are made available to application as
environment variables
• Database is tied to
beanstalk environment’s
lifecycle
![Page 27: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/27.jpg)
Live Demo
http://bit.ly/summit2016-simplechat-rds
![Page 28: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/28.jpg)
Simple Chat with a database
![Page 29: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/29.jpg)
Multi-AZ - High Availability SetupA Simple Multi-AZ Setup
![Page 30: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/30.jpg)
Multi-AZ - High Availability SetupAvailability Zone A - Fails
![Page 31: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/31.jpg)
Multi-AZ - High Availability SetupRDS Multi-AZ Failover Kicks In
![Page 32: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/32.jpg)
Multi-AZ - High Availability SetupSlave is promoted to Master
Starts accepting traffic
from Application
![Page 33: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/33.jpg)
Multi-AZ - High Availability SetupAuto scaling Kicks In
Spins up App Server instance
to maintain the min
count of 2
![Page 34: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/34.jpg)
WebSockets over multiple nodes?
![Page 35: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/35.jpg)
Amazon ElastiCache
Amazon ElastiCache
• Fully managed in-memory cache
• Dynamically add or remove cache nodes
• Memcached and Redis
• Cache node auto-discovery
• Multi-AZ node
placement
• Multi-AZ with
auto-failover
• Persistence
• Read replicas
![Page 36: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/36.jpg)
New branch: Simple Chat + DB + Redis
![Page 37: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/37.jpg)
Live Demo
http://bit.ly/summit2016-simplechat-redis
![Page 38: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/38.jpg)
2 Environments
PROD
STAGING
![Page 39: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/39.jpg)
Blue/Green Deployments
![Page 40: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/40.jpg)
Blue/Green Deployments
![Page 41: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/41.jpg)
Blue/Green Deployments
![Page 42: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/42.jpg)
Blue/Green Deployments
![Page 43: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/43.jpg)
Live Demo
![Page 44: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/44.jpg)
AWS Elastic Beanstalk
• Deploy and maintain complete
control over my environment.
• Focus on my app
• Git + EB CLI
![Page 45: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/45.jpg)
Smooth sailing from now on
![Page 46: Agile Deployment using Git and AWS Elastic Beanstalk](https://reader030.fdocuments.us/reader030/viewer/2022021507/58f9b3481a28ab22578b45a7/html5/thumbnails/46.jpg)
Thank You