Download - Puppet @ Spreadshirt
![Page 1: Puppet @ Spreadshirt](https://reader031.vdocument.in/reader031/viewer/2022020115/554f3cf7b4c905471e8b4af1/html5/thumbnails/1.jpg)
Puppet @ SpreadshirtHendrik Seffler <[email protected]>
![Page 2: Puppet @ Spreadshirt](https://reader031.vdocument.in/reader031/viewer/2022020115/554f3cf7b4c905471e8b4af1/html5/thumbnails/2.jpg)
Puppet @ Spreadshirt
The Spreadshirt e-commerce platform lets anyone
create, sell and buy ideas on things consumers love
to wear, use and carry.
![Page 3: Puppet @ Spreadshirt](https://reader031.vdocument.in/reader031/viewer/2022020115/554f3cf7b4c905471e8b4af1/html5/thumbnails/3.jpg)
Puppet @ Spreadshirt
● B2B & B2C points-of-sale
● Choose from over 140 quality products
● Each item made print-on-demand
● Minimum order = 1 item
● Localized services for 17 countries
● Delivered within 3 to 7 days
![Page 4: Puppet @ Spreadshirt](https://reader031.vdocument.in/reader031/viewer/2022020115/554f3cf7b4c905471e8b4af1/html5/thumbnails/4.jpg)
Puppet @ Spreadshirt
![Page 5: Puppet @ Spreadshirt](https://reader031.vdocument.in/reader031/viewer/2022020115/554f3cf7b4c905471e8b4af1/html5/thumbnails/5.jpg)
Puppet @ Spreadshirt
How is Spreadshirt using Puppet?
● Currently different environments at
○ OPS (Opennebula)
○ QA (EC2)
○ DEV (Vagrant)
● Transitions between those environments cause
confusion and errors
● Own installer hard to maintain, very Java-specific
![Page 6: Puppet @ Spreadshirt](https://reader031.vdocument.in/reader031/viewer/2022020115/554f3cf7b4c905471e8b4af1/html5/thumbnails/6.jpg)
Puppet @ Spreadshirt
Our tools
● Puppet● “Puppet is IT automation software that helps system administrators
manage infrastructure throughout its lifecycle ”
● http://www.puppetlabs.com
![Page 7: Puppet @ Spreadshirt](https://reader031.vdocument.in/reader031/viewer/2022020115/554f3cf7b4c905471e8b4af1/html5/thumbnails/7.jpg)
Puppet @ Spreadshirt
Puppet
● Puppet provides a declarative language to describe a
systems configuration
● The most atomic element is the type which descibes
a basic configuration item
● Rules are organized in manifests
● Manifests include classes from modules
● Puppet supports variables, facts and templates
![Page 8: Puppet @ Spreadshirt](https://reader031.vdocument.in/reader031/viewer/2022020115/554f3cf7b4c905471e8b4af1/html5/thumbnails/8.jpg)
Puppet @ Spreadshirt
Our tools
● r10k● “R10K is a hybrid solution for deploying Puppet code...deploying
Puppet environments based on Git branches... provides an
implementation of the Puppetfile format...R10K can provide your
modules for you.”
● https://github.com/adrienthebo/r10k
● http://somethingsinistral.net/blog/rethinking-puppet-deployment/
![Page 9: Puppet @ Spreadshirt](https://reader031.vdocument.in/reader031/viewer/2022020115/554f3cf7b4c905471e8b4af1/html5/thumbnails/9.jpg)
Puppet @ Spreadshirt
R10K● R10K helps us manage our
modules
● Allows us to store our modules
along with the software it
deploys
● This enables re-use of
modules in different contexts
● DEV, OPS and QA can use the same module to deploy an artifact
without copy-and-paste-ing the code all over the place
● Much like puppet-librarian, but also creates puppet-environments
based on GIT-branches
![Page 10: Puppet @ Spreadshirt](https://reader031.vdocument.in/reader031/viewer/2022020115/554f3cf7b4c905471e8b4af1/html5/thumbnails/10.jpg)
Puppet @ Spreadshirt
R10K● Puppetfile is a file which contains
references to modules we want on
out module-path
● R10K checkout out those modules when it runs
● OK, an example:mod ‘jetty’,
:git => "[email protected]:puppet/jetty.git"
mod 'content-service',
:git => "[email protected]:puppet/content-service.git",
:ref => "1.0.0"
● Modulename, GIT-Source, optional git-branch
![Page 11: Puppet @ Spreadshirt](https://reader031.vdocument.in/reader031/viewer/2022020115/554f3cf7b4c905471e8b4af1/html5/thumbnails/11.jpg)
Puppet @ Spreadshirt
Our tools
● hiera● “Hiera is a key/value lookup tool for configuration data. It makes
Puppet better by keeping site-specific data out of your manifests. ”
● http://docs.puppetlabs.com/hiera/1/
![Page 12: Puppet @ Spreadshirt](https://reader031.vdocument.in/reader031/viewer/2022020115/554f3cf7b4c905471e8b4af1/html5/thumbnails/12.jpg)
Puppet @ Spreadshirt
Hiera
● Configuration differs from context to context
● Configuration should not be hardcoded in manifests
● E.g. we may have:
$memory=”-Xmx8192M”
● But actually we want:
$memory=”-Xmx512M” (DEV)
$memory=”-Xmx1024M” (QA)
$memory=”-Xmx8192M” (OPS)
![Page 13: Puppet @ Spreadshirt](https://reader031.vdocument.in/reader031/viewer/2022020115/554f3cf7b4c905471e8b4af1/html5/thumbnails/13.jpg)
Puppet @ Spreadshirt
Hiera
● Hiera seperates deployment description from
configuration
$memory=hiera(“memory”)
● Hiera looks up the actual value based on a hierachy
we define
● Various backends to retrieve values
![Page 14: Puppet @ Spreadshirt](https://reader031.vdocument.in/reader031/viewer/2022020115/554f3cf7b4c905471e8b4af1/html5/thumbnails/14.jpg)
Puppet @ Spreadshirt
Hiera
● Storage of data in module by using the backend
yaml_data_in_modules
● Our own backend, open-sourcehttps://github.com/mythsunwind/yaml_data_in_modules
![Page 15: Puppet @ Spreadshirt](https://reader031.vdocument.in/reader031/viewer/2022020115/554f3cf7b4c905471e8b4af1/html5/thumbnails/15.jpg)
Puppet @ Spreadshirt
Hiera
● Our hierachy- %{context}-%{datacenter}-%{platform}-%{cluster}-%{hostname}
- %{context}-%{datacenter}-%{platform}-%{cluster}
- %{context}-%{datacenter}-%{platform}
- %{context}-%{datacenter}
- %{context}
- common-%{platform}
- common
![Page 16: Puppet @ Spreadshirt](https://reader031.vdocument.in/reader031/viewer/2022020115/554f3cf7b4c905471e8b4af1/html5/thumbnails/16.jpg)
Puppet @ Spreadshirt
Hiera
● Lets look at a typical lookup path:common.yaml
app_name: content-service
port:4747
qa.yaml
port: 2318
● So for a EU system in QA:app_name: content-service
port: 2318
lang=de_DE, en_GB
qa-eu.yaml
lang=de_DE, en_GB
qa-na.yaml
lang=en_US
![Page 17: Puppet @ Spreadshirt](https://reader031.vdocument.in/reader031/viewer/2022020115/554f3cf7b4c905471e8b4af1/html5/thumbnails/17.jpg)
Puppet @ Spreadshirt
Conclusions● Spreadshirt uses Puppet to deploy more and more of
its infrastructure● To enable continuous deployment we aim to have a
uniform development, test und live-infrastrucuture● Puppet in combination with R10K and
hiera brings are the perfect tools for this