Infrastructure as Code
Build, repeat and test your configurations
Slide 2
Slide 2 text
What is Infrastructure?
Resources (network, file, computer, ...)
acting together
to provide some services
Slide 3
Slide 3 text
What is Code?
Text representing instructions
which have to be executed
to produce an output
Slide 4
Slide 4 text
And IAC???
View infrastructure like an artifact
Artifact are produced from code
A try to apply software techniques (versionning, testing,
automation...) to infrastructure requests
Slide 5
Slide 5 text
But...
We are using VM images.
How are you building VM images?
We have a lot of world documentation.
How do you maintain and version documentation?
We have some custom scripts.
Can you easily and quickly handle change?
Slide 6
Slide 6 text
Step one : Configuration management
Process of standardizing resource configurations and
enforcing their state across IT infrastructure in an automated
yet agile manner
Slide 7
Slide 7 text
We have good tools to start
Slide 8
Slide 8 text
Why use it?
• Bring abstraction layer
• Declarative code is also kind of documentation
• Easy to rollback, release, and track in CVS
• Provide repeatability and idempotence
• Scale easyly
Slide 9
Slide 9 text
Configuration management with Chef
include_recipe "apache2"
apache_site "default" do
enable true
end
Slide 10
Slide 10 text
Step two : Create and stock artifacts
Assembly
Container
Virtual Machine
Slide 11
Slide 11 text
Step three : Provisionning
Set of actions to make a infrastructure resource available
and make it ready for network operation.
Slide 12
Slide 12 text
Provision on Azure
azure vm create
my-vm-name
mi_name_{{timestamp}}
username
--location "West US" –r
Slide 13
Slide 13 text
Step four: Test, test and test
Ensure that infrastructure meets the requirements and
performs its functions.
Slide 14
Slide 14 text
Testing strategy
Test every change
Get fast feedback
Run code against short lived virtual machines
Slide 15
Slide 15 text
ServerSpec
Based on RSpec, ServerSpec tests for your servers
configured by CFEngine, Puppet, Ansible or anything else.
Slide 16
Slide 16 text
Test with RSpec
describe 'apache' do
describe 'Installation' do
it {
should
contain_package('apache')
.with_ensure('present')
}
end
end
Slide 17
Slide 17 text
What about load testing ?
• JMeter
• Gatling
• Grinder
• Tsung
• ...
Slide 18
Slide 18 text
Step five: Improve your dev with Vagrant
• Provide easy to configure, reproductible and portable
development environments
• Provider on top of VirtualBox, Vmware, Custom
provider
• Provision on top of Shell, Puppet, Chef
Slide 19
Slide 19 text
What's next?
• Datacenter like a single pool of resources
• Infrastructure pipeline
• Immutable servers
• Continuous integration to continuous deployment