infrastructure as code kief thoughtworks com cloud
play

INFRASTRUCTURE AS CODE kief@thoughtworks.com Cloud Practice Lead - PowerPoint PPT Presentation

INFRASTRUCTURE AS CODE 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 June 2016 AGENDA CONTEXT Motivations


  1. INFRASTRUCTURE AS CODE

  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 June 2016

  3. AGENDA CONTEXT ● Motivations ● Challenges INFRASTRUCTURE AS CODE ● Key Practices ● Simple Pipeline ● Scaling Pipelines

  4. SPEED Get something to market quickly Iterate it Continuously improve it

  5. TECHNOLOGY Cloud, automation, etc. lowers barriers for making changes

  6. DANGER Security Performance Stability Compliance Maintainability

  7. SECRET High quality services rely on the ability to make changes quickly

  8. GOAL Be able to make changes Rapidly , Frequently , and Responsibly

  9. CHALLENGES

  10. SERVER SPRAWL Creating new servers is the easy part

  11. CONFIGURATION DRIFT Servers start out identical But changes accumulate over time

  12. AUTOMATION FEAR CYCLE

  13. INFRASTRUCTURE AS CODE “Applying software engineering tools and practices to infrastructure”

  14. UNATTENDED AUTOMATION Tools run on a BENEFITS OF UNATTENDED: schedule to apply, ● Discover problems quickly ● Force yourself to fix those re-apply, and update problems configuration ● Force yourself to improve your tools and processes ● Discourages “out of band” changes

  15. AUTOMATE SERVER UPDATES Automation isn’t just for new servers! Configuration Run Chef, Puppet, Ansible, etc. on a synchronization schedule Immutable servers Apply changes by rebuilding servers Containerized Apply changes by deploying new servers container instances

  16. RE-USE & PROMOTE DEFINITIONS Re-use the same definition files across environments for a given application or service DEV STAGE PROD Playbooks, Cookbooks, Manifests, templates, etc.

  17. TEST INFRASTRUCTURE CHANGES Preventing Dev Oops INFRA DEV PROD TEST TEST

  18. PIPELINES Using Continuous Delivery pipelines to manage infrastructure

  19. WHAT? Tools are run on Changes are only agents to apply promoted after changes to passing tests & Changes are environments authorization made and committed to VCS Terraform, Puppet, etc.

  20. WHY? Confidence for Limit direct Validates changes frequent, small changes to to infrastructure improvements to infrastructure before applying infrastructure them to production

  21. TESTING Correctness Performance Stability Security policies

  22. GOVERNANCE The process for applying changes is auditable Changes can be traced back to commits Automation ensures processes are followed Authorization can be required as needed

  23. SIMPLE An example with a fairly simple environment

  24. DEFINING A SIMPLE ENVIRONMENT VPC Subnet TERRAFORM FILE Environment structure 10.0.0.0/16 Security Group ANSIBLE PLAYBOOK 1.1.1.0/16 -> :443 Server configuration APPLICATION SOURCE Deployable application

  25. SIMPLE PIPELINE DESIGN Deploy application, configuration, and infrastructure Application Ansible Terraform BUILD TEST PROD QA STAGE STAGE STAGE STAGE

  26. SCALING Handling more complex infrastructure

  27. ALIGN INFRASTRUCTURE DESIGN TO TEAMS Ensure teams can make the changes they need easily and safely

  28. COMPLEX ENVIRONMENTS Infrastructure involving multiple teams

  29. FAN-IN PIPELINE ServiceA SERVICE BUILD TEST ServiceB SERVICE SYSTEM BUILD QA PROD TEST TEST ServiceC SERVICE BUILD TEST

  30. DECOUPLED PIPELINES ServiceA BUILD TEST QA PROD ServiceB BUILD TEST QA PROD ServiceC BUILD TEST QA PROD

  31. DEPENDENCIES ServiceA BUILD TEST QA PROD Use mocks Implement and stubs Create test Consumer instance of Driven Contract provider (CDC) Tests BUILD TEST QA PROD ServiceB

  32. ISSUE: DUPLICATION Multiple teams using similar systems, e.g. database clusters

  33. RE-USE BY FORKING DEFINITIONS Disadvantages: Advantages: - Divergence and - Avoid tight coupling Inconsistency - Handles diverse requirements

  34. RE-USE WITH DEFINITION LIBRARIES Challenges: Guidance: - Avoid tight coupling, so teams - Use separate pipelines for aren’t blocked when making each changes - Use CDC & other dependency - Ownership of code shared by testing strategies multiple teams

  35. LIBRARY PIPELINE Test shared definitions before pulling them into dependent pipelines Server AMI BUILD TEST Service BUILD TEST

  36. ISSUE: SHARED ELEMENTS ServiceA ServiceB VIP VIP Shared Service-specific LOAD BALANCER infrastructure infrastructure definitions definitions

  37. SHARING ELEMENTS Avoid monoliths - optimize to simplify making changes

  38. OUTCOMES ● Quickly provision and evolve infrastructure ● Effortlessly roll out fixes ● Keep systems consistent and up to date ● Spend time on high value work

  39. kief@thoughtworks.com Cloud Practice Lead (UK) DevOps, Continuous Delivery, Agile Ops Book: http://oreil.ly/1JKIBVe Site: http://infrastructure-as-code.com Twitter: @kief

Recommend


More recommend