Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Phoenix Servers with Packer

Phoenix Servers with Packer

In this presentation we define the notion of Phoenix Servers (by Martin Fowler) and present a way to achieve this with packer.io.

Nils De Moor

October 08, 2013
Tweet

More Decks by Nils De Moor

Other Decks in Programming

Transcript

  1. CONFIG MANAGEMENT CLEAN SERVER INSTALL CONFIG MGMT AGENT (CHEF, PUPPET,

    ANSIBLE,...) COMPOSE SCRIPTS & RUN AGENT SERVER in desired STATE Change version Edit config file Add/remove library Create folder/link/... ....
  2. CONTINUOUS DEPLOYMENT PUSH CODE RUN TESTs BUILD CLEAN SERVER INSTALL

    CONFIG MGMT AGENT (CHEF, PUPPET, ANSIBLE,...) COMPOSE SCRIPTS & RUN AGENT SERVER in desired STATE D EPLO Y
  3. PITFALLS WHAT IF... • IDEMPOTENCE IS NOT GUARANTEED? • NOT

    EVERY PIECE IS REMOVED ON DELETE? • MY CONFIG SERVER IS DOWN? • REPOSITORIES ARE UNAVAILABLE? • AGENT WORKS LONG WHEN AUTOSCALING UP?
  4. “THE RESULT IS A UNIQUE SNOWFLAKE. GOOD FOR A SKI

    RESORT, BAD FOR A DATA CENTER.” Martin Fowler
  5. PACKING IMAGES • APPLY CONFIG AGAINST BASE IMAGE • BAKE

    NEW IMAGE OF FINAL STATE • BOOT FROM FULLY OPERATIONAL IMAGE
  6. BENEFITS • PLATFORM AGNOSTIC • SAME CONFIG TOOLS • FRESH

    SERVER ON EVERY DEPLOY • TESTABLE IMAGE • TEST VS. PROD PARITY • SERVER GROUP PARITY • FASTER BOOT
  7. “PACKER IS AN OPEN SOURCE TOOL FOR CREATING IDENTICAL MACHINE

    IMAGES FOR MULTIPLE PLATFORMS FROM A SINGLE SOURCE CONFIGURATION.” Mitchell Hashimoto Creator of packer and vagrant
  8. IN SHORT • RUNS ON EVERY MAJOR OS • CREATES

    IMAGES FOR MULTIPLE PLATFORMS... • ... IN PARALLEL • CHEF, PUPPET, ETC. TO CONFIGURE IMAGE • EXTENDABLE THROUGH PLUGINS • OPEN SOURCE (GO LANG), WELL-MAINTAINED
  9. PACKER.JSON Custom BUILDERS MACHINE TO BUILD IMAGE FROM PROVISIONERS CONFIGURE

    MACHINE Custom PR PENDING Custom POST-PROCESSORS COMPRESS, UPLOAD, ETC.
  10. • DEPLOYMENT UI • BUILT ON TOP OF PACKER •

    SUPPORTS AWS API • INPUT/OUTPUT API • OPEN SOURCED BY END 2013 WOLFPACK INPUT CI tool git hook ... OUTPUT notification monitoring ... wolfpack PACKER build image PALTFORM API boot SERVER eg. AWS (CF or EC2) configure APPLICATIONS ENVIRONMENTS