Slide 1

Slide 1 text

INFRASTRUCTURE AS CODE

Slide 2

Slide 2 text

[email protected] Cloud Practice Lead (UK) DevOps, Continuous Delivery, Agile Ops Twitter: @kief Book: http://oreil.ly/1JKIBVe Site: http://infrastructure-as-code.com March 2017

Slide 3

Slide 3 text

What changes do you typically make to your infrastructure?

Slide 4

Slide 4 text

SPEED

Slide 5

Slide 5 text

TECHNOLOGY

Slide 6

Slide 6 text

RISK

Slide 7

Slide 7 text

RAPID RESPONSIBLE

Slide 8

Slide 8 text

FASTER IS SAFER http://bit.ly/2cQQSOk

Slide 9

Slide 9 text

Cloud and automation AWESOME!

Slide 10

Slide 10 text

Oh, no! SERVER SPRAWL!

Slide 11

Slide 11 text

CONFIGURATION DRIFT Servers start out identical But changes accumulate over time

Slide 12

Slide 12 text

AUTOMATION FEAR CYCLE

Slide 13

Slide 13 text

INFRASTRUCTURE AS CODE Applying tools and practices from software engineering to infrastructure management

Slide 14

Slide 14 text

DEFINE SYSTEMS AS CODE System design is: ▪ Reusable ▪ Consistent ▪ Visible ▪ Versioned

Slide 15

Slide 15 text

DYNAMIC INFRASTRUCTURE PLATFORMS Compute Storage Network

Slide 16

Slide 16 text

DYNAMIC INFRASTRUCTURE PLATFORMS Cloud (IaaS) Virtual Physical Compute Storage Network

Slide 17

Slide 17 text

PROGRAMMABLE, ON-DEMAND API

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

CONTINUOUSLY SYNCHRONIZE

Slide 20

Slide 20 text

OR CONTINUOUSLY REBUILD

Slide 21

Slide 21 text

Apply small changes frequently rather than large batches infrequently

Slide 22

Slide 22 text

DEV OOPS How can we avoid damage from automated mistakes?

Slide 23

Slide 23 text

AUTOMATICALLY TEST EVERY CHANGE

Slide 24

Slide 24 text

PROMOTE CHANGES TEST SIT PROD QA

Slide 25

Slide 25 text

BUILD COMPLIANCE INTO THE PIPELINE Humans focus on the implementation of the pipeline and audit trails Use the pipeline to continuously validate operational requirements and compliance, and to implement controls

Slide 26

Slide 26 text

MANAGING ENVIRONMENTS Defining multiple environments as code

Slide 27

Slide 27 text

One definition, multiple environments our-project/main.tf staging production

Slide 28

Slide 28 text

INFRASTRUCTURE DESIGN PRINCIPLE Structure your code to minimize risks for making (small, frequent) changes

Slide 29

Slide 29 text

our-project/staging/main.tf staging production our-project/production/main.tf One definition per environment

Slide 30

Slide 30 text

our-project/main.tf staging production development Single definition template, promoted across environments

Slide 31

Slide 31 text

SCALING ACROSS TEAMS Cope with growth, evolving requirements, expanding teams

Slide 32

Slide 32 text

Nginx Cookbook ORGANIZE INFRASTRUCTURE INTO SEPARATELY TESTABLE PIECES Tomcat Cookbook JDK Cookbook MyApp Vhost Cookbook MyApp.war Application Server Web Server

Slide 33

Slide 33 text

ASSEMBLY 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

Slide 34

Slide 34 text

LIBRARY PIPELINES Tested server images BUILD TEST BUILD TEST PROD BUILD TEST PROD Server image pipeline Application environment pipelines

Slide 35

Slide 35 text

DECOUPLED CHANGE PIPELINES Application A TEST BUILD Application B TEST BUILD Application C TEST BUILD QA PROD QA PROD QA PROD

Slide 36

Slide 36 text

HANDLING DEPENDENCIES TEST BUILD QA PROD TEST BUILD QA PROD Self-service test instances Consumer Driven Contract (CDC) Tests Mocks, stubs, and fakes

Slide 37

Slide 37 text

ARCHITECTURAL PATTERNS Designing infrastructure for frequent change

Slide 38

Slide 38 text

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

Slide 39

Slide 39 text

WHERE SHOULD WE SPLIT?

Slide 40

Slide 40 text

WHERE SHOULD WE SPLIT?

Slide 41

Slide 41 text

Split infrastructure in ways that reduce the friction for making changes

Slide 42

Slide 42 text

CYCLE TIME Measure and optimize the elapsed time from identifying a need to satisfying it

Slide 43

Slide 43 text

SOME ACTIVITIES TO MEASURE § Rebuild (Recover) § New environment § Update existing environments § Introducing a new tech stack

Slide 44

Slide 44 text

SOME OTHER BOOKS

Slide 45

Slide 45 text

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