Puppet Camp Presentation 15
-
Upload
dejan-golja -
Category
Documents
-
view
112 -
download
0
Transcript of Puppet Camp Presentation 15
![Page 1: Puppet Camp Presentation 15](https://reader031.fdocuments.us/reader031/viewer/2022030313/58a6abea1a28ab0a7a8b6321/html5/thumbnails/1.jpg)
SNEAK PEEK The Puppet Environment at Fairfax Media / Domain Group
Dejan Golja // Gonzalo Servat
![Page 2: Puppet Camp Presentation 15](https://reader031.fdocuments.us/reader031/viewer/2022030313/58a6abea1a28ab0a7a8b6321/html5/thumbnails/2.jpg)
Introduction
Dejan GoljaSenior Systems Engineer // Fairfax Media
Twitter @dejangolja
![Page 3: Puppet Camp Presentation 15](https://reader031.fdocuments.us/reader031/viewer/2022030313/58a6abea1a28ab0a7a8b6321/html5/thumbnails/3.jpg)
Introduction
Gonzalo ServatSenior DevOps Engineer // Domain Group
Twitter @gservat
![Page 4: Puppet Camp Presentation 15](https://reader031.fdocuments.us/reader031/viewer/2022030313/58a6abea1a28ab0a7a8b6321/html5/thumbnails/4.jpg)
Who are we?
![Page 5: Puppet Camp Presentation 15](https://reader031.fdocuments.us/reader031/viewer/2022030313/58a6abea1a28ab0a7a8b6321/html5/thumbnails/5.jpg)
Our Puppet History
☁ Early Puppet adopters … since version 0.25.X
☁ Large scale environment with distributed team
☁ We made every possible mistake
We’re on our 3rd major Puppet implementation!
![Page 6: Puppet Camp Presentation 15](https://reader031.fdocuments.us/reader031/viewer/2022030313/58a6abea1a28ab0a7a8b6321/html5/thumbnails/6.jpg)
Lessons Learned
☁ Do NOT make changes directly on the Puppet Master
☁ DO your testing - lint, code validation, etc.
☁ Do NOT pollute your downloaded official modules
☁ DO define and document the standard workflow
☁ Do NOT store sensitive data into modules
![Page 7: Puppet Camp Presentation 15](https://reader031.fdocuments.us/reader031/viewer/2022030313/58a6abea1a28ab0a7a8b6321/html5/thumbnails/7.jpg)
Example of ugliness (old site.pp)
![Page 8: Puppet Camp Presentation 15](https://reader031.fdocuments.us/reader031/viewer/2022030313/58a6abea1a28ab0a7a8b6321/html5/thumbnails/8.jpg)
Standardised process for deploying changes
Easily repeatable for multiple
environments
Puppet “V3” Requirements
High Availability
Bring order to our modules
![Page 9: Puppet Camp Presentation 15](https://reader031.fdocuments.us/reader031/viewer/2022030313/58a6abea1a28ab0a7a8b6321/html5/thumbnails/9.jpg)
Ingredients
☁ Packer
☁ Puppetlabs R10k
☁ Custom Ruby Service - “Captain Hook”
☁ Notification Systems - Slack/Flowdock
EC2 ASG ELB
SNS SQS RDS
CloudFormation
![Page 10: Puppet Camp Presentation 15](https://reader031.fdocuments.us/reader031/viewer/2022030313/58a6abea1a28ab0a7a8b6321/html5/thumbnails/10.jpg)
☁ Module preferences☁ Puppetlabs supported☁ Vendor supported☁ Puppet approved
☁ Create module guidelines else it gets very messy!☁ Each module lives in a separate Git repository
Puppet Modules
![Page 11: Puppet Camp Presentation 15](https://reader031.fdocuments.us/reader031/viewer/2022030313/58a6abea1a28ab0a7a8b6321/html5/thumbnails/11.jpg)
Git Flow
Feature Branch
Workflow
![Page 12: Puppet Camp Presentation 15](https://reader031.fdocuments.us/reader031/viewer/2022030313/58a6abea1a28ab0a7a8b6321/html5/thumbnails/12.jpg)
Architecture
![Page 13: Puppet Camp Presentation 15](https://reader031.fdocuments.us/reader031/viewer/2022030313/58a6abea1a28ab0a7a8b6321/html5/thumbnails/13.jpg)
Puppet Client
![Page 14: Puppet Camp Presentation 15](https://reader031.fdocuments.us/reader031/viewer/2022030313/58a6abea1a28ab0a7a8b6321/html5/thumbnails/14.jpg)
Puppet CA
![Page 15: Puppet Camp Presentation 15](https://reader031.fdocuments.us/reader031/viewer/2022030313/58a6abea1a28ab0a7a8b6321/html5/thumbnails/15.jpg)
Puppet Masters
![Page 16: Puppet Camp Presentation 15](https://reader031.fdocuments.us/reader031/viewer/2022030313/58a6abea1a28ab0a7a8b6321/html5/thumbnails/16.jpg)
Puppet DB
![Page 17: Puppet Camp Presentation 15](https://reader031.fdocuments.us/reader031/viewer/2022030313/58a6abea1a28ab0a7a8b6321/html5/thumbnails/17.jpg)
Architecture
![Page 18: Puppet Camp Presentation 15](https://reader031.fdocuments.us/reader031/viewer/2022030313/58a6abea1a28ab0a7a8b6321/html5/thumbnails/18.jpg)
$ aws cloudformation create-stack \
--stack-name puppetmaster-staging \
--templatebody file://infrastructure-puppetmaster.template \
--parameters \
ParameterKey=Environment,ParameterValue=staging \
ParameterKey=InstanceType,ParameterValue=m3.large \
ParameterKey=MinScalingGroupSize,ParameterValue=2 \
ParameterKey=MaxScalingGroupSize,ParameterValue=4
CloudFormation Example
![Page 19: Puppet Camp Presentation 15](https://reader031.fdocuments.us/reader031/viewer/2022030313/58a6abea1a28ab0a7a8b6321/html5/thumbnails/19.jpg)
Awesome, so we have a neat-looking HA/FT set-up…
…but how do we manage pushing changes to Puppet Masters?!
![Page 20: Puppet Camp Presentation 15](https://reader031.fdocuments.us/reader031/viewer/2022030313/58a6abea1a28ab0a7a8b6321/html5/thumbnails/20.jpg)
☁ Puppet masters can “come and go” randomly
☁ Keep the modules up to date per environment
☁ K.I.S.S. - Tame the learning curve for the team
☁ Avoid reinventing the wheel
Challenges
![Page 21: Puppet Camp Presentation 15](https://reader031.fdocuments.us/reader031/viewer/2022030313/58a6abea1a28ab0a7a8b6321/html5/thumbnails/21.jpg)
OUR SOLUTION
![Page 22: Puppet Camp Presentation 15](https://reader031.fdocuments.us/reader031/viewer/2022030313/58a6abea1a28ab0a7a8b6321/html5/thumbnails/22.jpg)
P3 Workflow
![Page 23: Puppet Camp Presentation 15](https://reader031.fdocuments.us/reader031/viewer/2022030313/58a6abea1a28ab0a7a8b6321/html5/thumbnails/23.jpg)
1. Make changes and commit/push to git server2. Git server triggers post-commit hook (POST) to Captain Hook server3. Captain Hook server validates the payload & creates new message:
☁ Full refresh ➩ r10k deploy environment -p☁ Light refresh ➩ r10k deploy environment☁ Module refresh ➩ r10k deploy module <name>
4. Captain hook server pushes new message to SNS5. Captain hook client polls & reads messages ( ➩ r10k)6. … and we get notified in slack/flowdock/dashboard
Typical Puppet Workflow
![Page 24: Puppet Camp Presentation 15](https://reader031.fdocuments.us/reader031/viewer/2022030313/58a6abea1a28ab0a7a8b6321/html5/thumbnails/24.jpg)
DEMO
![Page 25: Puppet Camp Presentation 15](https://reader031.fdocuments.us/reader031/viewer/2022030313/58a6abea1a28ab0a7a8b6321/html5/thumbnails/25.jpg)
☁ Fairfax is a large scale complex environment
☁ Many systems engineers are constantly pushing changes
☁ Puppet architecture designed for HA and fault tolerance
☁ Puppet workflow helps us deploy changes to multiple
masters safely and easily
Summary
![Page 26: Puppet Camp Presentation 15](https://reader031.fdocuments.us/reader031/viewer/2022030313/58a6abea1a28ab0a7a8b6321/html5/thumbnails/26.jpg)
![Page 27: Puppet Camp Presentation 15](https://reader031.fdocuments.us/reader031/viewer/2022030313/58a6abea1a28ab0a7a8b6321/html5/thumbnails/27.jpg)
Our Blogshttp://engineering.fairfaxmedia.com.au/
http://tech.domain.com.au/
Our Codehttp://github.com/fairfaxmedia
Your Feedback or QuestionsYou can contact us on twitter: @dejangolja @gservat
Before you go ...