24
XPDays 2014 HandsOn Infrastructure as Code Alexander Birk, pingworks http://www.pingworks.de @alexanderbirk

HandsOn TestDriven Infrastructure As Code Development

Embed Size (px)

Citation preview

Page 1: HandsOn TestDriven Infrastructure As Code Development

XPDays 2014

HandsOnInfrastructure as Code

Alexander Birk, pingworks http://www.pingworks.de @alexanderbirk

Page 2: HandsOn TestDriven Infrastructure As Code Development

Why IaC?

Page 3: HandsOn TestDriven Infrastructure As Code Development

History:

SysadminsDevelopers

TestersDBAs

Page 4: HandsOn TestDriven Infrastructure As Code Development

1-4 Releases per Year

Page 5: HandsOn TestDriven Infrastructure As Code Development

1-4 Environments per Project

Page 6: HandsOn TestDriven Infrastructure As Code Development

Agility Accelerates!

Agile Software DevelopmentContinuous Integration

Continuous Delivery

Page 7: HandsOn TestDriven Infrastructure As Code Development

Agility Accelerates!

Agile Software DevelopmentContinuous Integration

Continuous Delivery

Page 8: HandsOn TestDriven Infrastructure As Code Development

Was: 1-4 Now: 365 Releases per Year→

Was: 1-4 Now: 10-100 Environments→

Page 9: HandsOn TestDriven Infrastructure As Code Development

Handcrafting is not an Option

Page 10: HandsOn TestDriven Infrastructure As Code Development

Speed AND Quality

Page 11: HandsOn TestDriven Infrastructure As Code Development

Hypotheses

Capture Infrastructure as Code

Page 12: HandsOn TestDriven Infrastructure As Code Development

Quality:Version Control Everything

Automated Testing

Continuous Integration & Delivery

Collaborative Development

Page 13: HandsOn TestDriven Infrastructure As Code Development

Speed:Automated Creation

No Handoff Delays

Continuous Integration & Delivery

Collaborative Development

Page 14: HandsOn TestDriven Infrastructure As Code Development

Infrastracture Creation Phases

Application

„Middleware“i.e. AppServer, DB, MsgQueue

Operating System

Virtual Machine

Bootstrapping Provisioning

t

Deployment

Page 15: HandsOn TestDriven Infrastructure As Code Development

BootstrappingProvisioning Deployment

Provide a VM with:

Just enough OS

Network Setup

Remote Login possible

Page 16: HandsOn TestDriven Infrastructure As Code Development

BootstrappingProvisioning Deployment

(1)Bootstrap OS from bare (virtualized) Metal

(2)Reuse a Base Image

Page 17: HandsOn TestDriven Infrastructure As Code Development

Bootstrapping Provisioning

Deployment

Install & Configure Software Increments

ReliableFast

IdempotentAtomic

On Multihost Environments

Page 18: HandsOn TestDriven Infrastructure As Code Development

Bootstrapping

ProvisioningDeployment

Focus on Provisioning

Input:VM with Just Enough OS

Output:VM Ready for Deployment!

Page 19: HandsOn TestDriven Infrastructure As Code Development

Bootstrapping

ProvisioningDeployment

Install and Configure „Middleware“

Define VM Role Specific Setups

Combine VM Roles to Multihost Environments

Page 20: HandsOn TestDriven Infrastructure As Code Development

Bootstrapping

ProvisioningDeployment

Chef

Puppet

Ansible

Shell ;)

Page 21: HandsOn TestDriven Infrastructure As Code Development

Bootstrapping

ProvisioningDeployment

Chef uses Kitchen Metaphor:

ChefCookbooks

RecipiesRessourcesAttributes

Knife

Testkitchen

Page 22: HandsOn TestDriven Infrastructure As Code Development

with Chef

Provisioning

HandsOn Testdriven

Page 23: HandsOn TestDriven Infrastructure As Code Development

BDD Infrastructure Development

1) Specify desired Behaviourin an Integration Test and run it → red

2) Implement Infrastructure Code that delivers that Behaviour

Run the Code then run Integration Test again → green

3) Think about design and → refactor

Redo from Start

Page 24: HandsOn TestDriven Infrastructure As Code Development

Go! Go! Go!