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.

Implementing Infrastructure as Code ConfigMgtCamp 2017

688 views

Published on

Run-through of key patterns and approaches for applying software engineering practices and microservice design to infrastructure.

Infrastructure as Code is the "A" (Automation) in the "CAMS" model for DevOps.

Published in: Software
  • Hello! Get Your Professional Job-Winning Resume Here - Check our website! https://vk.cc/818RFv
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Implementing Infrastructure as Code ConfigMgtCamp 2017

  1. 1. INFRASTRUCTURE AS CODE @cfgmgmtcamp
  2. 2. kief@thoughtworks.com Cloud Practice Lead (UK) DevOps, Continuous Delivery, Agile Ops Twitter: @kief Book: http://oreil.ly/1JKIBVe Site: http://infrastructure-as-code.com February 2017
  3. 3. SPEED
  4. 4. RISK
  5. 5. FASTER IS SAFER http://bit.ly/2cQQSOk
  6. 6. RAPID RESPONSIBLE
  7. 7. INFRASTRUCTURE AS CODE Applying tools and practices from software engineering to managing infrastructure.
  8. 8. DEFINE SYSTEMS AS CODE System design is: ▪ Reusable ▪ Consistent ▪ Visible ▪ Versioned
  9. 9. DYNAMIC INFRASTRUCTURE PLATFORMS Compute Storage Network
  10. 10. DYNAMIC INFRASTRUCTURE PLATFORMS Cloud (IaaS) Virtual Physical Compute Storage Network
  11. 11. PROGRAMMABLE, ON-DEMAND API
  12. 12. Cloud and automation AWESOME!
  13. 13. Oh, no! SERVER SPRAWL!
  14. 14. CONFIGURATION DRIFTServers start out identical But changes accumulate over time
  15. 15. AUTOMATION FEAR CYCLE
  16. 16. AUTOMATION LAG The longer it’s been since an automated process has run in the same context … … the more work is needed to run it again
  17. 17. Apply small changes frequently rather than large batches infrequently
  18. 18. CONTINUOUSLY SYNCHRONIZE
  19. 19. OR CONTINUOUSLY REBUILD
  20. 20. DEVOOPS How can we avoid damage from automated mistakes?
  21. 21. AUTOMATICALLY TEST EVERY CHANGE
  22. 22. PROMOTE CHANGES TEST SIT PROD QA
  23. 23. BUILD COMPLIANCE INTO THE PIPELINE Humans focus on the implementation of the pipeline and audit trailsUse the pipeline to continuously validate operational requirements and compliance, and to implement controls
  24. 24. INFRASTRUCTURE DESIGN PATTERNS Organizing code for dynamic infrastructure
  25. 25. One definition, multiple environments our-project/main.tf staging production
  26. 26. INFRASTRUCTURE DESIGN PRINCIPLE Structure your code to minimize risks for making (small, frequent) changes
  27. 27. our-project/staging/main.tf staging production our-project/production/main.tf One definition per environment
  28. 28. our-project/main.tf staging production development Single definition template, promoted across environments
  29. 29. How do we build and test this stuff? It runs sooooo sloooooow! L
  30. 30. Nginx Cookbook ORGANIZE INFRASTRUCTURE INTO SEPARATELY TESTABLE PIECES Tomcat Cookbook JDK Cookbook MyApp Vhost Cookbook MyApp.war Application Server Web Server
  31. 31. FAN-IN PIPELINES TEST TOMCAT COOKBOOK TEST MYAPP CODE TEST JDK COOKBOOK TEST APP SERVER TEST MYAPP DEPLOYMENT Test components individually Cumulatively integrate and test components together
  32. 32. DESIGNING FOR CHANGE Cope with growth, evolving requirements, expanding teams
  33. 33. DESIGN TO ENABLE FREQUENT CHANGES Split infrastructure according to the scope of typical changes Minimize the risk of changes by limiting the blast radius Keep infrastructure units loosely coupled
  34. 34. ALIGN INFRASTRUCTURE DESIGN WITH ORGANIZATION STRUCTURE
  35. 35. WHERE SHOULD WE SPLIT?
  36. 36. WHERE SHOULD WE SPLIT?
  37. 37. Split infrastructure in ways that reduce the friction for making changes
  38. 38. SHARING How can teams share their stuff?
  39. 39. LIBRARY PATTERN FOR INFRA Tested server images BUILD TEST BUILD TEST PROD BUILD TEST PROD Server image pipeline Application environment pipelines
  40. 40. DECOUPLED CHANGE PIPELINES Application A with its environment TESTBUILD Application B TESTBUILD Application C TESTBUILD QA PROD QA PROD QA PROD
  41. 41. HANDLING DEPENDENCIES TESTBUILD QA PROD TESTBUILD QA PROD Self-service test instances Consumer Driven Contract (CDC) Tests Mocks, stubs, and fakes
  42. 42. CYCLE TIME Measure and optimize the elapsed time from identifying a need to satisfying it
  43. 43. SOME ACTIVITIES TO MEASURE Rebuild (Recover) New environment Update existing environments Introducing a new tech stack
  44. 44. SOME OTHER BOOKS
  45. 45. Book: http://oreil.ly/1JKIBVe Site: http://infrastructure-as-code.com Twitter: @kief kief@thoughtworks.com Cloud Practice Lead (UK) DevOps, Continuous Delivery, Agile Ops

×