Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Chef: Why you should automate your web infrastructure by Kate Heddleston

Afcfefa1f067d10bd021de0cc2e5e806?s=47 PyCon 2013
March 17, 2013

Chef: Why you should automate your web infrastructure by Kate Heddleston

Afcfefa1f067d10bd021de0cc2e5e806?s=128

PyCon 2013

March 17, 2013
Tweet

Transcript

  1. Chef: Why you should automate your web infrastructure.

  2. Hi I'm Kate Heddleston @heddle317 kate.heddleston@gmail.com https://github.com/heddle317/django-chef-application

  3. Here's what I'm going to talk to you about. •

    Why you should automate your web infrastructure. • What is Chef? • How to use Chef to set-up a python/Django project.
  4. A Programmer's Better Best Friend

  5. Why you should automate your web infrastructure. • All of

    your configuration information is in one place (and that place isn't someone's head) • You can spin up perfectly configured servers instantly! • You can change things in one place and have them propagate through your entire system • You can create dev and test environments that are exact replicas of production.
  6. None
  7. LB FE AS AS DB slave sentry nagios graph FE

    FE
  8. None
  9. FE AS DB FE AS DB

  10. PostgreSQL Celery NginX Rabbit MQ Python

  11. What is Chef? "Reality-based automation for the cloud." "Infrastructure as

    code." "A global view of your system as opposed to a local one."
  12. Terminology

  13. Chef Server • central storage for all your chef configuraions

    • stores all your git repo stuff as structured data in json • uses couchDB for storage and querying • Hosted Chef free for up to 5 nodes - then you should host it yourself Chef Server
  14. Knife Command line tool to interface between your local code

    repo and your Chef Server
  15. Nodes servers in your system LB FE FE FE

  16. Roles • A nice way of abstracting what a node

    does and what should be installed on it. I.e. a webserver role vs. a database role • run_list of installations • Can talk about other machines in your infrastructure by their role; open up firewalls to front-end servers • You can query roles
  17. Cookbooks • The base unit of configuration, so you would

    have a cookbook for nginx, postgres, gunicorn, etc.
  18. Recipes • ruby programs that get run when installing that

    cookbook
  19. Chef Server

  20. Chef Server Hosting Provider knife knife plugin

  21. None
  22. knife cookbook site download nginx ohai postgresql gunicorn git python

    screen
  23. None
  24. Chef Server knife cookbook upload django-application

  25. None
  26. Chef Server knife role from file webserver.json

  27. What exactly happens when I run this command? knife rackspace

    server create -r 'role[webserver]' -N chef.myserver.org -S chef.myserver.org -f 3 -I 125
  28. Hosting Provider chef-client knife rackspace... chef bootstrap

  29. Go see console output!

  30. • You really, really, really, really should use something for

    server configuration • Getting started with your Django server ◦ https://github.com/heddle317/django-chef-application To sum it all up...
  31. Other tools like Chef • Heroku ◦ "Like having two

    full-time dev ops people on your team." • Puppet ◦ http://bitfieldconsulting.com/puppet-vs-chef • Salt ◦ this one is in python, but it's new
  32. No developers were harmed in the making of this presentation...

    John Lynn Robert MacCloy Adam DePue Hearsay Social
  33. Links to particularly interesting articles I found while making this

    presentation • http://version2beta.com/articles/dev- environments-with-vagrant-chef-and-git/ • http://devopsanywhere.blogspot. com/2011/10/puppet-vs-chef-fight.html • http://en.wikipedia. org/wiki/Comparison_of_open_source_confi guration_management_software
  34. Questions? You can also find me in the hallways OR

    At the Hearsay Social beer bash: 6-8pm at David's 5151 Stars and Stripes Dr.