35
AWS로 스마트하게 소프트웨어 배포하기 김일호, 솔루션즈 아키텍트, 한국 아마존웹서비스

AWS Innovate: Smart Deployment on AWS - Andy Kim

Embed Size (px)

Citation preview

Page 1: AWS Innovate: Smart Deployment on AWS - Andy Kim

AWS로스마트하게소프트웨어배포하기

김일호, 솔루션즈아키텍트, 한국아마존웹서비스

Page 2: AWS Innovate: Smart Deployment on AWS - Andy Kim
Page 3: AWS Innovate: Smart Deployment on AWS - Andy Kim

~11.6s

Mean time between deployments

(weekday)

~1,079

Max number of deployments in a

single hour

~10,000

Mean number of hosts simultaneously

receiving a deployment

~30,000

Max number of hosts simultaneously

receiving a deployment

DEPLOYMENTS AT AMAZON.COM

Page 4: AWS Innovate: Smart Deployment on AWS - Andy Kim

Monolithic

Service-Oriented architectureAgilityMicroservice

Page 5: AWS Innovate: Smart Deployment on AWS - Andy Kim

Better Communication~

Better productivity~

Effectiveness~

Decentralized~

Agility~

Ownership~

Page 6: AWS Innovate: Smart Deployment on AWS - Andy Kim

Microservice development lifecycle

developers delivery pipelinesservices

releasetestbuild

releasetestbuild

releasetestbuild

releasetestbuild

releasetestbuild

Page 7: AWS Innovate: Smart Deployment on AWS - Andy Kim

MonitorProvisionDeployTestBuildCode

Elastic Beanstalk

OpsWorks

Cloud

Watch

Cloud

Formation

Code

Deploy

Code

Commit

Code

Pipeline

Page 8: AWS Innovate: Smart Deployment on AWS - Andy Kim

CodeCommit

Page 9: AWS Innovate: Smart Deployment on AWS - Andy Kim

Source control in the cloud

Secure Fullymanaged

High availability

Storeanything

Page 10: AWS Innovate: Smart Deployment on AWS - Andy Kim

AWS CodeCommit

• Use standard Git tools

• Scalability, availability, and durability of Amazon S3

• Encryption at rest with customer-specific keys

• No repo size limit

git pull/push CodeCommit

Git objects inAmazon S3

Git index inAmazon DynamoDB

Encryption keyin AWS KMS

SSH or HTTPS

Page 11: AWS Innovate: Smart Deployment on AWS - Andy Kim

CodePipeline

Page 12: AWS Innovate: Smart Deployment on AWS - Andy Kim

AWS CodePipeline

Continuous delivery and release automation, just like Amazon

Build

1) Build

2) Unit test

1) Deploy

2) UI test

Source Beta Production

1) Deploy

2) Load test

Gamma

1) Deploy region1

2) Deploy region2

3) Deploy regoin3

Page 13: AWS Innovate: Smart Deployment on AWS - Andy Kim

AWS CodePipeline

• Continuous Delivery and Release Automation

• Design your own workflow• Source-Code Checking• Building• Testing• Deploying

• Integration with partners and custom plugins

• Configure gates between stages• Time based vs manual approvals

• Visual editor and status monitoring

Page 14: AWS Innovate: Smart Deployment on AWS - Andy Kim

CodePipeline example

https://blogs.aws.amazon.com/application-management/blog/tag/CodePipeline

Page 15: AWS Innovate: Smart Deployment on AWS - Andy Kim

CodePipeline example

https://blogs.aws.amazon.com/application-management/blog/tag/CodePipeline

Page 16: AWS Innovate: Smart Deployment on AWS - Andy Kim

CodeDeploy

Page 17: AWS Innovate: Smart Deployment on AWS - Andy Kim

CodeDeploy

• Scale from 1 instance to thousands

• Deploy without downtime

• Centralize deployment control and monitoring

Staging

CodeDeployv1, v2, v3

Production

Dev

Applicationrevisions

Deployment groups

Page 18: AWS Innovate: Smart Deployment on AWS - Andy Kim

Step 1: Package your application (with an AppSpec file)

version: 0.0

os: linux

files:

- source: chef/

destination: /etc/chef/codedeploy

- source: target/hello.war

destination: /var/lib/tomcat6/webapps

hooks:

ApplicationStop:

- location: deploy_hooks/stop-tomcat.sh

BeforeInstall:

- location: deploy_hooks/install-chef.sh

AfterInstall:

- location: deploy_hooks/librarian-install.sh

ApplicationStart:

- location: deploy_hooks/chef-solo.sh

ValidateService:

- location: deploy_hooks/verify_service.sh

Page 19: AWS Innovate: Smart Deployment on AWS - Andy Kim

Step 1: Package your application (with an AppSpec file)

version: 0.0

os: linux

files:

- source: chef/

destination: /etc/chef/codedeploy

- source: target/hello.war

destination: /var/lib/tomcat6/webapps

hooks:

ApplicationStop:

- location: deploy_hooks/stop-tomcat.sh

BeforeInstall:

- location: deploy_hooks/install-chef.sh

AfterInstall:

- location: deploy_hooks/librarian-install.sh

ApplicationStart:

- location: deploy_hooks/chef-solo.sh

ValidateService:

- location: deploy_hooks/verify_service.sh

Page 20: AWS Innovate: Smart Deployment on AWS - Andy Kim

Step 1: Package your application (with an AppSpec file)

version: 0.0

os: linux

files:

- source: chef/

destination: /etc/chef/codedeploy

- source: target/hello.war

destination: /var/lib/tomcat6/webapps

hooks:

ApplicationStop:

- location: deploy_hooks/stop-tomcat.sh

BeforeInstall:

- location: deploy_hooks/install-chef.sh

AfterInstall:

- location: deploy_hooks/librarian-install.sh

ApplicationStart:

- location: deploy_hooks/chef-solo.sh

ValidateService:

- location: deploy_hooks/verify_service.sh

Page 21: AWS Innovate: Smart Deployment on AWS - Andy Kim

Step 2: Set up your target environments

Agent Agent Agent

Staging

Agent Agent

Agent Agent

Agent

Agent

Production

Deployment groupDeployment group

Group instances by:

• Auto Scaling group

• Amazon EC2 tag

• On-premises tag

Page 22: AWS Innovate: Smart Deployment on AWS - Andy Kim

Step 3: Deploy

aws deploy create-deployment \

--application-name MyApp \

--deployment-group-name TargetGroup \

--s3-location bucket=MyBucket,key=MyApp.zip

AWS CLI & SDKsAWS ConsoleCI / CD PartnersGitHub

Page 23: AWS Innovate: Smart Deployment on AWS - Andy Kim

Deployment config – Choose speed

v2 v2 v2 v2 v2 v2 v2 v2All-at-onceMin. healthy hosts = 0

v2 v2 v2 v2 v1 v1 v1 v1Half-at-a-timeMin. healthy hosts = 50%

v2 v2 v1 v1 v1 v1 v1 v1[Custom]Min. healthy hosts = 75%

v2 v1 v1 v1 v1 v1 v1 v1One-at-a-timeMin. healthy hosts = 99%

Page 24: AWS Innovate: Smart Deployment on AWS - Andy Kim

Rolling update – Deploy without downtime

v1v1 v1

Load Balancer

Page 25: AWS Innovate: Smart Deployment on AWS - Andy Kim

Rolling update – Deploy without downtime

v1v2 v1

Load Balancer

Page 26: AWS Innovate: Smart Deployment on AWS - Andy Kim

Rolling update – Deploy without downtime

v2v2 v1

Load Balancer

Page 27: AWS Innovate: Smart Deployment on AWS - Andy Kim

Rolling update – Deploy without downtime

v2v2v2

Load Balancer

Page 28: AWS Innovate: Smart Deployment on AWS - Andy Kim

Rolling update – Deploy without downtime

v2v2 v2

Load Balancer

Page 29: AWS Innovate: Smart Deployment on AWS - Andy Kim

Health tracking – Catch deployment problems

v2v2 v2

Load Balancer

Page 30: AWS Innovate: Smart Deployment on AWS - Andy Kim

Health tracking – Catch deployment problems

v3 v2 v2Stop

Load Balancer

Page 31: AWS Innovate: Smart Deployment on AWS - Andy Kim

Health tracking – Catch deployment problems

v2v2 v2

Load Balancer

Rollback

Page 32: AWS Innovate: Smart Deployment on AWS - Andy Kim

Health tracking – Catch deployment problems

v2v2 v2

Load Balancer

Page 33: AWS Innovate: Smart Deployment on AWS - Andy Kim

Amazon

S3

Pro

d -

subnet

Web

serve

r

App

serve

r

Amazon

RDS

ELB

Production

Dev

-subnet

Auto Scaling group

Web

serve

r

Auto Scaling group

App

serve

r

Amazon

RDS

ELB

Development

Test -

subnet

Web

serve

r

App

serve

r

Amazon

RDS

ELB

Test

CodePipleline CodeDeployCodeCommit

Services- Highly available CloudWatch alarm

CloudTrail

CloudFormation

Elastic

Beanstalk

Page 34: AWS Innovate: Smart Deployment on AWS - Andy Kim

Online Labs & Training

Gain confidence and hands-on experience with AWS.

Watch free Instructional Videos and explore Self-Paced Labs

Instructor Led Classes

Learn how to design, deploy and operate highly available, cost-

effective and secure applications on AWS in courses led by qualified

AWS instructors

Validate your technical expertise with AWS and use practice exams to help you

prepare for AWS Certification

AWS Certification

More info at http://aws.amazon.com/training

Page 35: AWS Innovate: Smart Deployment on AWS - Andy Kim

Thank You for Attending AWS Innovate

We hope you found it interesting! Do provide us with your feedback for the session and complete the feedback form.

Let us know your thoughts of today’s event and how we can improve the event experience for you in the future.