Rapid dev env DevOps Warsaw July 2014

Preview:

DESCRIPTION

 

Citation preview

RAPID DEV ENVIRONMENTS

Przemek Hejman - Marcin Brański

MACHINE IMAGE

PACKER.IO

{ "builders": [ { "type": "amazon-ebs", "access_key": " "secret_key": " "region": "ap-northeast-1",

"source_ami": "ami-bfdaa2be", "instance_type": "t1.micro", "ssh_username": "ubuntu",

"ami_name": "packer-quick-start {{timestamp}}" } ],

"provisioners": [ { "type": "puppet-masterless", "manifest_file": "site.pp", "module_paths": [ "./modules" ] } ]}

node default {

class { '::ntp': servers => [ 'ntp1.corp.com', 'ntp2.corp.com' ], }

cron { 'taki_sobie_maintenance': command => "/usr/bin/skrypt_robiacy_porzadek.sh", user => root, hour => 5, minute => 0, }

$str = "Jestem DNSem google"

if $::ipaddress_eth0 == "8.8.8.8" { file { '/root/pliczQ': ensure => present, content => "$str", owner => root, group => root, mode => '644', } }

}

packer build

Vagrant

Vagrantfile

vagrant up

vagrant-awsvagrant-azurevagrant-brightboxvagrant-cloudstackvagrant-digitaloceanvagrant-ganetivagrant-hpvagrant-joyentvagrant-kvmvagrant-libvirtvagrant-lxc

vagrant-managed-serversvagrant-openstackvagrant-openvzvagrant-parallelsvagrant-proxmoxvagrant-rackspacevagrant-softlayervagrant-vcloudvagrant-vspherevagrant-windows-hyperv

● Infrastructure as Code;● Deklaratywny język, czytelna

konfiguracja;● Proste zarządzanie,

wprowadzanie zmian;● Dokumentacja infrastruktury;

Provisioning

# yum install nrpe

# aptitude install nagios-nrpe-server

Ze względu na koszty i bycie trendy, przenosimy

wszystko w chmurę!!!

Zmienimy serwery HTTP na NGINX, dodajcie klucz ssh użytkownika janusz, zróbmy upgrade tomcata, niech logowanie będzie po certyfikacie, olejmy rsysloga,może podepniemy też nagiosa…

PUPPET VS. CHEF VS. ANSIBLE VS. SALT VS. FABRIC ??

PUPPET

CHEF

ANSIBLE

SALTnginx: pkg: - installed service: - running - require: - pkg: nginx

/var/www/index.html:

file: - managed - source: salt://webserver/index.html - require: - pkg: nginx

PUPPET VS. CHEF VS. ANSIBLE VS. SALT VS. FABRIC ??

YES.

READY-TO-GO

Bare Metal

Hardware Assisted

DockerfileFROM e1337h4xx/saltwheezyMAINTAINER 3h4xRUN apt-get -qq updateRUN apt-get install -y wgetRUN echo "deb http://pkg.jenkins-ci.org/debian binary/" >> /etc/apt/sources.listRUN wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | apt-key add -RUN apt-get -qq updateRUN apt-get upgrade -yRUN apt-get install -y jenkinsEXPOSE 8080CMD (/etc/init.d/jenkins start && sleep 5 && tailf /var/log/jenkins/jenkins.log)VOLUME ["/var/lib/jenkins", "/var/log/jenkins"]

docker run

What docker can do for you

fig up

Time comparison

docker <1s vagrant up > 30s

Vagrant and Docker

NEXT? ● Jenkins CI● Continuous Deployment● Automated Testing● Demo● Microservices

Thanks!

Recommended