Orchestrating the     Cloud                              Matt Wood        T E C H N O L O G Y   E VA N G E L I S T
Welcome
AGENDA     Orchestrating the Cloud1. Ap   plication architecture2. Role of orchestration3 . Pillars of orchestration4. Orc...
1ApplicationArchitecture
Applicationsin the cloud
3 tiers
Application tierCode   Configuration
Application tierCode   Configuration
Application tier       Code           Configuration                                         Service tier                   ...
Application tier       Code           Configuration                                         Service tier                   ...
Application tier        Code                    Configuration                                                        Servic...
Value baked into    each tier
Value inapplication
Value inservice tier
Optimisation        Configuration     Value in    service tier           Technology             choices
Value ininfrastructure
Engine room   Optimised     Value in  infrastructure Scalable     Fault tolerant
Maximising  Orchestrationmaximises this value     value
EphemeralMaximising     to  value  concrete
One team Maximising        to     valuewhole organisation
One hitMaximising      to   value reproducible
MaximisingBrittle to strong     value
MaximisingMaximise value  value
Maximising Minimise risk   value
2  Role ofOrchestration
Cloud life cycle
Initialisation
Steady state  run time
Updates
Application updatesUpdates Service updates
Scale events
Changemanagement
Ver y me t a !      Managing       change     management
3  Pillars ofOrchestration
Z   E   R   O   T   H   P   I   L   L   A   RVersion control
F   I   R   S   T   P   I   L   L   A   RProvisioningorchestration
CloudFormation aws.amazon.com/cloudformation
Template
Define a fullinfrastructure     stack
Auto-scaling                                      RDS  EC2        SNS                           SimpleDB                  ...
Template   CloudFormation                            Provisioned                             resources
Completedefinition
Atomic
Idempotent
Free
Anatomy of a  template
JSON
Perfect forPlain text                        version control             JSON             Validate-able
Declarative language
{    "AWSTemplateFormatVersion" : "2010-09-09",    "Description" : "Create an EC2 instances",    "Parameters" : {       "K...
{    "AWSTemplateFormatVersion" : "2010-09-09",    "Description" : "Create an EC2 instances",                             ...
ParametersProvision-time specification  Command line options
"Parameters" : {   "KeyName" : {     "Description" : "Name of an existing      EC2 KeyPair to enable SSH access to      th...
Mappings  Conditionals Case statements
"Mappings" : {   "RegionMap" : {     "us-east-1" : {         "AMI" : "ami-76f0061f"     },     "us-west-1" : {         "AM...
"Mappings": {  "AWSInstanceType2Arch" : {     "t1.micro"    : { "Arch"   :   "64"   },     "m1.large"    : { "Arch"   :   ...
Resources
"Resources" : {    "Ec2Instance" : {      "Type" : "AWS::EC2::Instance",      "Properties" : {        "KeyName" : { "Ref" ...
"Resources" : {    "Ec2Instance" : {      "Type" : "AWS::EC2::Instance",      "Properties" : {        "KeyName" : { "Ref" ...
"Resources" : {    "Ec2Instance" : {      "Type" : "AWS::EC2::Instance",      "Properties" : {        "KeyName" : { "Ref" ...
"KeyName" : { "Ref" : "KeyName" },                  Par  ame  ter                   re fere nce
"ImageId" : {     "Fn::FindInMap" :     [ "RegionMap", { "Ref" : "AWS::Region" }, "AMI" ]},
M ap c ondit ional"ImageId" : {     "Fn::FindInMap" :     [ "RegionMap", { "Ref" : "AWS::Region" }, "AMI" ]},
"ImageId" : {     "Fn::FindInMap" :     [ "RegionMap", { "Ref" : "AWS::Region" }, "AMI" ]},       Nam e of         map
"ImageId" : {     "Fn::FindInMap" :     [ "RegionMap", { "Ref" : "AWS::Region" }, "AMI" ]},                     Intrinsic ...
OutputsReturned values
"Outputs" : {      "InstanceId" : {         "Description" : "InstanceId of the newly created EC2 instance",         "Value...
Deliver via API
Validate via API
Deliver via S3
Growing library
S   E   C   O   N   D   P   I   L   L   A   RConfigurationmanagement
Custom AMI
m1.large100Gb
Template m1.large  AMI         AMISNAPSHOT  100Gb     SNAPSHOT
m1.large  AMI       m1.largeSNAPSHOT  100Gb     100Gb
m1.large   m1.large   m1.large   m1.large100Gb      100Gb      100Gb      100Gbm1.large   m1.large   m1.large   m1.large10...
Bootstrap
Generic AMI
Custom build
Services       DependenciesDefine manifests     Configuration                      Applications
AMI              SNAPSHOTTemplate   CloudFormation
AMI          m1.large                              AMI              SNAPSHOT      SNAPSHOT                              10...
Services                AMI          m1.large                              AMI       Dependencies                         ...
1. Setup users and groups2. Install Apache3. Configure Apache4. Setup directories5. Start ancillary services6. Deploy code
Management  server
Pull
AMISNAPSHOT   m1.large    m1.large    m1.large           100Gb        100Gb      100Gb                      Management    ...
Push
m1.large    m1.large    m1.large100Gb        100Gb      100Gb           Management             server
Fewer AMIs to   manage
Versionedconfiguration
Codified updates
Known state
Rolling updates
Simulations
Built for elastic architectures
Loose coupling
Address via meta-data
And much more!
:(Extra overhead
Chef+ Knife
Puppet+ MCollective
T   H   I   R   D   P   I   L   L   A   RPerformance automation
Auto-scaling
ELBCloudWatch Auto-scaling
Scaling group
DatabaseConnections                DatabaseConnectionsScaling group             Triggers                  (Alarms + Polici...
Launchconfigurations                       DatabaseConnections                       DatabaseConnections       Scaling grou...
Additionalperformance
Launchconfigurations                       DatabaseConnections                       DatabaseConnections       Scaling grou...
Launchconfigurations                       DatabaseConnections                       DatabaseConnections       Scaling grou...
Launchconfigurations                       DatabaseConnections                       DatabaseConnections       Scaling grou...
Launchconfigurations                       DatabaseConnections                       DatabaseConnections       Scaling grou...
Auto-healing
4Orchestrationby Example
Web application Web application
Initialisation with CloudFormation
Design stack
Load balancerFault tolerantweb serversRDS
Create template
{    "AWSTemplateFormatVersion" : "2010-09-09",    "Parameters" : {                                                       ...
"Parameters" : {   "InstanceType" : {      "Description" : "Type of EC2 instance to launch",      "Type" : "String",      ...
"Mappings" : {   "AWSInstanceType2Arch" : {      "t1.micro"    : { "Arch" : "64" },      "m1.small"    : { "Arch" : "32" }...
"Resources" : {  "WebServerGroup" : {    "Type" : "AWS::AutoScaling::AutoScalingGroup",    "Properties" : {      "Availabi...
"SampleDatabase": {       "Properties": {          "Engine": "MySQL5.1",          "DBName": {             "Ref": "RailData...
"LaunchConfig" : {      "Type" : "AWS::AutoScaling::LaunchConfiguration",      "Properties" : {        "KeyName" : { "Ref"...
"UserData": {                "Fn::Base64": {                  "Fn::Join": [                    ":",                    [  ...
"ElasticLoadBalancer" : {       "Type" : "AWS::ElasticLoadBalancing::LoadBalancer",       "Properties" : {         "Availa...
"DBSecurityGroup": {     "Properties": {        "DBSecurityGroupIngress": {           "EC2SecurityGroupName": {           ...
"Outputs" : {    "URL" : {      "Description" : "URL of the website",      "Value" : { "Fn::Join" : [ "", [ "http://",{ "F...
Create stack
DatabasePortDatabaseUserDatabaseName
Example application
Example application
Example applicationApplicationStackELB URL            URL of website                         165783690.eu-.west-1.elb.
Steady statemonitoring with CloudWatch
Updatewith CloudFormation
Updatewith Puppet
Define manifest Resource lists, dependencies
define apache::site ( $ensure = present, $require_package= apache, $content = , $source = ) { include apache   $site_file ...
define apache::site ( $ensure = present, $require_package= apache, $content = , $source = ) { include apache   $site_file ...
define apache::site ( $ensure = present, $require_package= apache, $content = , $source = ) { include apache   $site_file ...
Apply manifest        puppet apply,Pull/push from the Puppet Master
Performance automation with EC2 autoscaling
as-create-launch-config     AppLaunchConfig     --image-id ami-132216677     --instance-type m1.large     --key amazon-web...
as-create-auto-scaling-group AppScalingGroup --launch-configuration AppLaunchConfig --availability-zones eu-west-1a, eu-we...
as-put-scaling-policy AppScaleUpPolicy --auto-scaling-group AppScalingGroup --scaling-adjustment 1 --type ChangeInCapacity...
mon-put-metric-alarm AppHighCPUAlarm --comparison-operator GreaterThanThreshold --evaluation-period 1 --metric-name CPUUti...
as-put-scaling-policy AppScaleDownPolicy --auto-scaling-group AppScalingGroup --scaling-adjustment -1 --type ChangeInCapac...
mon-put-metric-alarm AppLowCPUAlarm --comparison-operator LessThanThreshold --evaluation-period 1 --metric-name CPUUtiliza...
aws.amazon.com/cloudformation       puppetlabs.com      opscode.com/chef aws.amazon.com/whitepapers
AGENDA     Orchestrating the Cloud1. Ap   plication architecture2. Role of orchestration3 . Pillars of orchestration4. Orc...
3 tiers of cloudapplication design
Maximising the value    in each tier
Orchestrationcodifies knowledge
Three pillars of orchestration
Provisioningorchestration
Configurationmanagement
Performance automation
CloudFormation
Puppet, Chef
Autoscaling service
aws.amazon.com
Thank you!
Q U E S T I O N S     +     C O M M E N T Smatthew@amazon.com              @mza              O N   T W I T T E R
Orchestrating the Cloud
Orchestrating the Cloud
Orchestrating the Cloud
Upcoming SlideShare
Loading in...5
×

Orchestrating the Cloud

17,424

Published on

An overview of cloud orchestration techniques, tips and best practices, featuring CloudFormation, Puppet and Chef.

Published in: Technology
4 Comments
52 Likes
Statistics
Notes
No Downloads
Views
Total Views
17,424
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
1,023
Comments
4
Likes
52
Embeds 0
No embeds

No notes for slide
  • Good morning, my name is X, I'm Y for Amazon Web Services, based in Singapore.\nToday we will talk about Cloud Computing, and explain to you why it's important to know about it.\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Orchestrating the Cloud

    1. 1. Orchestrating the Cloud Matt Wood T E C H N O L O G Y E VA N G E L I S T
    2. 2. Welcome
    3. 3. AGENDA Orchestrating the Cloud1. Ap plication architecture2. Role of orchestration3 . Pillars of orchestration4. Orche stration by example5. Summar y
    4. 4. 1ApplicationArchitecture
    5. 5. Applicationsin the cloud
    6. 6. 3 tiers
    7. 7. Application tierCode Configuration
    8. 8. Application tierCode Configuration
    9. 9. Application tier Code Configuration Service tier Integration Operating system settings Services +Launch configuration configuration
    10. 10. Application tier Code Configuration Service tier Integration Operating system settings Services +Launch configuration configuration
    11. 11. Application tier Code Configuration Service tier Integration Operating system settings Services +Launch configuration configuration Infrastructure tier AMIs Architecture Multi-AZScaling rules Security groups Middleware
    12. 12. Value baked into each tier
    13. 13. Value inapplication
    14. 14. Value inservice tier
    15. 15. Optimisation Configuration Value in service tier Technology choices
    16. 16. Value ininfrastructure
    17. 17. Engine room Optimised Value in infrastructure Scalable Fault tolerant
    18. 18. Maximising Orchestrationmaximises this value value
    19. 19. EphemeralMaximising to value concrete
    20. 20. One team Maximising to valuewhole organisation
    21. 21. One hitMaximising to value reproducible
    22. 22. MaximisingBrittle to strong value
    23. 23. MaximisingMaximise value value
    24. 24. Maximising Minimise risk value
    25. 25. 2 Role ofOrchestration
    26. 26. Cloud life cycle
    27. 27. Initialisation
    28. 28. Steady state run time
    29. 29. Updates
    30. 30. Application updatesUpdates Service updates
    31. 31. Scale events
    32. 32. Changemanagement
    33. 33. Ver y me t a ! Managing change management
    34. 34. 3 Pillars ofOrchestration
    35. 35. Z E R O T H P I L L A RVersion control
    36. 36. F I R S T P I L L A RProvisioningorchestration
    37. 37. CloudFormation aws.amazon.com/cloudformation
    38. 38. Template
    39. 39. Define a fullinfrastructure stack
    40. 40. Auto-scaling RDS EC2 SNS SimpleDB SQS ResourcesElastic Beanstalk CloudWatch Security groups Tags
    41. 41. Template CloudFormation Provisioned resources
    42. 42. Completedefinition
    43. 43. Atomic
    44. 44. Idempotent
    45. 45. Free
    46. 46. Anatomy of a template
    47. 47. JSON
    48. 48. Perfect forPlain text version control JSON Validate-able
    49. 49. Declarative language
    50. 50. { "AWSTemplateFormatVersion" : "2010-09-09", "Description" : "Create an EC2 instances", "Parameters" : { "KeyName" : { "Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instance", "Type" : "String" } }, "Mappings" : { "RegionMap" : { "us-east-1" : { "AMI" : "ami-76f0061f" }, "us-west-1" : { "AMI" : "ami-655a0a20" }, "eu-west-1" : { "AMI" : "ami-7fd4e10b" }, "ap-southeast-1" : { "AMI" : "ami-72621c20" }, "ap-northeast-1" : { "AMI" : "ami-8e08a38f" } } }, "Resources" : { "Ec2Instance" : { "Type" : "AWS::EC2::Instance", "Properties" : { "KeyName" : { "Ref" : "KeyName" }, "ImageId" : { "Fn::FindInMap" : [ "RegionMap", { "Ref" : "AWS::Region" }, "AMI" ]}, "UserData" : { "Fn::Base64" : "80" } } } }, "Outputs" : { "InstanceId" : { "Description" : "InstanceId of the newly created EC2 instance", "Value" : { "Ref" : "Ec2Instance" } }, "AZ" : { "Description" : "Availability Zone of the newly created EC2 instance", "Value" : { "Fn::GetAtt" : [ "Ec2Instance", "AvailabilityZone" ] } }, "PublicIP" : { "Description" : "Public IP address of the newly created EC2 instance", "Value" : { "Fn::GetAtt" : [ "Ec2Instance", "PublicIp" ] } } }}
    51. 51. { "AWSTemplateFormatVersion" : "2010-09-09", "Description" : "Create an EC2 instances", Headers Parameters "Parameters" : { "KeyName" : { "Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instance", "Type" : "String" } }, "Mappings" : { "RegionMap" : { "us-east-1" : { "AMI" : "ami-76f0061f" }, "us-west-1" : { Mappings "AMI" : "ami-655a0a20" }, "eu-west-1" : { "AMI" : "ami-7fd4e10b" }, "ap-southeast-1" : { "AMI" : "ami-72621c20" }, "ap-northeast-1" : { "AMI" : "ami-8e08a38f" } } }, "Resources" : { "Ec2Instance" : { "Type" : "AWS::EC2::Instance", Resources "Properties" : { "KeyName" : { "Ref" : "KeyName" }, "ImageId" : { "Fn::FindInMap" : [ "RegionMap", { "Ref" : "AWS::Region" }, "AMI" ]}, "UserData" : { "Fn::Base64" : "80" } } } }, "Outputs" : { "InstanceId" : { "Description" : "InstanceId of the newly created EC2 instance", "Value" : { "Ref" : "Ec2Instance" } }, Outputs "AZ" : { "Description" : "Availability Zone of the newly created EC2 instance", "Value" : { "Fn::GetAtt" : [ "Ec2Instance", "AvailabilityZone" ] } }, "PublicIP" : { "Description" : "Public IP address of the newly created EC2 instance", "Value" : { "Fn::GetAtt" : [ "Ec2Instance", "PublicIp" ] } } }}
    52. 52. ParametersProvision-time specification Command line options
    53. 53. "Parameters" : { "KeyName" : { "Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instance", "Type" : "String" }},
    54. 54. Mappings Conditionals Case statements
    55. 55. "Mappings" : { "RegionMap" : { "us-east-1" : { "AMI" : "ami-76f0061f" }, "us-west-1" : { "AMI" : "ami-655a0a20" }, "eu-west-1" : { "AMI" : "ami-7fd4e10b" }, "ap-southeast-1" : { "AMI" : "ami-72621c20" }, "ap-northeast-1" : { "AMI" : "ami-8e08a38f" } }},
    56. 56. "Mappings": { "AWSInstanceType2Arch" : { "t1.micro" : { "Arch" : "64" }, "m1.large" : { "Arch" : "64" }, "m1.xlarge" : { "Arch" : "64" }, "m2.xlarge" : { "Arch" : "64" }, "m2.2xlarge" : { "Arch" : "64" }, "m2.4xlarge" : { "Arch" : "64" }, "c1.xlarge" : { "Arch" : "64" }, "cc1.4xlarge" : { "Arch" : "64" } },
    57. 57. Resources
    58. 58. "Resources" : { "Ec2Instance" : { "Type" : "AWS::EC2::Instance", "Properties" : { "KeyName" : { "Ref" : "KeyName" }, "ImageId" : { "Fn::FindInMap" :[ "RegionMap", { "Ref" : "AWS::Region" },"AMI" ]}, "UserData" : { "Fn::Base64" : "80" } } } }
    59. 59. "Resources" : { "Ec2Instance" : { "Type" : "AWS::EC2::Instance", "Properties" : { "KeyName" : { "Ref" : "KeyName" }, "ImageId" : { "Fn::FindInMap" :[ "RegionMap", { "Ref" : "AWS::Region" },"AMI" ]}, "UserData" : { "Fn::Base64" : "80" } } } }
    60. 60. "Resources" : { "Ec2Instance" : { "Type" : "AWS::EC2::Instance", "Properties" : { "KeyName" : { "Ref" : "KeyName" }, "ImageId" : { "Fn::FindInMap" :[ "RegionMap", { "Ref" : "AWS::Region" },"AMI" ]}, "UserData" : { "Fn::Base64" : "80" } } } }
    61. 61. "KeyName" : { "Ref" : "KeyName" }, Par ame ter re fere nce
    62. 62. "ImageId" : { "Fn::FindInMap" : [ "RegionMap", { "Ref" : "AWS::Region" }, "AMI" ]},
    63. 63. M ap c ondit ional"ImageId" : { "Fn::FindInMap" : [ "RegionMap", { "Ref" : "AWS::Region" }, "AMI" ]},
    64. 64. "ImageId" : { "Fn::FindInMap" : [ "RegionMap", { "Ref" : "AWS::Region" }, "AMI" ]}, Nam e of map
    65. 65. "ImageId" : { "Fn::FindInMap" : [ "RegionMap", { "Ref" : "AWS::Region" }, "AMI" ]}, Intrinsic property reference
    66. 66. OutputsReturned values
    67. 67. "Outputs" : { "InstanceId" : { "Description" : "InstanceId of the newly created EC2 instance", "Value" : { "Ref" : "Ec2Instance" } }, "AZ" : { "Description" : "Availability Zone of the newly created EC2 instance", "Value" : { "Fn::GetAtt" : [ "Ec2Instance", "AvailabilityZone" ] } }, "PublicIP" : { "Description" : "Public IP address of the newly created EC2 instance", "Value" : { "Fn::GetAtt" : [ "Ec2Instance", "PublicIp" ] } } }}
    68. 68. Deliver via API
    69. 69. Validate via API
    70. 70. Deliver via S3
    71. 71. Growing library
    72. 72. S E C O N D P I L L A RConfigurationmanagement
    73. 73. Custom AMI
    74. 74. m1.large100Gb
    75. 75. Template m1.large AMI AMISNAPSHOT 100Gb SNAPSHOT
    76. 76. m1.large AMI m1.largeSNAPSHOT 100Gb 100Gb
    77. 77. m1.large m1.large m1.large m1.large100Gb 100Gb 100Gb 100Gbm1.large m1.large m1.large m1.large100Gb 100Gb 100Gb 100Gb
    78. 78. Bootstrap
    79. 79. Generic AMI
    80. 80. Custom build
    81. 81. Services DependenciesDefine manifests Configuration Applications
    82. 82. AMI SNAPSHOTTemplate CloudFormation
    83. 83. AMI m1.large AMI SNAPSHOT SNAPSHOT 100GbTemplate CloudFormation
    84. 84. Services AMI m1.large AMI Dependencies Applications Configration SNAPSHOT SNAPSHOT 100GbTemplate CloudFormation
    85. 85. 1. Setup users and groups2. Install Apache3. Configure Apache4. Setup directories5. Start ancillary services6. Deploy code
    86. 86. Management server
    87. 87. Pull
    88. 88. AMISNAPSHOT m1.large m1.large m1.large 100Gb 100Gb 100Gb Management server
    89. 89. Push
    90. 90. m1.large m1.large m1.large100Gb 100Gb 100Gb Management server
    91. 91. Fewer AMIs to manage
    92. 92. Versionedconfiguration
    93. 93. Codified updates
    94. 94. Known state
    95. 95. Rolling updates
    96. 96. Simulations
    97. 97. Built for elastic architectures
    98. 98. Loose coupling
    99. 99. Address via meta-data
    100. 100. And much more!
    101. 101. :(Extra overhead
    102. 102. Chef+ Knife
    103. 103. Puppet+ MCollective
    104. 104. T H I R D P I L L A RPerformance automation
    105. 105. Auto-scaling
    106. 106. ELBCloudWatch Auto-scaling
    107. 107. Scaling group
    108. 108. DatabaseConnections DatabaseConnectionsScaling group Triggers (Alarms + Policies)
    109. 109. Launchconfigurations DatabaseConnections DatabaseConnections Scaling group Triggers (Alarms + Policies)
    110. 110. Additionalperformance
    111. 111. Launchconfigurations DatabaseConnections DatabaseConnections Scaling group Triggers (Alarms + Policies)
    112. 112. Launchconfigurations DatabaseConnections DatabaseConnections Scaling group Triggers (Alarms + Policies)
    113. 113. Launchconfigurations DatabaseConnections DatabaseConnections Scaling group Triggers (Alarms + Policies)
    114. 114. Launchconfigurations DatabaseConnections DatabaseConnections Scaling group Triggers (Alarms + Policies)
    115. 115. Auto-healing
    116. 116. 4Orchestrationby Example
    117. 117. Web application Web application
    118. 118. Initialisation with CloudFormation
    119. 119. Design stack
    120. 120. Load balancerFault tolerantweb serversRDS
    121. 121. Create template
    122. 122. { "AWSTemplateFormatVersion" : "2010-09-09", "Parameters" : { Parameters "InstanceType" : { "Description" : "Type of EC2 instance to launch", "Type" : "String", "Default" : "m1.small" }, "WebServerPort" : { "Description" : "TCP/IP port of the web server", "Type" : "String", "Default" : "8888" }, "KeyName" : { "Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instances", "Type" : "String" } }, "Mappings" : { "AWSInstanceType2Arch" : { "t1.micro" : { "Arch" : "64" }, "m1.small" : { "Arch" : "32" }, "m1.large" : { "Arch" : "64" }, "m1.xlarge" : { "Arch" : "64" }, "m2.xlarge" : { "Arch" : "64" }, Mappings "m2.2xlarge" : { "Arch" : "64" }, "m2.4xlarge" : { "Arch" : "64" }, "c1.medium" : { "Arch" : "32" }, "c1.xlarge" : { "Arch" : "64" }, "cc1.4xlarge" : { "Arch" : "64" } }, "AWSRegionArch2AMI" : { "us-east-1" : { "32" : "ami-6411e20d", "64" : "ami-7a11e213" }, "us-west-1" : { "32" : "ami-c9c7978c", "64" : "ami-cfc7978a" }, "eu-west-1" : { "32" : "ami-37c2f643", "64" : "ami-31c2f645" }, "ap-southeast-1" : { "32" : "ami-66f28c34", "64" : "ami-60f28c32" }, "ap-northeast-1" : { "32" : "ami-9c03a89d", "64" : "ami-a003a8a1" } } }, "Resources" : { "WebServerGroup" : { "Type" : "AWS::AutoScaling::AutoScalingGroup", "Properties" : { "AvailabilityZones" : { "Fn::GetAZs" : "" }, "LaunchConfigurationName" : { "Ref" : "LaunchConfig" }, "MinSize" : "2", "MaxSize" : "2", "LoadBalancerNames" : [ { "Ref" : "ElasticLoadBalancer" } ] } }, "LaunchConfig" : { "Type" : "AWS::AutoScaling::LaunchConfiguration", "Properties" : { "KeyName" : { "Ref" : "KeyName" }, "ImageId" : { "Fn::FindInMap" : [ "AWSRegionArch2AMI", { "Ref" : "AWS::Region" }, { "Fn::FindInMap" : [ "AWSInstanceType2Arch", { "Ref" : "InstanceType" }, "Arch" ] } ] }, "UserData" : { "Fn::Base64" : { "Ref" : "WebServerPort" }}, "SecurityGroups" : [ { "Ref" : "InstanceSecurityGroup" } ], "InstanceType" : { "Ref" : "InstanceType" } } }, Resources "ElasticLoadBalancer" : { "Type" : "AWS::ElasticLoadBalancing::LoadBalancer", "Properties" : { "AvailabilityZones" : { "Fn::GetAZs" : "" }, "Listeners" : [ { "LoadBalancerPort" : "80", "InstancePort" : { "Ref" : "WebServerPort" }, "Protocol" : "HTTP" } ], "HealthCheck" : { "Target" : { "Fn::Join" : [ "", ["HTTP:", { "Ref" : "WebServerPort" }, "/"]]}, "HealthyThreshold" : "3", "UnhealthyThreshold" : "5", "Interval" : "30", "Timeout" : "5" } } }, "InstanceSecurityGroup" : { "Type" : "AWS::EC2::SecurityGroup", "Properties" : { "GroupDescription" : "Enable SSH access and HTTP access on the inbound port", "SecurityGroupIngress" : [ { "IpProtocol" : "tcp", "FromPort" : "22", "ToPort" : "22", "CidrIp" : "0.0.0.0/0" }, { "IpProtocol" : "tcp", "FromPort" : { "Ref" : "WebServerPort" }, "ToPort" : { "Ref" : "WebServerPort" }, "CidrIp" : "0.0.0.0/0" } ] } } Outputs }, "Outputs" : { "URL" : { "Description" : "URL of the website", "Value" : { "Fn::Join" : [ "", [ "http://", { "Fn::GetAtt" : [ "ElasticLoadBalancer", "DNSName" ]}]]} } }}
    123. 123. "Parameters" : { "InstanceType" : { "Description" : "Type of EC2 instance to launch", "Type" : "String", "Default" : "m1.small" }, "WebServerPort" : { "Description" : "TCP/IP port of the web server", "Type" : "String", "Default" : "8888" }, "DatabaseName": { "Default": "SampleDatabase", "Description" : "Name of the sample database", "Type": "String" }, "DatabaseUser": { "Default": "admin", "NoEcho": "true", "Description" : "Sample database admin account username", "Type": "String" }, "DatabasePwd": { "Default": "admin", "NoEcho": "true", "Description" : "Sample database admin account password", "Type": "String" }, "DatabasePort": { "Default": "8443", "Description" : "TCP/IP port for the RDS database", "Type": "String" }, "KeyName" : { "Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instances", "Type" : "String" }},
    124. 124. "Mappings" : { "AWSInstanceType2Arch" : { "t1.micro" : { "Arch" : "64" }, "m1.small" : { "Arch" : "32" }, "m1.large" : { "Arch" : "64" }, "m1.xlarge" : { "Arch" : "64" }, "m2.xlarge" : { "Arch" : "64" }, "m2.2xlarge" : { "Arch" : "64" }, "m2.4xlarge" : { "Arch" : "64" }, "c1.medium" : { "Arch" : "32" }, "c1.xlarge" : { "Arch" : "64" }, "cc1.4xlarge" : { "Arch" : "64" } }, "AWSRegionArch2AMI" : { "us-east-1" : { "32" : "ami-6411e20d", "64" : "ami-7a11e213" }, "us-west-1" : { "32" : "ami-c9c7978c", "64" : "ami-cfc7978a" }, "eu-west-1" : { "32" : "ami-37c2f643", "64" : "ami-31c2f645" }, "ap-southeast-1" : { "32" : "ami-66f28c34", "64" : "ami-60f28c32" }, "ap-northeast-1" : { "32" : "ami-9c03a89d", "64" : "ami-a003a8a1" } }},
    125. 125. "Resources" : { "WebServerGroup" : { "Type" : "AWS::AutoScaling::AutoScalingGroup", "Properties" : { "AvailabilityZones" : { "Fn::GetAZs" : "" }, "LaunchConfigurationName" : { "Ref" : "LaunchConfig" }, "MinSize" : "3", "MaxSize" : "3", "LoadBalancerNames" : [ { "Ref" : "ElasticLoadBalancer" } ] } },
    126. 126. "SampleDatabase": { "Properties": { "Engine": "MySQL5.1", "DBName": { "Ref": "RailDatabaseName" }, "Port": "8443", "MultiAZ" : { "Fn::FindInMap" : [ "AWSRegionCapabilities",{ "Ref" : "AWS::Region" }, "RDSMultiAZ"] }, "MasterUsername": { "Ref": "DatabaseUser" }, "DBInstanceClass": "db.m1.small", "DBSecurityGroups": [ { "Ref": "DBSecurityGroup" } ], "AllocatedStorage": "5", "MasterUserPassword": { "Ref": "DatabasePwd" } }, "Type": "AWS::RDS::DBInstance" },
    127. 127. "LaunchConfig" : { "Type" : "AWS::AutoScaling::LaunchConfiguration", "Properties" : { "KeyName" : { "Ref" : "KeyName" }, "ImageId" : { "Fn::FindInMap" :[ "AWSRegionArch2AMI", { "Ref" : "AWS::Region" },{ "Fn::FindInMap" : [ "AWSInstanceType2Arch", { "Ref" :"InstanceType" }, "Arch" ] } ] }, "SecurityGroups" : [ { "Ref" :"InstanceSecurityGroup" } ], "InstanceType" : { "Ref" : "InstanceType" } } },
    128. 128. "UserData": { "Fn::Base64": { "Fn::Join": [ ":", [ { "Ref": "DatabaseName" }, { "Ref": "DatabaseUser" }, { "Ref": "DatabasePwd" }, { "Ref": "DatabasePort" }, { "Fn::GetAtt": [ "SampleDatabase", "Endpoint.Address" ] }, { "Ref": "WebServerPort" } ] ] }
    129. 129. "ElasticLoadBalancer" : { "Type" : "AWS::ElasticLoadBalancing::LoadBalancer", "Properties" : { "AvailabilityZones" : { "Fn::GetAZs" : "" }, "Listeners" : [ { "LoadBalancerPort" : "80", "InstancePort" : { "Ref" : "WebServerPort" }, "Protocol" : "HTTP" } ], "HealthCheck" : { "Target" : { "Fn::Join" : [ "", ["HTTP:", { "Ref" :"WebServerPort" }, "/"]]}, "HealthyThreshold" : "3", "UnhealthyThreshold" : "5", "Interval" : "30", "Timeout" : "5" } } },
    130. 130. "DBSecurityGroup": { "Properties": { "DBSecurityGroupIngress": { "EC2SecurityGroupName": { "Ref": "EC2SecurityGroup" } }, "GroupDescription": "database access" }, "Type": "AWS::RDS::DBSecurityGroup" }, "InstanceSecurityGroup" : { "Type" : "AWS::EC2::SecurityGroup", "Properties" : { "GroupDescription" : "Enable SSH access and HTTP access on the inbound port", "SecurityGroupIngress" : [ { "IpProtocol" : "tcp", "FromPort" : "22", "ToPort" : "22", "CidrIp" : "0.0.0.0/0" }, { "IpProtocol" : "tcp", "FromPort" : { "Ref" : "WebServerPort" }, "ToPort" : { "Ref" : "WebServerPort" }, "CidrIp" : "0.0.0.0/0" } ] } }},
    131. 131. "Outputs" : { "URL" : { "Description" : "URL of the website", "Value" : { "Fn::Join" : [ "", [ "http://",{ "Fn::GetAtt" : [ "ElasticLoadBalancer", "DNSName" ]}]]} } }
    132. 132. Create stack
    133. 133. DatabasePortDatabaseUserDatabaseName
    134. 134. Example application
    135. 135. Example application
    136. 136. Example applicationApplicationStackELB URL URL of website 165783690.eu-.west-1.elb.
    137. 137. Steady statemonitoring with CloudWatch
    138. 138. Updatewith CloudFormation
    139. 139. Updatewith Puppet
    140. 140. Define manifest Resource lists, dependencies
    141. 141. define apache::site ( $ensure = present, $require_package= apache, $content = , $source = ) { include apache $site_file = "${module_dir_path}/apache/sites/${name}" config_file { $site_file: ensure => $ensure, content => $content, source => $source, notify => Exec["reload-apache"] }}
    142. 142. define apache::site ( $ensure = present, $require_package= apache, $content = , $source = ) { include apache $site_file = "${module_dir_path}/apache/sites/${name}" config_file { $site_file: ensure => $ensure, content => $content, source => $source, notify => Exec["reload-apache"] }}
    143. 143. define apache::site ( $ensure = present, $require_package= apache, $content = , $source = ) { include apache $site_file = "${module_dir_path}/apache/sites/${name}" config_file { $site_file: ensure => $ensure, content => $content, source => $source, notify => Exec["reload-apache"] }}
    144. 144. Apply manifest puppet apply,Pull/push from the Puppet Master
    145. 145. Performance automation with EC2 autoscaling
    146. 146. as-create-launch-config AppLaunchConfig --image-id ami-132216677 --instance-type m1.large --key amazon-web --group "Web and SSH"
    147. 147. as-create-auto-scaling-group AppScalingGroup --launch-configuration AppLaunchConfig --availability-zones eu-west-1a, eu-west-1b --min-size 10 --max-size 100 --load-balancers app-load-balancer
    148. 148. as-put-scaling-policy AppScaleUpPolicy --auto-scaling-group AppScalingGroup --scaling-adjustment 1 --type ChangeInCapacity --cool-down 300
    149. 149. mon-put-metric-alarm AppHighCPUAlarm --comparison-operator GreaterThanThreshold --evaluation-period 1 --metric-name CPUUtilization --namespace “AWS:EC2” --period 600 --statistic Average --threshold 80 --alarm-actions <high-cpu-policy-arn> --dimensions “AutoscalingGroupName=AppScalingGroup”
    150. 150. as-put-scaling-policy AppScaleDownPolicy --auto-scaling-group AppScalingGroup --scaling-adjustment -1 --type ChangeInCapacity --cool-down 300
    151. 151. mon-put-metric-alarm AppLowCPUAlarm --comparison-operator LessThanThreshold --evaluation-period 1 --metric-name CPUUtilization --namespace “AWS:EC2” --period 600 --statistic Average --threshold 80 --alarm-actions <low-cpu-policy-arn> --dimensions “AutoscalingGroupName=AppScalingGroup”
    152. 152. aws.amazon.com/cloudformation puppetlabs.com opscode.com/chef aws.amazon.com/whitepapers
    153. 153. AGENDA Orchestrating the Cloud1. Ap plication architecture2. Role of orchestration3 . Pillars of orchestration4. Orche stration by example5. Summar y
    154. 154. 3 tiers of cloudapplication design
    155. 155. Maximising the value in each tier
    156. 156. Orchestrationcodifies knowledge
    157. 157. Three pillars of orchestration
    158. 158. Provisioningorchestration
    159. 159. Configurationmanagement
    160. 160. Performance automation
    161. 161. CloudFormation
    162. 162. Puppet, Chef
    163. 163. Autoscaling service
    164. 164. aws.amazon.com
    165. 165. Thank you!
    166. 166. Q U E S T I O N S + C O M M E N T Smatthew@amazon.com @mza O N T W I T T E R
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×