![Page 1: HandsOn TestDriven Infrastructure As Code Development](https://reader031.vdocuments.mx/reader031/viewer/2022032616/55a64a251a28abd06d8b460c/html5/thumbnails/1.jpg)
XPDays 2014
HandsOnInfrastructure as Code
Alexander Birk, pingworks http://www.pingworks.de @alexanderbirk
![Page 2: HandsOn TestDriven Infrastructure As Code Development](https://reader031.vdocuments.mx/reader031/viewer/2022032616/55a64a251a28abd06d8b460c/html5/thumbnails/2.jpg)
Why IaC?
![Page 3: HandsOn TestDriven Infrastructure As Code Development](https://reader031.vdocuments.mx/reader031/viewer/2022032616/55a64a251a28abd06d8b460c/html5/thumbnails/3.jpg)
History:
SysadminsDevelopers
TestersDBAs
![Page 4: HandsOn TestDriven Infrastructure As Code Development](https://reader031.vdocuments.mx/reader031/viewer/2022032616/55a64a251a28abd06d8b460c/html5/thumbnails/4.jpg)
1-4 Releases per Year
![Page 5: HandsOn TestDriven Infrastructure As Code Development](https://reader031.vdocuments.mx/reader031/viewer/2022032616/55a64a251a28abd06d8b460c/html5/thumbnails/5.jpg)
1-4 Environments per Project
![Page 6: HandsOn TestDriven Infrastructure As Code Development](https://reader031.vdocuments.mx/reader031/viewer/2022032616/55a64a251a28abd06d8b460c/html5/thumbnails/6.jpg)
Agility Accelerates!
Agile Software DevelopmentContinuous Integration
Continuous Delivery
![Page 7: HandsOn TestDriven Infrastructure As Code Development](https://reader031.vdocuments.mx/reader031/viewer/2022032616/55a64a251a28abd06d8b460c/html5/thumbnails/7.jpg)
Agility Accelerates!
Agile Software DevelopmentContinuous Integration
Continuous Delivery
![Page 8: HandsOn TestDriven Infrastructure As Code Development](https://reader031.vdocuments.mx/reader031/viewer/2022032616/55a64a251a28abd06d8b460c/html5/thumbnails/8.jpg)
Was: 1-4 Now: 365 Releases per Year→
Was: 1-4 Now: 10-100 Environments→
![Page 9: HandsOn TestDriven Infrastructure As Code Development](https://reader031.vdocuments.mx/reader031/viewer/2022032616/55a64a251a28abd06d8b460c/html5/thumbnails/9.jpg)
Handcrafting is not an Option
![Page 10: HandsOn TestDriven Infrastructure As Code Development](https://reader031.vdocuments.mx/reader031/viewer/2022032616/55a64a251a28abd06d8b460c/html5/thumbnails/10.jpg)
Speed AND Quality
![Page 11: HandsOn TestDriven Infrastructure As Code Development](https://reader031.vdocuments.mx/reader031/viewer/2022032616/55a64a251a28abd06d8b460c/html5/thumbnails/11.jpg)
Hypotheses
Capture Infrastructure as Code
![Page 12: HandsOn TestDriven Infrastructure As Code Development](https://reader031.vdocuments.mx/reader031/viewer/2022032616/55a64a251a28abd06d8b460c/html5/thumbnails/12.jpg)
Quality:Version Control Everything
Automated Testing
Continuous Integration & Delivery
Collaborative Development
![Page 13: HandsOn TestDriven Infrastructure As Code Development](https://reader031.vdocuments.mx/reader031/viewer/2022032616/55a64a251a28abd06d8b460c/html5/thumbnails/13.jpg)
Speed:Automated Creation
No Handoff Delays
Continuous Integration & Delivery
Collaborative Development
![Page 14: HandsOn TestDriven Infrastructure As Code Development](https://reader031.vdocuments.mx/reader031/viewer/2022032616/55a64a251a28abd06d8b460c/html5/thumbnails/14.jpg)
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](https://reader031.vdocuments.mx/reader031/viewer/2022032616/55a64a251a28abd06d8b460c/html5/thumbnails/15.jpg)
BootstrappingProvisioning Deployment
Provide a VM with:
Just enough OS
Network Setup
Remote Login possible
![Page 16: HandsOn TestDriven Infrastructure As Code Development](https://reader031.vdocuments.mx/reader031/viewer/2022032616/55a64a251a28abd06d8b460c/html5/thumbnails/16.jpg)
BootstrappingProvisioning Deployment
(1)Bootstrap OS from bare (virtualized) Metal
(2)Reuse a Base Image
![Page 17: HandsOn TestDriven Infrastructure As Code Development](https://reader031.vdocuments.mx/reader031/viewer/2022032616/55a64a251a28abd06d8b460c/html5/thumbnails/17.jpg)
Bootstrapping Provisioning
Deployment
Install & Configure Software Increments
ReliableFast
IdempotentAtomic
On Multihost Environments
![Page 18: HandsOn TestDriven Infrastructure As Code Development](https://reader031.vdocuments.mx/reader031/viewer/2022032616/55a64a251a28abd06d8b460c/html5/thumbnails/18.jpg)
Bootstrapping
ProvisioningDeployment
Focus on Provisioning
Input:VM with Just Enough OS
Output:VM Ready for Deployment!
![Page 19: HandsOn TestDriven Infrastructure As Code Development](https://reader031.vdocuments.mx/reader031/viewer/2022032616/55a64a251a28abd06d8b460c/html5/thumbnails/19.jpg)
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](https://reader031.vdocuments.mx/reader031/viewer/2022032616/55a64a251a28abd06d8b460c/html5/thumbnails/20.jpg)
Bootstrapping
ProvisioningDeployment
Chef
Puppet
Ansible
Shell ;)
![Page 21: HandsOn TestDriven Infrastructure As Code Development](https://reader031.vdocuments.mx/reader031/viewer/2022032616/55a64a251a28abd06d8b460c/html5/thumbnails/21.jpg)
Bootstrapping
ProvisioningDeployment
Chef uses Kitchen Metaphor:
ChefCookbooks
RecipiesRessourcesAttributes
Knife
Testkitchen
![Page 22: HandsOn TestDriven Infrastructure As Code Development](https://reader031.vdocuments.mx/reader031/viewer/2022032616/55a64a251a28abd06d8b460c/html5/thumbnails/22.jpg)
with Chef
Provisioning
HandsOn Testdriven
![Page 23: HandsOn TestDriven Infrastructure As Code Development](https://reader031.vdocuments.mx/reader031/viewer/2022032616/55a64a251a28abd06d8b460c/html5/thumbnails/23.jpg)
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](https://reader031.vdocuments.mx/reader031/viewer/2022032616/55a64a251a28abd06d8b460c/html5/thumbnails/24.jpg)
Go! Go! Go!