Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
2014 
presented by 
Puppetizing 
Multi-Tier 
Architecture 
Reid Vandewiele 
Solutions Engineer | Puppet Labs
Monolithic Install Split Install
Monolithic Install Split Install
Agenda 
• Introduction 
Multi-Tier Challenges 
• How to Define 
• How to Classify 
• How to Deploy
Multi-Tier Challenges 
• How to Define 
• How to Classify 
• How to Deploy
Profiles
class 
puppet_enterprise 
( 
$interface, 
... 
) 
{ 
## 
REPRESENT 
THIS 
# 
# 
# 
# 
# 
# 
# 
# 
# 
# 
}
Application Classes 
class 
pe 
( 
$puppetdb_port 
= 
8081, 
... 
) 
{ 
} 
class 
pe::puppet_master 
( 
$puppetdb_port 
= ...
Application Class 
class 
pe 
( 
$puppet_master_host 
= 
undef, 
$puppet_master_port 
= 
undef, 
$puppet_console_host 
= 
...
Application Component Profile 
class 
pe::puppet_master 
( 
$certificate_authority_host 
= 
$pe::certificate_authority_hos...
Accomplished 
• Model the Application 
Not Yet Accomplished 
• Dynamism / Elasticity
?
Pool_member 
<<| 
filter 
|>> 
pool_member 
{ 
'master_1': 
} 
pool_member 
{ 
'master_2': 
} 
@@pool_member 
{ 
'master_1...
storeconfigs 
class 
pe::load_balancer 
( 
... 
) 
inherits 
pe 
{ 
Pool_member 
<<| 
filter 
|>> 
... 
} 
class 
pe::pupp...
clientcert=www1 
app_pubkey= 
ensure keypair! 
clientcert=www1 
app_pubkey=abc123 
ensure keypair!
Multi-Tier Challenges 
• How to Define 
• How to Classify 
• How to Deploy
Set 
A 
collec+on 
of 
"things" 
(objects 
or 
numbers, 
etc). 
Each 
member 
is 
called 
an 
element 
of 
the 
set. 
Ther...
Evaluation Order Matters 
• Works 
class 
{ 
'pe': 
instance_id 
=> 
'central'; 
} 
class 
{ 
'pe::puppet_master': 
} 
• B...
Hiera 
-­‐-­‐-­‐ 
:hierarchy: 
-­‐ 
"clientcert/%{clientcert}" 
-­‐ 
"app_instance/%{app_instance}" 
-­‐ 
"env_tier/%{env_...
Hiera 
All 
Managed 
Nodes 
env_tier=development 
env_tier=production 
appid=dev1 
appid=dev2 
appid=prod1 
appid=prod2
Application Class 
class 
pe 
( 
$puppet_master_host 
= 
undef, 
$puppet_master_port 
= 
undef, 
$puppet_console_host 
= 
...
Application Class 
class 
pe 
( 
$puppet_master_host 
= 
$::puppet_master_host 
, 
$puppet_master_port 
= 
$::puppet_maste...
Multi-Tier Challenges 
• How to Define 
• How to Classify 
• How to Deploy
1 2 Run Puppet! 
Run Puppet!
Run Puppet! 
Run Puppet! 
Run Puppet! 
Run Puppet! 
1 2 3 4
Puppetizing Multi-Tier Architecture 
Multi-Tier Challenges 
• How to Define 
• How to Classify 
• How to Deploy
Anchors 
class 
pe 
( 
... 
) 
{ 
# 
ANCHORS 
# 
When 
building 
a 
complex 
multi-­‐tier 
model, 
it 
is 
not 
known 
up ...
Puppetizing Multi-Tier Architecture 
• Model the app as a class 
– Most important consideration is the interface 
• Assign...
Questions?
Puppetizing Multitier Architecture - PuppetConf 2014
Puppetizing Multitier Architecture - PuppetConf 2014
Puppetizing Multitier Architecture - PuppetConf 2014
Puppetizing Multitier Architecture - PuppetConf 2014
Puppetizing Multitier Architecture - PuppetConf 2014
Puppetizing Multitier Architecture - PuppetConf 2014
Puppetizing Multitier Architecture - PuppetConf 2014
Puppetizing Multitier Architecture - PuppetConf 2014
Puppetizing Multitier Architecture - PuppetConf 2014
Puppetizing Multitier Architecture - PuppetConf 2014
Puppetizing Multitier Architecture - PuppetConf 2014
Puppetizing Multitier Architecture - PuppetConf 2014
Puppetizing Multitier Architecture - PuppetConf 2014
Puppetizing Multitier Architecture - PuppetConf 2014
Puppetizing Multitier Architecture - PuppetConf 2014
Puppetizing Multitier Architecture - PuppetConf 2014
Puppetizing Multitier Architecture - PuppetConf 2014
Puppetizing Multitier Architecture - PuppetConf 2014
Upcoming SlideShare
Loading in …5
×

Puppetizing Multitier Architecture - PuppetConf 2014

1,866 views

Published on

Puppetizing Multitier Architecture - Reid Vandewiele, Puppet Labs

Published in: Technology
  • Be the first to comment

Puppetizing Multitier Architecture - PuppetConf 2014

  1. 1. 2014 presented by Puppetizing Multi-Tier Architecture Reid Vandewiele Solutions Engineer | Puppet Labs
  2. 2. Monolithic Install Split Install
  3. 3. Monolithic Install Split Install
  4. 4. Agenda • Introduction Multi-Tier Challenges • How to Define • How to Classify • How to Deploy
  5. 5. Multi-Tier Challenges • How to Define • How to Classify • How to Deploy
  6. 6. Profiles
  7. 7. class puppet_enterprise ( $interface, ... ) { ## REPRESENT THIS # # # # # # # # # # }
  8. 8. Application Classes class pe ( $puppetdb_port = 8081, ... ) { } class pe::puppet_master ( $puppetdb_port = $pe::puppetdb_host, ... ) inherits pe { ... } class pe::puppetdb ( $puppetdb_port = $pe::puppetdb_host, ... ) inherits pe { ... }
  9. 9. Application Class class pe ( $puppet_master_host = undef, $puppet_master_port = undef, $puppet_console_host = undef, $puppet_console_port = undef, $puppetdb_database_host = undef, $puppetdb_database_port = undef, $puppetdb_database_name = undef, $puppetdb_database_username = undef, $puppetdb_database_password = undef, ... ) { ...
  10. 10. Application Component Profile class pe::puppet_master ( $certificate_authority_host = $pe::certificate_authority_host, $certificate_authority_port = $pe::certificate_authority_port, $certificate_authority_proxy = true, $puppetdb_host = $pe::puppetdb_host, $puppetdb_port = $pe::puppetdb_port, $console_host = $pe::puppet_console_host, $console_port = $pe::puppet_console_port $reports = undef, $node_terminus = undef, ) inherits pe { ...
  11. 11. Accomplished • Model the Application Not Yet Accomplished • Dynamism / Elasticity
  12. 12. ?
  13. 13. Pool_member <<| filter |>> pool_member { 'master_1': } pool_member { 'master_2': } @@pool_member { 'master_1': } @@pool_member{ 'master_2': } storeconfigs
  14. 14. storeconfigs class pe::load_balancer ( ... ) inherits pe { Pool_member <<| filter |>> ... } class pe::puppet_master ( ... ) inherits pe { @@pool_member { $::ipaddress: } ... }
  15. 15. clientcert=www1 app_pubkey= ensure keypair! clientcert=www1 app_pubkey=abc123 ensure keypair!
  16. 16. Multi-Tier Challenges • How to Define • How to Classify • How to Deploy
  17. 17. Set A collec+on of "things" (objects or numbers, etc). Each member is called an element of the set. There should be only one of each member (all members are unique).
  18. 18. Evaluation Order Matters • Works class { 'pe': instance_id => 'central'; } class { 'pe::puppet_master': } • Breaks class { 'pe::puppet_master': } class { 'pe': instance_id => 'central'; }
  19. 19. Hiera -­‐-­‐-­‐ :hierarchy: -­‐ "clientcert/%{clientcert}" -­‐ "app_instance/%{app_instance}" -­‐ "env_tier/%{env_tier}" -­‐ global :backends: -­‐ yaml :yaml: :datadir: "/etc/puppetlabs/puppet/environments/%{environment}/data"
  20. 20. Hiera All Managed Nodes env_tier=development env_tier=production appid=dev1 appid=dev2 appid=prod1 appid=prod2
  21. 21. Application Class class pe ( $puppet_master_host = undef, $puppet_master_port = undef, $puppet_console_host = undef, $puppet_console_port = undef, $puppetdb_database_host = undef, $puppetdb_database_port = undef, $puppetdb_database_name = undef, $puppetdb_database_username = undef, $puppetdb_database_password = undef, ... ) { ...
  22. 22. Application Class class pe ( $puppet_master_host = $::puppet_master_host , $puppet_master_port = $::puppet_master_port , $puppet_console_host = $::puppet_console_host, $puppet_console_port = $::puppet_console_port , $puppetdb_database_host = $::puppetdb_database_host, $puppetdb_database_port = $::puppetdb_database_port, $puppetdb_database_name = $::puppetdb_database_name, $puppetdb_database_username = $::puppetdb_database_username, $puppetdb_database_password = $::puppetdb_database_password, ... ) { ...
  23. 23. Multi-Tier Challenges • How to Define • How to Classify • How to Deploy
  24. 24. 1 2 Run Puppet! Run Puppet!
  25. 25. Run Puppet! Run Puppet! Run Puppet! Run Puppet! 1 2 3 4
  26. 26. Puppetizing Multi-Tier Architecture Multi-Tier Challenges • How to Define • How to Classify • How to Deploy
  27. 27. Anchors class pe ( ... ) { # ANCHORS # When building a complex multi-­‐tier model, it is not known up front which # profiles will be deployed to a given node. However, some profiles when # deployed together have dependencies which must be expressed. For example, # the CA must be set up and configured before certificates can be requested. # Therefore the CA must be configured before any certificate-­‐requiring # service. Since the profiles cannot express those dependencies directly # against each other, since they may or may not exist in a given node's # catalog, we instead have them express dependencies against common anchors. anchor { 'barrier: pe certificate_authority': } -­‐> anchor { 'barrier: pe puppetdb_database': } -­‐> anchor { 'barrier: pe puppetdb': } -­‐> ...
  28. 28. Puppetizing Multi-Tier Architecture • Model the app as a class – Most important consideration is the interface • Assign parameters to app, not just nodes – Complementary to the assignment of classes to nodes • Take central control of Puppet run schedule – Or else account for eventual consistency
  29. 29. Questions?

×