wrapper formulas saltconf 2016

22
Wrapper Formulas Put Your Formulas in a Formula So You Can Orchestrate Your Orchestration!

Upload: charles-rodetsky

Post on 15-Apr-2017

187 views

Category:

Software


2 download

TRANSCRIPT

Page 1: Wrapper formulas saltconf 2016

Wrapper FormulasPut Your Formulas in a Formula So You Can Orchestrate Your Orchestration!

Page 2: Wrapper formulas saltconf 2016

About me

• Principal Software Engineer, Virtustream• Previously:

– System Administrator– Site Reliability Engineer– Automation Engineer

• 4+ years experience with Saltstack

Page 3: Wrapper formulas saltconf 2016

Virtustream– Virtustream is a member of the EMC Federation– Providing IaaS, Object Storage, and Managed Services– Mission Critical Enterprise workloads in the Cloud

Page 4: Wrapper formulas saltconf 2016

Platform Engineering

• Deploy and Manage:– Mesos Platform– Openstack Platform

Page 5: Wrapper formulas saltconf 2016

Salt at Virtustream

• 15,000+ managed nodes• 25+ sites• Multi-Exabyte Object Storage• VMware• OpenStack• Apache Mesos

Page 6: Wrapper formulas saltconf 2016

Quick Review

Page 7: Wrapper formulas saltconf 2016

Beginnings

• Deployed SaltStack primarily for remote execution on our object storage platform

• Built up some states and pillar data• Kept the state and pillar trees in a GitHub

repository

Page 8: Wrapper formulas saltconf 2016

Beginnings

• Worked reasonably well for a single project• Difficult to test• Difficult to deploy• Not multi-project friendly:

– Poor code reuse– Divergence across projects– Lacks consistent patterns

Page 9: Wrapper formulas saltconf 2016

Individual Formulas (what they solve)• Promotes code reuse• Cookiecutter projects make it easy to get everyone using the same patterns.• Debian packaging solves the distribution problem• State and Execution modules bundled• TeamCity runs our tests, builds, and deployments• Version controlled• Peer reviewed• Tests executed on pull request and added to comments• Test individual states• Pillar data stored with project• We’re up to 140+ formulas built this way!

Page 10: Wrapper formulas saltconf 2016

Individual Formulas (results)

• Our project’s /srv/salt directory is far less populated

• /srv/formulas directory is heavily populated

Page 11: Wrapper formulas saltconf 2016

Questions

Page 12: Wrapper formulas saltconf 2016

Individual Formulas (what they don’t solve)

• Poor support for formula interdependency• Reusable pillar data is not exposed• Does not allow testing of pillar data

Page 13: Wrapper formulas saltconf 2016

Wrapper Formulas

• Captures a single platform or product

• Ties individual formulas together

Page 14: Wrapper formulas saltconf 2016

Wrapper Formulas

• Orchestration and/or states from each formula are included in one orchestration state

• This orchestration state orders the installation and executes blocking health checks between steps as necessary

Page 15: Wrapper formulas saltconf 2016

Wrapper Formulas

• Includes orchestration and states from each formula

Page 16: Wrapper formulas saltconf 2016

Wrapper Formulas

• Extends orchestration to enforce order

Page 17: Wrapper formulas saltconf 2016

Wrapper Formulas

• Formulas bring their own orchestration as needed.

• Contains all non-environment pillar data for the platform

• Allows testing of the entire platform while still allowing individual formula testing

Page 18: Wrapper formulas saltconf 2016

Installs to known location

• Orchestration and state data installs into /srv/salt/ext/• Pillar data installs into /srv/pillar/ext/• This is done so that we know that the state and pillar

data came from a wrapper formula

Page 19: Wrapper formulas saltconf 2016

Turn up a whole stack with one command!

• Now when we need to turn up a new datacenter or testing environment it’s as easy as:– salt-run state.orchestrate

ext.tw.orchestration.bootstrap

Page 20: Wrapper formulas saltconf 2016

Mesos Platform

• Our flagship wrapper formula• Runs on bare metal in production and staging• Runs on Vagrant and Openstack VMs for

development• Chad Heuschober’s talk after this for more

details

Page 21: Wrapper formulas saltconf 2016

Next steps

• Full platform testing via TeamCity• Migration of other projects to this model• Event driven orchestration?

Page 22: Wrapper formulas saltconf 2016

Questions