Successfully reported this slideshow.
Devs are from Mars,
Ops are from Venus
Alex Recarey
@alexrecarey

Jose Ignacio Galarza
@igalarzab
wtf is devops?
collaboration
config management

capacity planning
infrastructure as code

devops
monitoring
cross functional skills

trou...
why?
because ops suck...
fear of change
risky deployments
dev != ops
machine = snowflake
firefighting mentality
when did this
start?
(33% US internet bandwidth 2012)
the same work
has to be done
but it can be done in a
different way
the same work
has to be done

e
m

o be done in a
but itecan
s
w
A different way
Over the last year a

community
has been formed
devopsdays.org

#monitoringsucks

#devops

devopsweekly.com

dev2ops.org

codeascraft.etsy.com
Collaboration
Not sexy, but
important
Dev

Ops
DevOps
Configuration
Management
sexy & important
“it works for me”
Hand crafted config

Prehistory
“don’t touch the
production server”

Shell scripts
“it works for me”
Hand crafted config

Present day
“don’t touch the
production server”

Shell scripts
turning an art

into

an assembly line
Infrastructure
as code
versioned
+
automated
+
repeatable
10’s to 1,000’s of servers

scale
1 a month to 5 deployments a day
nd
ld a n
O e
rov
p

CF Engine
tp
os
M

nd
ip a
H
ool
c

lar
pu
o

Puppet

Salt

Chef

Ansible Juju
Choose one,
use it
Monitoring
Measure everything
Monitoring is crucial for ops
Can also be fun
Debugging without logs is hell
Logging
Should be centralized
&
Web accessible
Self Hosted

rsyslog logstash

aaS

greylog

scalyr papertrail loggly
Graphing
Should be centralized,
Web accessible
&
easy to add metrics
Self Hosted

graphite statsd
scalyr

aaS

nagios

new relic cloudwatch
Alerting
Should be escalating
&
reliable
Self Hosted
(don’t)

aaS

opsgenie pingdom cloudwatch
Deployment
Make the
Feedback Loop
Shorter
Artists have a very short

feedback loop
programmers, not so much

xkcd.com
need

we
to change this
are

we
changing this
Computer scientists have been
reducing the time to iteration
ny
ago

Rewiring circuits
Punching cards

ror
hor

Waiting fo...
ble
ara
be

Your own PC!
Compile software

ool
c

Dynamic languages!
Deploy software

a

e!
som
we

Continuous Deployment
minimum viable
product
continuous
integration
continuous
deployment
Example!
How about
Instagram?
three dudes and an idea...
hacked over a couple of weeks

BOOM!
Massive growth!
Oh oh...
How do you avoid downtime?
How do you continue to deliver features?
How do you keep in front when 200 people
copy...
DevOps
let’s get
practical
chef server
nodes
workstation
bring your own chef server
nginx
Web UI

Erchef

search index

PostgreSQL

Bookshelf

cookbooks
hosted chef...
aka: I’m too lazy to install all that stuff

it’s free up to five machines
all the work is done!
first steps...
Register your account in Hosted Chef
Clone the official Opscode Repo (Git)
Download the three magical files
...
chef server
nodes
workstation
each machine controlled by the
chef server is called

node
each node authenticates with the

chef server via RSA keys
after that, the node connects periodically to:
update attribute...
chef server
nodes
workstation
each machine with the rights to
control the chef server is a

workstation
we use

knife
to give instructions
to the chef server
well, it’s more like a...
cookbooks
recipes
attributes
roles
cookbook

a
is
the fundamental unit of
configuration of chef
you can create a new cookbook with knife
$ knife cookbook create ntp

or install one from the community
$ knife cookbook s...
$ ls -l cookbooks/ntp
CHANGELOG.md
README.md
attributes/
definitions/
files/
libraries/
metadata.rb
providers/
recipes/
/d...
$ cat metadata.rb
name "Chuck Norris"
maintainer "Chuck Norris"
maintainer_email "chuck@norris.com"
license "WTF Public Li...
after coding, remember
to upload it to the
chef server!
$ knife cookbook upload nginx
cookbooks
recipes
attributes
roles
a cookbook is divided
into recipes,
these are just Ruby code
$ cat ntp/recipes/default.rb
package "ntp" do
action :install
end
template "/etc/ntp.conf" do
source "ntp.conf.erb"
mode 0...
$ cat ntp/templates/ntp.conf.erb
# This file was generated by Chef for
# Machine:'<%= node['fqdn'] %>'.
# Do NOT edit this...
cookbooks
recipes
attributes
roles
an attribute is a piece of data about
the node, such as a network interface or
the IP to bind a service
$ cat ntp/attributes/default.rb
default["ntp"]["server1"] = "0.pool.ntp.org"
default["ntp"]["server2"] = "127.127.1.0"

th...
cookbooks
recipes
attributes
roles
collections of
cookbooks to execute
and attributes to apply
$ cat ../roles/ntp-server.rb

name "ntp-server"
description "NTP Server"
run_list(
"recipe[ntp]",
"recipe[ntp::default]"
)
ok, ok...

but, how can I create
a new node?
just create a new clean machine and...
on vagrant/virtualbox/“normal server”/...

$ knife bootstrap localhost 
--ssh-user ...
demooooooooo
cloud
services
cloud computing is the use of
computing resources that are delivered
as a service over a network (typically
the Internet)
...
gce

rackspace
RDS

EBS
VPC
SNS
CloudFront
CloudWatch
EC2
SQS
SES S3
Elastic Cache
Route53
SWF
ELB
DynamoDB
Glacier
Auto Scaling
Elastic ...
EC2 is the cloud computing
solution of AWS,
you give them money,
they give you machines
S3 is the massive data store
solution of AWS,
you give them money,
they store your files
RDS is the relational
database solution of AWS,
you give them money,
they manage your DB
ELB is the load balancer
solution of AWS,
you give them money,
they balance your load
Auto Scaling is the automatic,
load sensitive machine
provisioning solution of AWS,
you give them money,
they give you mac...
talk is cheap

show me the code
questions?
thanks for coming
DevOps
DevOps
Upcoming SlideShare
Loading in …5
×

DevOps

1,322 views

Published on

Introductory talk about DevOps world and Amazon AWS

  • Be the first to comment

DevOps

  1. 1. Devs are from Mars, Ops are from Venus Alex Recarey @alexrecarey Jose Ignacio Galarza @igalarzab
  2. 2. wtf is devops?
  3. 3. collaboration config management capacity planning infrastructure as code devops monitoring cross functional skills trouble shooting deployment
  4. 4. why?
  5. 5. because ops suck...
  6. 6. fear of change risky deployments dev != ops
  7. 7. machine = snowflake firefighting mentality
  8. 8. when did this start?
  9. 9. (33% US internet bandwidth 2012)
  10. 10. the same work has to be done but it can be done in a different way
  11. 11. the same work has to be done e m o be done in a but itecan s w A different way
  12. 12. Over the last year a community has been formed
  13. 13. devopsdays.org #monitoringsucks #devops devopsweekly.com dev2ops.org codeascraft.etsy.com
  14. 14. Collaboration
  15. 15. Not sexy, but important
  16. 16. Dev Ops
  17. 17. DevOps
  18. 18. Configuration Management
  19. 19. sexy & important
  20. 20. “it works for me” Hand crafted config Prehistory “don’t touch the production server” Shell scripts
  21. 21. “it works for me” Hand crafted config Present day “don’t touch the production server” Shell scripts
  22. 22. turning an art into an assembly line
  23. 23. Infrastructure as code
  24. 24. versioned + automated + repeatable
  25. 25. 10’s to 1,000’s of servers scale 1 a month to 5 deployments a day
  26. 26. nd ld a n O e rov p CF Engine tp os M nd ip a H ool c lar pu o Puppet Salt Chef Ansible Juju
  27. 27. Choose one, use it
  28. 28. Monitoring
  29. 29. Measure everything
  30. 30. Monitoring is crucial for ops Can also be fun Debugging without logs is hell
  31. 31. Logging Should be centralized & Web accessible
  32. 32. Self Hosted rsyslog logstash aaS greylog scalyr papertrail loggly
  33. 33. Graphing Should be centralized, Web accessible & easy to add metrics
  34. 34. Self Hosted graphite statsd scalyr aaS nagios new relic cloudwatch
  35. 35. Alerting Should be escalating & reliable
  36. 36. Self Hosted (don’t) aaS opsgenie pingdom cloudwatch
  37. 37. Deployment
  38. 38. Make the Feedback Loop Shorter
  39. 39. Artists have a very short feedback loop
  40. 40. programmers, not so much xkcd.com
  41. 41. need we to change this
  42. 42. are we changing this
  43. 43. Computer scientists have been reducing the time to iteration ny ago Rewiring circuits Punching cards ror hor Waiting for turn at the terminal
  44. 44. ble ara be Your own PC! Compile software ool c Dynamic languages! Deploy software a e! som we Continuous Deployment
  45. 45. minimum viable product continuous integration continuous deployment
  46. 46. Example!
  47. 47. How about Instagram?
  48. 48. three dudes and an idea... hacked over a couple of weeks BOOM! Massive growth!
  49. 49. Oh oh... How do you avoid downtime? How do you continue to deliver features? How do you keep in front when 200 people copy your app?
  50. 50. DevOps
  51. 51. let’s get practical
  52. 52. chef server nodes workstation
  53. 53. bring your own chef server nginx Web UI Erchef search index PostgreSQL Bookshelf cookbooks
  54. 54. hosted chef... aka: I’m too lazy to install all that stuff it’s free up to five machines all the work is done!
  55. 55. first steps... Register your account in Hosted Chef Clone the official Opscode Repo (Git) Download the three magical files knife.rb, validation-key.pem, USER.pem
  56. 56. chef server nodes workstation
  57. 57. each machine controlled by the chef server is called node
  58. 58. each node authenticates with the chef server via RSA keys after that, the node connects periodically to: update attributes execute the run-list ... and other stuff
  59. 59. chef server nodes workstation
  60. 60. each machine with the rights to control the chef server is a workstation
  61. 61. we use knife to give instructions to the chef server
  62. 62. well, it’s more like a...
  63. 63. cookbooks recipes attributes roles
  64. 64. cookbook a is the fundamental unit of configuration of chef
  65. 65. you can create a new cookbook with knife $ knife cookbook create ntp or install one from the community $ knife cookbook site install nginx
  66. 66. $ ls -l cookbooks/ntp CHANGELOG.md README.md attributes/ definitions/ files/ libraries/ metadata.rb providers/ recipes/ /default.rb resources/ templates/
  67. 67. $ cat metadata.rb name "Chuck Norris" maintainer "Chuck Norris" maintainer_email "chuck@norris.com" license "WTF Public License" version "1.0.0" depends "sudo"
  68. 68. after coding, remember to upload it to the chef server! $ knife cookbook upload nginx
  69. 69. cookbooks recipes attributes roles
  70. 70. a cookbook is divided into recipes, these are just Ruby code
  71. 71. $ cat ntp/recipes/default.rb package "ntp" do action :install end template "/etc/ntp.conf" do source "ntp.conf.erb" mode 0644 owner "root" group "root" notifies :restart, "service[ntpd]") end service "ntpd" do action [:enable, :start] end
  72. 72. $ cat ntp/templates/ntp.conf.erb # This file was generated by Chef for # Machine:'<%= node['fqdn'] %>'. # Do NOT edit this file by hand! restrict default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery restrict 127.0.0.1 restrict -6 ::1 server '0.pool.ntp.org' server 127.127.1.0 driftfile /var/lib/ntp/drift keys /etc/ntp/keys
  73. 73. cookbooks recipes attributes roles
  74. 74. an attribute is a piece of data about the node, such as a network interface or the IP to bind a service
  75. 75. $ cat ntp/attributes/default.rb default["ntp"]["server1"] = "0.pool.ntp.org" default["ntp"]["server2"] = "127.127.1.0" the attributes can be overridden in multiple levels
  76. 76. cookbooks recipes attributes roles
  77. 77. collections of cookbooks to execute and attributes to apply
  78. 78. $ cat ../roles/ntp-server.rb name "ntp-server" description "NTP Server" run_list( "recipe[ntp]", "recipe[ntp::default]" )
  79. 79. ok, ok... but, how can I create a new node?
  80. 80. just create a new clean machine and... on vagrant/virtualbox/“normal server”/... $ knife bootstrap localhost --ssh-user vagrant --ssh-password vagrant --ssh-port 2222 --sudo --run-list "recipe[ntp]" on EC2 $ knife ec2 server create -r 'role[ntp-server]' -I ami-3d4ff254 -x ubuntu -i KEY -g GROUP
  81. 81. demooooooooo
  82. 82. cloud services
  83. 83. cloud computing is the use of computing resources that are delivered as a service over a network (typically the Internet) - wikipedia
  84. 84. gce rackspace
  85. 85. RDS EBS VPC SNS CloudFront CloudWatch EC2 SQS SES S3 Elastic Cache Route53 SWF ELB DynamoDB Glacier Auto Scaling Elastic Beanstalk Cloud Formation
  86. 86. EC2 is the cloud computing solution of AWS, you give them money, they give you machines
  87. 87. S3 is the massive data store solution of AWS, you give them money, they store your files
  88. 88. RDS is the relational database solution of AWS, you give them money, they manage your DB
  89. 89. ELB is the load balancer solution of AWS, you give them money, they balance your load
  90. 90. Auto Scaling is the automatic, load sensitive machine provisioning solution of AWS, you give them money, they give you machines on load
  91. 91. talk is cheap show me the code
  92. 92. questions?
  93. 93. thanks for coming

×