Professional Documents
Culture Documents
Shiva Narayanaswamy
Solution Architect
DEPLOYMENTS AT AMAZON.COM
Business
Development Operations
Continuous Innovation
Customer Business
Feedback Idea
Customer
Release Implementation
Testing
Deploying More Frequently Lowers Risk
Rare Release Events: Frequent Release Events:
Waterfall Methodology Agile Methodology
Change
Change
Time Time
Lots of Learning
Requirements Development
Test and QA Release
Gathering and Check In
Cycle Time
Minimal Learning
Some Learning
Change is inevitable
Dev / QA Ops
Agile
Sprint Sprint Sprint
Deploy
A D B T A D B T A D B T
RE
Code
DevOps
W
a
Developer l IT Operations
l
A philosophy? Cultural change? Paradigm shift ?
Alignment of development and IT operations with better communication and
collaboration ?
Improvement in software deployment ?
Breaking down the barriers between development and IT operations ?
Akin to Agile software development applied to infrastructure and IT
operations
Set of tools and processes
Its all of the above!
Business and IT agility
Business
Iterative development
Agile Scrum, sprints, stories
Business
Development Velocity Agility
Design Code Refactor Unit Test Bug Fix Deliver
Developers
(application)
Continuous Integration IT
Continuous Deployment
DevOps IT Automation Agility
Application Management
IT Operations
Building Teams
Continuous Deployment
Communication
Delivery Pipelines
Agile
Deployment Automation
Infrastructure as code
Application and Infrastructure version management
Continuous Integration
Test Automation
Continuous Deployment
Monitoring and logging
Sample Application Cycle
CloudFormation
Templates for Env
Repo
Generate
Package
Config Builder
Install
Create AMIs
Code Push
Config
Test Env
Tests
Version Deploy
CI Server Staging Env
Commit to Control Server
Git/master
Get /
Pull Prod Env
Dev
Code Distributed Builds
Run Tests in parallel
Continuous Integration
CloudFormation
Templates for Env
Repo
Generate
Package
Config Builder
Install
Create AMIs
Code Push
Config
Test Env
Tests
Version Deploy
CI Server Staging Env
Commit to Control Server
Get /
Git/master Prod Env
Dev Pull
Code Distributed Builds
Run Tests in parallel
CloudFormation
Templates for Env
Repo
Generate
Package
Config Builder
Install
Create AMIs
Code Push
Config
Test Env
Tests
Version Deploy
CI Server Staging Env
Commit to Control Get / Server
Git/master Pull Prod Env
Dev Code
Distributed Builds
Run Tests in parallel
Test Env
Version Control Artifact Repository
DR Env
CloudFormation
AWS Opsworks
CodeCommit CodePipeline
AWS Elastic Container Service
28
CodeCommit
Secure, scalable, and managed Git source control Git objects
in Amazon S3
Git index
in Amazon
SSH or HTTPS
DynamoDB
git push CodeCommit Encryption key
in AWS KMS
Data redundancy across Availability Zones
Data-at-rest encryption
Integrated with AWS Identity and Access Management
No repo size limit
Same Git experience
$ git clone https://git-codecommit.us-east-1.amazonaws.com/v1/repos/aws-cli
Cloning into 'aws-cli'...
Receiving objects: 100% (16032/16032), 5.55 MiB | 1.25 MiB/s, done.
Resolving deltas: 100% (9900/9900), done.
Checking connectivity... done.
$ nano README.rst
$ git commit -am 'updated README'
[master 4fa0318] updated README
1 file changed, 1 insertion(+)
$ git push
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 297 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
remote:
To https://git-codecommit.us-east-1.amazonaws.com/v1/repos/aws-cli
4dacd6d..4fa0318 master -> master
CodePipeline
Continuous delivery and release automation, just like Amazon
Dev
v1, v2, v3 CodeDeploy
Staging Production
Staging
One-at-a-time v2 v1 v1 v1 v1 v1 v1 v1
Half-at-a-time v2 v2 v2 v2 v1 v1 v1 v1
All-at-once v2 v2 v2 v2 v2 v2 v2 v2
Rolling update Deploy without downtime
Load Balancer
v1 v1 v1
Rolling update Deploy without downtime
Load Balancer
v2 v1 v1
Rolling update Deploy without downtime
Load Balancer
v2 v2 v1
Rolling update Deploy without downtime
Load Balancer
v2 v2 v2
Rolling update Deploy without downtime
Load Balancer
v2 v2 v2
Health Tracking Catch deployment problems
Load Balancer
v2 v2 v2
Health tracking Catch deployment problems
Load Balancer
v3 Stop v2 v2
Health tracking Catch deployment problems
Load Balancer
Rollback
v2 v2 v2
Health tracking Catch deployment problems
Load Balancer
v2 v2 v2
DevOps Stack on AWS
AWS Opsworks
CodeCommit CodePipeline
AWS Elastic Container Service
49
Automate with AWS CLI
Automate with AWS SDK
AWS Cloudformation
Infrastructure as Code
Integrates with version control
JSON format
Templates
Stacks
AWS CloudFormation Supports most AWS resource types
AWS Cloudformation
{
"Description" : "Create an EC2 instance running the Amazon Linux 32 bit AMI.,
"Parameters" : {
"KeyPair" : {
"Description" : "The EC2 Key Pair to allow SSH access to the instance",
"Type" : "String"
}
},
"Resources" : {
"Ec2Instance" : {
"Type" : "AWS::EC2::Instance",
"Properties" : {
"KeyName" : { "Ref" : "KeyPair" },
"ImageId" : "ami-75g0061f,
InstanceType : m1.medium
}
}
},
"Outputs" : {
"InstanceId" : {
"Description" : "The InstanceId of the newly created EC2 instance",
"Value" : { "Ref" : "Ec2Instance }
}
}
}
AWS Cloudformation
Use the version
control system of
your choice to store
Build out multiple
and track changes to
environments, such
Dev this template
as for Development, Git
Test, and Production Test Subversion
using the template Mercurial
Prod
Template File
Defining Stack
Amazon S 3 Amazon
Amazon
Route 5 3
CloudFront
Dev MySQL DEV APP DEV WEB
ELB ELB Dev Admin
DB Instance Dev Stack Dev Stack
Instance
Tier 2 Tier 1 Amazon
DynamoDB
Dev Environment VPC Subnet
VPN
VPN Internet TUNNEL Developers
Endpoint Gateway
&
Pre-commit Operations
Hook Internal
CI Workers CI Server
Git NAT Instance Amazon S QS
Testing Environment Subnet VPN facing VPC Subnet
Infrastructure Code
Scale out
at the
container
level
Cluster of underlying
EC2 instances
What are we deploying? How much control do we want?
AWS Tools 3rd-Party Tools
CloudFormation Chef
Elastic Beanstalk Puppet
OpsWorks
Deployment Approaches
Deploy in place
Deploy all at once (Service outage)
Rolling updates
Blue-Green Deployment
Discrete environment
Multiple environments from branches
Support A/B testing
Rolling DNS
Alternate Blue-Green (Red-Black?) deployment
Alternate auto scaling group
Avoid messing with DNS
Deploy in place Rolling update
ELB
CodeDeploy S3
Pipelines
Pipelines
Deploy in place Rolling update
Pipelines
Pipelines
Deploy in place Rolling update
Pipelines
Pipelines
Deploy in place Rolling update
Pipelines
Pipelines
Deploy in place Rolling update
Pipelines
Pipelines
Deploy in place Rolling update
Pipelines
Pipelines
Pipelines
Blue-Green Deployment
Amazon
Route 53
100%
ELB
EC2
Instances
EL EL
B B
EC2 EC2
Instances Instances
90% 10%
EL EL
B B
EC2 EC2
Instances Instances
50% 50%
ELB ELB
EC2 EC2
Instances Instances
MySQL ElastiCache
DynamoDB
RDS Cache
Instance Node
Blue-Green Deployment
Amazon
Route 53
0% 100%
ELB ELB
EC2 EC2
Instances Instances
MySQL ElastiCache
DynamoDB
RDS Cache Node
Instance
Blue-Green Deployment
Amazon
Route 53
0% 100%
EL ELB
B
EC2 EC2
Instances Instances
MySQL ElastiCache
DynamoDB
RDS Cache
Instance Node
Red-Black Deployment
ELB
Auto
Scaling
Group
V1
Amazon
Relational
Database
Service (RDS)
Red-Black Deployment
ELB
UAT
Amazon
Relational
Database
Service (RDS)
ALM | Red-Black Deployment
ELB
Amazon
Relational
Database
Service (RDS)
Red-Black Deployment
ELB
Auto Scaling
Group
V2
Amazon
Relational
Database
Service (RDS)
Monitoring & Metrics : The DevOps Pulse