antons kranga building agile infrastructures

Post on 06-May-2015

809 Views

Category:

Technology

2 Downloads

Preview:

Click to see full reader

DESCRIPTION

Antons Kranga speaking at DevConfu Conference, Riga November 2013.

TRANSCRIPT

Partners:

Building Agile Infrastructures

November 2013

Presenter

- Technology Architect at Accenture

- 10+ years Enterprise Java Developmentg

- Areas of work: - Open Source activist - DevOps evangelist - Technical and OO Trainer - Cloud and PaaS development

antons.kranga@accenture.com antons.kranga@me.com http://www.linkedin.com/in/antonskranga

Antons Kranga

This talk is not

Developers vs Operations

This talk is not

demanding to fire sysadmins

This talk is not

asking to rebuild your org

How fast you setup new project?

How fast you setup new project?

What is your operational model?

Agile ITILbuild & release deploy & support

Devs Ops

Goals of DevOps

Agile ITILbuild & release

Release notes

deploy & support

Devs Opsincidents

Goals of DevOps

Agile ITILbuild & release

Release notes

deploy & support

Devs Opsincidents

Goals of DevOps

Agile Agilebuild & release

Learn

deploy & support

Devs OpsLearn

Goals of DevOps

Provision Continuous Integration

Personal Development Environment

Automate Infrastructure Testing

Provision QA, Prod Environment

AT for Infrastructure

DevOps adoption scenario

Opscode

Infrastructure as Code

- Written declaratively (just enough ruby DSL)

- Repeatable

- OS agnostic

- Source control

- Active community (tons of ready to use cookbooks)

Infrastructure as Codeinclude_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

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

RecipeAttributes

OS Specific Instructions

Example

Jenkins CINexus

Jenkins CINexus

Push Code

Jenkins CINexus

Push Code

Detect Change

Run Unit TestsRun build

Jenkins CINexus

Push Code

Detect Change

Run Unit TestsRun build

Publish

Snapshot Repo

Jenkins CINexus

Push Code

Detect Change

Run Unit TestsRun build

Publish

Snapshot Repo

Jenkins CINexus

Push Code

Detect Change

Run Unit TestsRun build

Publish

Snapshot Repo

Run Analytics

Code quality report

Jenkins CINexus

Push Code

Detect Change

Run Unit TestsRun build

Publish

Snapshot Repo

Run Analytics

Code quality report

Release Repo

Dev Workstation

java code

Provision CI Server

Dev Workstation

java code

CI Server VMpush

pull

Provision CI Server

Provision Continuous Integration

Personal Development Environment

Automate Infrastructure Testing

Provision QA, Prod Environment

AT for Infrastructure

DevOps adoption scenario

Vagrant (www.vagrantup.com)

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

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

shell

$ vagrant box add precise64 ttp://files.vagrantup.com/precise64.box $ vagrant init $ vagrant up

Vagrant configurationVagrant.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

Dev Workstation

java code

CI Server VMpush

pull

Personal Dev Environment

Dev Workstation

java code

CI Server VMpush

pull

Personal Dev Environment

Dev VM

deploy

verify

Extending Jenkins Jobstart job

pull sources compile project run unit tests

run integr tests

publish to Nexus …

Extending Jenkins Jobstart job

pull sources compile project run unit tests

run integr tests

publish to Nexus …

provision VM

Extending Jenkins Jobstart job

pull sources compile project run unit tests

run integr tests

publish to Nexus …

provision VM

configure

Extending Jenkins Jobstart job

pull sources compile project run unit tests

run integr tests

publish to Nexus …

provision VM

configure

run tests

Extending Jenkins Jobstart job

pull sources compile project run unit tests

run integr tests provision VM

configure

run tests

destroy VMpublish to Nexus …

Provision Continuous Integration

Personal Development Environment

Automate Infrastructure Testing

Provision QA, Prod Environment

AT for Infrastructure

DevOps adoption scenario

Test Kitchen (github.com/test-kitchen/test-kitchen)

Chef Cookbooks

source 'https://rubygems.org' gem 'test-kitchen', '~> 1.0' group :integration do gem 'kitchen-vagrant', '~> 0.11' end

Gemfile

Chef Cookbooks

source 'https://rubygems.org' gem 'test-kitchen', '~> 1.0' group :integration do gem 'kitchen-vagrant', '~> 0.11' end

Gemfile

Chef Cookbooks

--- 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

source 'https://rubygems.org' gem 'test-kitchen', '~> 1.0' group :integration do gem 'kitchen-vagrant', '~> 0.11' end

Gemfile

Chef Cookbooks

--- 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: {}

@test "tmux is installed and in the path" { which tmux } @test "tmux configuration exists" { cat /etc/tmux.conf | grep "map“ }

tests

.kitchen.yml

source 'https://rubygems.org' gem 'test-kitchen', '~> 1.0' group :integration do gem 'kitchen-vagrant', '~> 0.11' end

Gemfile

Chef Cookbooks

--- 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: {}

@test "tmux is installed and in the path" { which tmux } @test "tmux configuration exists" { cat /etc/tmux.conf | grep "map“ }

tests

shell

$ bundle exec kitchen test

.kitchen.yml

--- 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: {}

source 'https://rubygems.org' gem 'test-kitchen', '~> 1.0' group :integration do gem 'kitchen-vagrant', '~> 0.11' end

Gemfile

@test "tmux is installed and in the path" { which tmux } @test "tmux configuration exists" { cat /etc/tmux.conf | grep "map“ }

tests

Chef Cookbooks

shell

$ bundle exec kitchen test

.kitchen.yml

--- 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: {}

source 'https://rubygems.org' gem 'test-kitchen', '~> 1.0' group :integration do gem 'kitchen-vagrant', '~> 0.11' end

Gemfile

@test "tmux is installed and in the path" { which tmux } @test "tmux configuration exists" { cat /etc/tmux.conf | grep "map“ }

tests

Chef Cookbooks

shell

$ bundle exec kitchen test

Jenkins CI?

.kitchen.yml

--- 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: {}

source 'https://rubygems.org' gem 'test-kitchen', '~> 1.0' group :integration do gem 'kitchen-vagrant', '~> 0.11' end

Gemfile

@test "tmux is installed and in the path" { which tmux } @test "tmux configuration exists" { cat /etc/tmux.conf | grep "map“ }

tests

Chef Cookbooks

shell

$ bundle exec kitchen test

Jenkins CI?

Don’t forget Food critic

acrmp.github.io/foodcritic

.kitchen.yml

Provision Continuous Integration

Personal Development Environment

Automate Infrastructure Testing

Provision QA, Prod Environment

AT for Infrastructure

DevOps adoption scenario

Automation: 1.Env Provisioning 2.Configuration

ssh

Environment at Local, On Premises or Cloud

chef-solo

Automation: 1.Env Provisioning 2.Configuration

ssh

Automation: 1.Service Discovery 2.Server Integration 3.Deployment

Environment at Local, On Premises or Cloud

Server

Dev Workstation

java code

CI Server VMpush

pull

Environment Provisioning

Dev VM

deploy

verify

Dev Workstation

java code

CI Server VMpush

pull

Environment Provisioning

Dev VM

deploy

verify

Test Env VMs

Test team

Dev Workstation

java code

CI Server VMpush

pull

Environment Provisioning

Dev VM

deploy

verify

Test team

Test VMTest VM

Test VMTest Env VMs

Dev Workstation

java code

CI Server VMpush

pull

Environment Provisioning

Dev VM

deploy

verify

Test team

Test VMTest VM

Test VMTest Env VMs

Dev Workstation

java code

CI Server VMpush

pull

Environment Provisioning

Dev VM

deploy

verify

Test team

Test VMTest VM

Test VMTest Env VMs

Test VMTest VM

Test VMUAT Env VMs

Clients

Provision Continuous Integration

Personal Development Environment

Automate Infrastructure Testing

Provision QA, Prod Environment

AT for Infrastructure

DevOps adoption scenario

Chaos Monkey (github.com/Netflix/SimianArmy)

Chaos Monkey (github.com/Netflix/SimianArmy)

Warning!!! There will be mess!!!

Provision your infra in AWS

Deploy your System (if applicable)

Enable Maximum Logging

Configure Simian Army

Make sure that Devs are seeing the show!

Check out other beasts in Simian Army (github.com/Netflix/SimianArmy)

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

Provision Continuous Integration

Personal Development Environment

Automate Infrastructure Testing

Provision QA, Prod Environment

AT for Infrastructure

DevOps adoption scenario

What is besides Chef?

Bosh (github.com/cloudfoundry/bosh)

- Extracted from Cloud Foundry

- Harness for your IaaS

- Automates

- Environment Provisioning

- Health Checks

- Scalability

- Logs Collection

Bosh

Docker (docker.io)

- Handles LXC VM management

- LXC supported by Linux Kernel 2.6

- Slicing Large instances

- Lightweight environment provisioning

- Provides Application Isolation

Docker

Thank You!

☺ ☹!

Feedback

Partners:

top related