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

Chef OpsWorks

ProdOps
April 10, 2013

Chef OpsWorks

A new service from Amazon called OpsWorks sets a much simpler application management in the cloud.

Learn how to use OpsWorks to deploy your applications, customize the Chef cookbooks to better fit your needs, and re-use OpsWorks in a non-AWS environment.

The talk includes a short introduction to the Cloud, OpsCode Chef, a feature review of AWS OpsWorks, and finally an example of how OpsWorks can be customized in different ways by using attributes or even writing your own cookbooks.

Hebrew dubbing available at http://bit.ly/chef-opsworks-video

ProdOps

April 10, 2013
Tweet

More Decks by ProdOps

Other Decks in Technology

Transcript

  1. Likes writing code design patterns the Integrated Development Environment aka.

    IDE Dislikes reading manual pages troubleshooting configuration files lifting heavy things managing services and packages software deployments ... devops heroes
  2. ” “ things developers say ... I don't do system

    related tasks, especially not in production. - Developer can someone else do it this time please? pretty please?
  3. ” “ more things developers say ... - The same

    Developer Give me full control, or else when things go wrong, I am powerless to fix it. just change me this wheel on my motorcycle five minutes before my jump, it will be okay ...
  4. Bill ... devops heroes The Boss works at Initech Gov.

    Contracting wants "PRISM.app" deployed A.S.A.P
  5. I finished writing the code! Server room Servers Racks Labor

    Electricity & AC Configuration Deployment $150,000,000 + 16 months ... devops heroes When can our customer start paying? Oh, we probably need a couple more things ... Oh, oh, and I almost forgot. Ahh, I'm also gonna need you to go ahead and come in on Sunday, too...
  6. ... devops heroes use the Cloud the what? who are

    you? I'm Joana, ... the fairy godmother, ... ahh, never mind me. Just use the Cloud Luke, err.. Peter.
  7. IaaS vs. PaaS complex painful do it yourself total freedom

    total freedom cheaper better performance simple comfortable someone else "did it" constraints conventions expensive so-so performance
  8. Microsoft IaaS vs. PaaS Microsoft Windows Azure "Virtual Machines" Microsoft

    Windows Azure "Web Sites" everything works git push to deploy infrastructure pain custom deploys has ActiveDirectory! http://www.windowsazure.com/
  9. Google IaaS vs. PaaS Google "Compute Engine" Google "App Engine"

    custom APIs lots of limitations lots of abilities includes: Java, Go, PHP, Python and much much more... no longer beta! Google I/O release per-minute billing http://cloud.google.com/
  10. less control more comfort Amazon AWS IaaS vs. PaaS AWS

    EC2 AWS BeanStalk almost full control no comfort http://aws.amazon.com/ AWS OpsWorks AWS CloudFormation
  11. git push deploy lots of magic easy scalability many partners

    expensive poor performance IaaS vs. PaaS Salesforce Heroku http://www.heroku.com/ I dont like "magic", give me more control! You say its slow and expensive? ... no no, it will not do.
  12. ... devops heroes I can't deploy to a "platform" We

    will use servers in the Cloud! Just tell me when customers start paying!
  13. what a programmer has to actually do to use Servers

    in the (AWS) Cloud - For each world region - Define architecture (app+db+cache+stuff) - Select instance types and OS images (AMI) - Proper security groups (firewalls) - Generate SSH keys - Install packages - Configure services - Deploy application - Have a nervous breakdown - Repeat from start for each server - Profit!
  14. ... devops heroes That is a lot of work. So

    many things can go wrong ...
  15. ... devops heroes How do I do the same thing

    a hundred times without making mistakes? Chef, or Puppet, or CFEngine, or ... so many options.
  16. Approaches to Cloud automation Gold Image Image for every server

    type All software pre-installed Few moving parts Fast boot
  17. Approaches to Cloud automation Scripted One image to rule them

    all Smallest common denominator Acquires configuration on start Install & config. during boot to fit role All parts moving Slower boot Gold Image Image for every server type All software pre-installed Few moving parts Fast boot
  18. $ sudo chef-solo -c solo.rb -j solo.json Starting Chef Client,

    version 11.4.0 Compiling Cookbooks... Converging 3 resources Recipe: redis::default * package[redis-server] action upgrade (up to date) * service[redis-server] action nothing (up to date) * template[/etc/redis/redis.conf] action create (up to date) Chef Client finished, 0 resources updated
  19. running chef-solo $ chef-solo -c solo.rb -j solo.json ... solo.rb

    cookbook_path "cookbooks" solo.json { "redis": { "bind": "0.0.0.0" }, "run_list": "recipe[redis]" }
  20. redis cookbook cookbooks/redis/recipes/default.rb package "redis-server" do action :upgrade end service

    "redis-server" do action :nothing supports status: true, restart: true end template "/etc/redis/redis.conf" do source "redis.conf.erb" owner "root" mode "0644" variables({ bind: node[:redis][:bind] }) notifies :restart, "service[redis-server]" end 1. cookbook/redis/attributes/default.rb 2. solo.json
  21. redis cookbook cookbooks/redis/attributes/default.rb default[:redis][:bind] = "127.0.0.1" cookbooks/redis/templates/default/redis.conf.erb ... # If

    you want you can bind a single interface, if the bind option is not # specified all the interfaces will listen for incoming connections. bind <%= @bind %> ...
  22. $ sudo chef-solo -c solo.rb -j solo.json Starting Chef Client,

    version 11.4.0 Compiling Cookbooks... Converging 3 resources Recipe: redis::default * package[redis-server] action upgrade - upgrade package redis-server from uninstalled to 2:2.2.12-1build1 * service[redis-server] action nothing (up to date) * template[/etc/redis/redis.conf] action create (up to date) Chef Client finished, 1 resources updated
  23. $ sudo chef-solo -c solo.rb -j solo.json Starting Chef Client,

    version 11.4.0 Compiling Cookbooks... Converging 3 resources Recipe: redis::default * package[redis-server] action upgrade (up to date) * service[redis-server] action nothing (up to date) * template[/etc/redis/redis.conf] action create - update template[/etc/redis/redis.conf] from 81b4f1 to 8a6cec --- /etc/redis/redis.conf 2011-07-27 17:26:50.000000000 +0000 +++ /tmp/chef-rendered-template20130406-2537-f8vlv6 2013-04-06 ... @@ -27,7 +27,7 @@ # If you want you can bind a single interface, if the bind option is not # specified all the interfaces will listen for incoming connections. # -bind 127.0.0.1 +bind 0.0.0.0 # Specify the path for the unix socket that will be used to listen for # incoming connections. There is no default, so Redis will not listen * service[redis-server] action restart - restart service service[redis-server] Chef Client finished, 2 resources updated
  24. ... devops heroes Chef is great! But I need to

    automate servers to scale. I have some pretty graphs for you ...
  25. I had 'em stacks o' hay o' tha' bed ground

    when I was a little button, me Ma used ta' make me old Missouri featherbed with it. Stack - Layer - Instance - App
  26. Stack - Layer - Instance - App • Install dependencies

    • Update dependencies. • Update cookbooks • Execute recipes
  27. Chef recipes ◦ available on GitHub as open-source ◦ setup

    per different lifecycle events Stack - Layer - Instance - App
  28. More environments with a click! ... havin' a hat wi'

    three pointy corners. Development & Staging & Production Stack - Layer - Instance - App