This document provides an overview of a presentation on building agile infrastructures. It introduces the presenter, Antons Kranga, and his background. It then outlines the goals of DevOps in bringing developers and operations teams together through practices like Agile and ITIL. The presentation will discuss strategies for adopting a DevOps model, including provisioning continuous integration, automating infrastructure testing, and provisioning QA and production environments using tools like Chef, Vagrant, Jenkins, Nexus, and Test Kitchen. It will also cover techniques for automating infrastructure like configuration management with Chef recipes and testing infrastructure with tools like Chaos Monkey.
3. Presenter
Antons Kranga
- Technology Architect at Accenture
- 10+ years Enterprise Java Developmentg
antons.kranga@accenture.com
- Areas of work:
- Open Source activist
- DevOps evangelist
- Technical and OO Trainer
- Cloud and PaaS development
antons.kranga@me.com
http://www.linkedin.com/in/antonskranga
14. DevOps adoption scenario
Provision Continuous Integration
Personal Development Environment
Automate Infrastructure Testing
Provision QA, Prod Environment
AT for Infrastructure
17. Infrastructure as Code
include_recipe “java“
package "tomcat6“
artifact_deploy "tomcat6“ do
version "latest“
artifact_location "foo.war"
deploy_to node[:tomcat]
[:work_dir]
end
service "tomcat6" do
action [:enable, :start]
end
- Written declaratively
(just enough ruby DSL)
- Repeatable
- OS agnostic
- Source control
- Active community
(tons of ready to use
cookbooks)
18. Example
include_recipe “java“
package "tomcat6“
artifact_deploy "tomcat6“ do
version "latest“
artifact_location "foo.war"
deploy_to node[:tomcat]
[:work_dir]
end
service "tomcat6" do
action [:enable, :start]
end
OS Type: RedHat
OS Version: 6.2
Tomcat Home: /etc/tomcat
Tomcat Port: 8080
MySQL IP: 10.10.0.1
MySQL Root Password:
password
Attributes
Recipe
OS Specific Instructions
28. DevOps adoption scenario
Provision Continuous Integration
Personal Development Environment
Automate Infrastructure Testing
Provision QA, Prod Environment
AT for Infrastructure
30. Vagrant
- Easy to manage local VM(s)
- Easy to manage multi VM env
- Easy to deal with multi OS env
- Easy to distribute across teams VMs
- Describe VM resources
- Source Control
31. Vagrant
- Easy to manage local VM(s)
shell
- Easy to manage multi VM env
$ vagrant box add precise64 ttp://files.vagrantup.com/precise64.box
- Easy to deal with multi OS env
$ vagrant init
$ vagrant up
- Easy to distribute across teams VMs
- Describe VM resources
- Source Control
32. Vagrant configuration
Vagrant.configure("2") do |config|
config.vm.box = "precise64"
config.vm.network "forwarded_port",
guest: 8080, host: 8080,
auto_correct: true
config.vm.provision "chef_solo" do |chef|
chef.add_recipe "tomcat"
chef.add_recipe "mysql"
end
end
vagrantfile
35. Extending Jenkins Job
start job
pull sources
compile project
run unit tests
run integr tests
publish to Nexus
…
36. Extending Jenkins Job
start job
pull sources
compile project
run unit tests
run integr tests
publish to Nexus
…
provision VM
37. Extending Jenkins Job
start job
pull sources
compile project
run unit tests
run integr tests
provision VM
configure
publish to Nexus
…
38. Extending Jenkins Job
start job
pull sources
compile project
run unit tests
run integr tests
provision VM
configure
run tests
publish to Nexus
…
39. Extending Jenkins Job
start job
pull sources
compile project
run unit tests
run integr tests
provision VM
configure
run tests
publish to Nexus
…
destroy VM
40. DevOps adoption scenario
Provision Continuous Integration
Personal Development Environment
Automate Infrastructure Testing
Provision QA, Prod Environment
AT for Infrastructure
45. source 'https://rubygems.org'
gem 'test-kitchen', '~> 1.0'
group :integration do
gem 'kitchen-vagrant', '~> 0.11'
end
Gemfile
---
driver_plugin: vagrant
driver_config:
require_chef_omnibus: true
platforms:
- name: ubuntu-12.04
- name: centos-6.4
suites:
- name: default
run_list:
- recipe[my_cookbook]
attributes: {}
.kitchen.yml
@test "tmux is installed and in the
path" {
which tmux
}
@test "tmux configuration exists" {
cat /etc/tmux.conf | grep "map“
}
tests
Chef Cookbooks
46. source 'https://rubygems.org'
gem 'test-kitchen', '~> 1.0'
group :integration do
gem 'kitchen-vagrant', '~> 0.11'
end
shell
$ bundle exec kitchen test
Gemfile
---
driver_plugin: vagrant
driver_config:
require_chef_omnibus: true
platforms:
- name: ubuntu-12.04
- name: centos-6.4
suites:
- name: default
run_list:
- recipe[my_cookbook]
attributes: {}
.kitchen.yml
@test "tmux is installed and in the
path" {
which tmux
}
@test "tmux configuration exists" {
cat /etc/tmux.conf | grep "map“
}
tests
Chef Cookbooks
47. source 'https://rubygems.org'
gem 'test-kitchen', '~> 1.0'
group :integration do
gem 'kitchen-vagrant', '~> 0.11'
end
shell
$ bundle exec kitchen test
Gemfile
---
driver_plugin: vagrant
driver_config:
require_chef_omnibus: true
platforms:
- name: ubuntu-12.04
- name: centos-6.4
suites:
- name: default
run_list:
- recipe[my_cookbook]
attributes: {}
.kitchen.yml
@test "tmux is installed and in the
path" {
which tmux
}
@test "tmux configuration exists" {
cat /etc/tmux.conf | grep "map“
}
tests
Chef Cookbooks
48. source 'https://rubygems.org'
gem 'test-kitchen', '~> 1.0'
group :integration do
gem 'kitchen-vagrant', '~> 0.11'
end
shell
$ bundle exec kitchen test
Gemfile
---
driver_plugin: vagrant
driver_config:
require_chef_omnibus: true
platforms:
- name: ubuntu-12.04
- name: centos-6.4
suites:
- name: default
run_list:
- recipe[my_cookbook]
attributes: {}
.kitchen.yml
@test "tmux is installed and in the
path" {
which tmux
}
Jenkins CI?
@test "tmux configuration exists" {
cat /etc/tmux.conf | grep "map“
}
tests
Chef Cookbooks
49. source 'https://rubygems.org'
gem 'test-kitchen', '~> 1.0'
group :integration do
gem 'kitchen-vagrant', '~> 0.11'
end
shell
$ bundle exec kitchen test
Gemfile
---
driver_plugin: vagrant
driver_config:
require_chef_omnibus: true
Don’t forget Food
critic
platforms:
- name: ubuntu-12.04
- name: centos-6.4
acrmp.github.io/foodcritic
suites:
- name: default
run_list:
- recipe[my_cookbook]
attributes: {}
.kitchen.yml
@test "tmux is installed and in the
path" {
which tmux
}
Jenkins CI?
@test "tmux configuration exists" {
cat /etc/tmux.conf | grep "map“
}
tests
Chef Cookbooks
50. DevOps adoption scenario
Provision Continuous Integration
Personal Development Environment
Automate Infrastructure Testing
Provision QA, Prod Environment
AT for Infrastructure
51. Environment at Local, On Premises or Cloud
chef-solo
ssh
Automation:
1.Env Provisioning
2.Configuration
52. Environment at Local, On Premises or Cloud
ssh
Automation:
1.Env Provisioning
2.Configuration
Automation:
1.Service Discovery
2.Server Integration
3.Deployment
Server
57. Environment Provisioning
Test team
Test Env VMs
Test VM
Test VM
Test VM
Dev VM
verify
deploy
java
code
push
Dev Workstation
Clients
pull
CI Server VM
UAT Env VMs
Test VM
Test VM
Test VM
58. DevOps adoption scenario
Provision Continuous Integration
Personal Development Environment
Automate Infrastructure Testing
Provision QA, Prod Environment
AT for Infrastructure
61. Provision your infra in AWS
Deploy your System (if applicable)
Enable Maximum Logging
Configure Simian Army
Make sure that Devs are seeing the show!
62. Check out other beasts
in
Simian Army
(github.com/Netflix/SimianArmy)
63. Chaos Monkey
Chaos Gorilla
Will destroy an entire zone
Latency Monkey
Inspects and introduces latency
Howler Monkey
Looks for overused resources
Security Monkey
Ensures certs are not expiring soon, etc.
Janitor Monkey
Cleans-up unused resources
64. DevOps adoption scenario
Provision Continuous Integration
Personal Development Environment
Automate Infrastructure Testing
Provision QA, Prod Environment
AT for Infrastructure