DevOps	
  with	
  Chef	
  and	
  Azure	
  
Ma6	
  Stra6on	
  
@ma6stra6on	
  
Who	
  Am	
  I?	
  
Ma6	
  Stra6on	
  
Solu?ons	
  Architect	
  at	
  CHEF	
  SoDware,	
  
Inc	
  
Host	
  of	
  Arrested	
  DevOps	
  podcast	
  
DevOpsDays	
  Chicago	
  organizer	
  
Previously	
  sysadmin,	
  Tech	
  Ops	
  Director,	
  Azure	
  V-­‐TSP,	
  
infrastructure	
  consultant,	
  yada	
  yada	
  yada	
  
“DevOps	
  is	
  a	
  cultural	
  and	
  professional	
  movement.	
  Period.	
  That’s	
  
it…	
  There’s	
  no	
  technology,	
  you	
  can’t	
  patent	
  ‘devops’.”	
  –	
  Adam	
  
Jacob,	
  Velocity	
  2010	
  
DevOps	
  can	
  be	
  summarized	
  with	
  
CAMS	
  –	
  Culture,	
  Automa?on,	
  
Measurement,	
  and	
  Sharing.	
  All	
  are	
  
important.	
  
Managing	
  complexity	
  –	
  two	
  worlds.	
  	
  
	
  
Ops	
  starts	
  by	
  making	
  with	
  the	
  clicky	
  clicky,	
  and	
  dev	
  starts	
  wri?ng	
  some	
  code	
  
We	
  get	
  a	
  li6le	
  be6er	
  –	
  ops	
  keeps	
  some	
  notes,	
  and	
  the	
  devs	
  test	
  things	
  on	
  a	
  dev	
  
server.	
  
Hey,	
  let’s	
  put	
  our	
  notes	
  into	
  a	
  wiki	
  and	
  start	
  sharing	
  with	
  the	
  rest	
  of	
  ops!	
  And	
  
devs	
  start	
  sharing	
  with	
  each	
  other	
  via	
  version	
  control.	
  
Now	
  ops	
  starts	
  wri?ng	
  some	
  scripts	
  to	
  some	
  kind	
  of	
  repeatability,	
  and	
  devs	
  get	
  
QA	
  involved	
  
I	
  know!	
  Let’s	
  use	
  golden	
  images	
  
Golden	
  images	
  are	
  not	
  the	
  answer.	
  Gold	
  is	
  heavy.	
  It’s	
  hard	
  to	
  transport.	
  Its	
  
hard	
  to	
  mold.	
  And	
  easy	
  to	
  lose	
  configura?on	
  detail.	
  
This	
  won’t	
  scale	
  or	
  let	
  you	
  move	
  fast.	
  There’s	
  no	
  feedback	
  loop	
  from	
  ops	
  to	
  dev,	
  and	
  
the	
  devs	
  aren’t	
  coordina?ng	
  with	
  ops	
  
What	
  is	
  Chef?	
  
	
  
Open	
  Source	
  Framework	
  for	
  managing	
  complexity	
  
Declara?ve	
  language	
  for	
  describing	
  &	
  configuring	
  infrastructure	
  
An	
  awesome	
  community	
  of	
  professionals	
  
A	
  fast-­‐growing	
  company	
  based	
  in	
  Sea6le,	
  WA	
  
	
  
How	
  does	
  Chef	
  work?	
  
	
  
Ensures	
  desired	
  state	
  by	
  con?nually	
  tes?ng	
  and	
  repairing	
  individual	
  resources	
  in	
  the	
  
system	
  
You	
  compose	
  policies	
  using	
  a	
  series	
  of	
  simple	
  declara?ons	
  
The	
  Chef	
  client	
  fetches	
  those	
  policies	
  from	
  a	
  central	
  server	
  and	
  applies	
  them	
  to	
  the	
  
local	
  machine	
  
The	
  state	
  of	
  the	
  machine	
  is	
  recorded	
  and	
  sent	
  back	
  to	
  a	
  database,	
  where	
  it	
  is	
  indexed	
  for	
  search,	
  repor?ng,	
  and	
  audit.	
  	
  
Infrastructure	
  as	
  Cod	
  in	
  a	
  nutshell:	
  
	
  
Define	
  Policy	
  That	
  Describes	
  Your	
  Infrastructure	
  
An	
  Autonomous	
  Agent	
  Implements	
  Your	
  Policy	
  
Policy	
  Enforcement	
  is	
  Con?nuous	
  and	
  Safe	
  
Automate	
  All	
  Your	
  Infrastructure	
  at	
  Scale	
  	
  
Build	
  Anything!	
  
	
  
Simple	
  internal	
  applica?ons	
  
Complex	
  external	
  applica?ons	
  
Worksta?ons	
  
Hadoop	
  clusters	
  
IaaS	
  infrastructure	
  
PaaS	
  infrastructure	
  
SaaS	
  applica?ons	
  
Storage	
  systems	
  
You	
  name	
  it	
  
	
  
And	
  manage	
  it	
  simply:	
  Automa?cally	
  reconfigure	
  everything	
  
Linux,	
  Windows,	
  Unixes,	
  BSDs	
  
Load	
  balancers	
  
Metrics	
  collec?on	
  systems	
  
Monitoring	
  systems	
  
Cloud	
  migra?ons	
  become	
  trivial	
  
DevOps	
  is	
  a	
  Two-­‐Way	
  Street	
  
	
  
It’s	
  great	
  when	
  developers	
  care	
  about	
  
Up?me!	
  
Scaling!	
  
Deployment!	
  
Put	
  them	
  on	
  call!	
  	
  etc.	
  etc.	
  etc.	
  
How	
  can	
  we	
  work	
  TOGETHER?	
  
Ops	
  has	
  as	
  much,	
  or	
  MORE,	
  to	
  learn	
  
from	
  dev.	
  
“Old”	
  SoDware	
  Development	
  Workflow	
  
	
  
Write	
  some	
  code	
  
<ad-­‐hoc	
  verifica?on	
  here>	
  
Go	
  to	
  pre-­‐produc?on	
  
<ad-­‐hoc	
  verifica?on	
  here>	
  
Go	
  to	
  produc?on	
  
ProducHon	
  failure	
  
Modern	
  SoDware	
  Development	
  workflow	
  
	
  
Write	
  some	
  code	
  
Write	
  and	
  run	
  some	
  unit	
  tests	
  
Go	
  to	
  pre-­‐produc?on	
  
Run	
  some	
  integraHon/acceptance	
  tests	
  
Go	
  to	
  produc?on	
  
Lowered	
  chance	
  of	
  producHon	
  failure	
  
Old	
  Chef	
  Cookbook	
  Workflow	
  
Write	
  some	
  cookbook	
  code	
  
<ad-­‐hoc	
  verifica?on	
  here>	
  
Go	
  to	
  pre-­‐produc?on	
  
<ad-­‐hoc	
  verifica?on	
  here	
  
Go	
  to	
  produc?on	
  
Whoops,	
  broke	
  producHon	
  
New	
  Chef	
  Cookbook	
  Workflow	
  
Write	
  some	
  cookbook	
  code	
  
Check	
  for	
  code	
  correctness	
  
Write	
  and	
  run	
  some	
  unit	
  tests	
  
Go	
  to	
  pre-­‐produc?on	
  
Run	
  some	
  integraHon	
  tests	
  
Go	
  to	
  produc?on	
  
Demo	
  of	
  Azure	
  and	
  Chef	
  integra?on.	
  See	
  h6p://youtu.be/wOj03WZHIr4	
  for	
  a	
  similar	
  
demo.	
  
CONTACTS	
  AND	
  LINKS	
  •	
  Tonight’s	
  code	
  -­‐	
  h6ps://github.com/ma6stra6on/	
  alm-­‐
demo-­‐repo	
  •	
  ma6stra6on@chef.io	
  •	
  @ma6stra6on	
  on	
  Twi6er	
  •	
  h6p://
arresteddevops.com	
  •	
  h6p://learn.chef.io	
  

DevOps With Chef and Azure

  • 1.
    DevOps  with  Chef  and  Azure   Ma6  Stra6on   @ma6stra6on  
  • 2.
    Who  Am  I?   Ma6  Stra6on   Solu?ons  Architect  at  CHEF  SoDware,   Inc   Host  of  Arrested  DevOps  podcast   DevOpsDays  Chicago  organizer   Previously  sysadmin,  Tech  Ops  Director,  Azure  V-­‐TSP,   infrastructure  consultant,  yada  yada  yada  
  • 3.
    “DevOps  is  a  cultural  and  professional  movement.  Period.  That’s   it…  There’s  no  technology,  you  can’t  patent  ‘devops’.”  –  Adam   Jacob,  Velocity  2010  
  • 4.
    DevOps  can  be  summarized  with   CAMS  –  Culture,  Automa?on,   Measurement,  and  Sharing.  All  are   important.  
  • 5.
    Managing  complexity  –  two  worlds.       Ops  starts  by  making  with  the  clicky  clicky,  and  dev  starts  wri?ng  some  code  
  • 6.
    We  get  a  li6le  be6er  –  ops  keeps  some  notes,  and  the  devs  test  things  on  a  dev   server.  
  • 7.
    Hey,  let’s  put  our  notes  into  a  wiki  and  start  sharing  with  the  rest  of  ops!  And   devs  start  sharing  with  each  other  via  version  control.  
  • 8.
    Now  ops  starts  wri?ng  some  scripts  to  some  kind  of  repeatability,  and  devs  get   QA  involved  
  • 9.
    I  know!  Let’s  use  golden  images  
  • 10.
    Golden  images  are  not  the  answer.  Gold  is  heavy.  It’s  hard  to  transport.  Its   hard  to  mold.  And  easy  to  lose  configura?on  detail.  
  • 11.
    This  won’t  scale  or  let  you  move  fast.  There’s  no  feedback  loop  from  ops  to  dev,  and   the  devs  aren’t  coordina?ng  with  ops  
  • 12.
    What  is  Chef?     Open  Source  Framework  for  managing  complexity   Declara?ve  language  for  describing  &  configuring  infrastructure   An  awesome  community  of  professionals   A  fast-­‐growing  company  based  in  Sea6le,  WA    
  • 13.
    How  does  Chef  work?     Ensures  desired  state  by  con?nually  tes?ng  and  repairing  individual  resources  in  the   system   You  compose  policies  using  a  series  of  simple  declara?ons   The  Chef  client  fetches  those  policies  from  a  central  server  and  applies  them  to  the   local  machine   The  state  of  the  machine  is  recorded  and  sent  back  to  a  database,  where  it  is  indexed  for  search,  repor?ng,  and  audit.    
  • 14.
    Infrastructure  as  Cod  in  a  nutshell:     Define  Policy  That  Describes  Your  Infrastructure   An  Autonomous  Agent  Implements  Your  Policy   Policy  Enforcement  is  Con?nuous  and  Safe   Automate  All  Your  Infrastructure  at  Scale    
  • 15.
    Build  Anything!     Simple  internal  applica?ons   Complex  external  applica?ons   Worksta?ons   Hadoop  clusters   IaaS  infrastructure   PaaS  infrastructure   SaaS  applica?ons   Storage  systems   You  name  it    
  • 16.
    And  manage  it  simply:  Automa?cally  reconfigure  everything   Linux,  Windows,  Unixes,  BSDs   Load  balancers   Metrics  collec?on  systems   Monitoring  systems   Cloud  migra?ons  become  trivial  
  • 17.
    DevOps  is  a  Two-­‐Way  Street     It’s  great  when  developers  care  about   Up?me!   Scaling!   Deployment!   Put  them  on  call!    etc.  etc.  etc.  
  • 18.
    How  can  we  work  TOGETHER?  
  • 19.
    Ops  has  as  much,  or  MORE,  to  learn   from  dev.  
  • 20.
    “Old”  SoDware  Development  Workflow     Write  some  code   <ad-­‐hoc  verifica?on  here>   Go  to  pre-­‐produc?on   <ad-­‐hoc  verifica?on  here>   Go  to  produc?on   ProducHon  failure  
  • 21.
    Modern  SoDware  Development  workflow     Write  some  code   Write  and  run  some  unit  tests   Go  to  pre-­‐produc?on   Run  some  integraHon/acceptance  tests   Go  to  produc?on   Lowered  chance  of  producHon  failure  
  • 22.
    Old  Chef  Cookbook  Workflow   Write  some  cookbook  code   <ad-­‐hoc  verifica?on  here>   Go  to  pre-­‐produc?on   <ad-­‐hoc  verifica?on  here   Go  to  produc?on   Whoops,  broke  producHon  
  • 23.
    New  Chef  Cookbook  Workflow   Write  some  cookbook  code   Check  for  code  correctness   Write  and  run  some  unit  tests   Go  to  pre-­‐produc?on   Run  some  integraHon  tests   Go  to  produc?on  
  • 24.
    Demo  of  Azure  and  Chef  integra?on.  See  h6p://youtu.be/wOj03WZHIr4  for  a  similar   demo.  
  • 25.
    CONTACTS  AND  LINKS  •  Tonight’s  code  -­‐  h6ps://github.com/ma6stra6on/  alm-­‐ demo-­‐repo  •  ma6stra6on@chef.io  •  @ma6stra6on  on  Twi6er  •  h6p:// arresteddevops.com  •  h6p://learn.chef.io