handson testdriven infrastructure as code development

Post on 15-Jul-2015

424 Views

Category:

Technology

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

XPDays 2014

HandsOnInfrastructure as Code

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

Why IaC?

History:

SysadminsDevelopers

TestersDBAs

1-4 Releases per Year

1-4 Environments per Project

Agility Accelerates!

Agile Software DevelopmentContinuous Integration

Continuous Delivery

Agility Accelerates!

Agile Software DevelopmentContinuous Integration

Continuous Delivery

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

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

Handcrafting is not an Option

Speed AND Quality

Hypotheses

Capture Infrastructure as Code

Quality:Version Control Everything

Automated Testing

Continuous Integration & Delivery

Collaborative Development

Speed:Automated Creation

No Handoff Delays

Continuous Integration & Delivery

Collaborative Development

Infrastracture Creation Phases

Application

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

Operating System

Virtual Machine

Bootstrapping Provisioning

t

Deployment

BootstrappingProvisioning Deployment

Provide a VM with:

Just enough OS

Network Setup

Remote Login possible

BootstrappingProvisioning Deployment

(1)Bootstrap OS from bare (virtualized) Metal

(2)Reuse a Base Image

Bootstrapping Provisioning

Deployment

Install & Configure Software Increments

ReliableFast

IdempotentAtomic

On Multihost Environments

Bootstrapping

ProvisioningDeployment

Focus on Provisioning

Input:VM with Just Enough OS

Output:VM Ready for Deployment!

Bootstrapping

ProvisioningDeployment

Install and Configure „Middleware“

Define VM Role Specific Setups

Combine VM Roles to Multihost Environments

Bootstrapping

ProvisioningDeployment

Chef

Puppet

Ansible

Shell ;)

Bootstrapping

ProvisioningDeployment

Chef uses Kitchen Metaphor:

ChefCookbooks

RecipiesRessourcesAttributes

Knife

Testkitchen

with Chef

Provisioning

HandsOn Testdriven

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

Go! Go! Go!

top related