Mind the Gap

6340bd48e9f1248c6344d3008c0a08d7?s=47 Robb Kidd
April 17, 2014
79

Mind theĀ Gap

Deploying an on-premises, multi-node product with chef on networks you don't control.

6340bd48e9f1248c6344d3008c0a08d7?s=128

Robb Kidd

April 17, 2014
Tweet

Transcript

  1. None
  2. Deploying in Unforgiving Environments (Control Your Dependencies) (the network is

    a dependency)
  3. /(robbkidd)/ twitter.com/$1 github.com/$1

  4. None
  5. History

  6. Configker

  7. Chef-Server

  8. Chef-Solo

  9. Patterns for Getting Stuff on Your Servers

  10. remote_file

  11. The Essential remote_file remote_file "/opt/sauce/sauce_#{node[:sauce][:version]}.tgz" do source "#{node[:sauce][:url]}/awesome_sauce_#{node[:sauce][:version]}.tgz" end

  12. Better: Give It a Checksum remote_file "/opt/sauce/sauce_#{node[:sauce][:version]}.tgz" do source "#{node[:sauce][:url]}/awesome_sauce_#{node[:sauce][:version]}.tgz"

    * checksum node[:sauce][:checksum] end
  13. Ever Better: Put It in the Chef Cache # v-------------------------------v

    * remote_file "#{Chef::Config[:file_cache_path]}/sauce_#{node[:sauce][:version]}.tgz" do source "#{node[:sauce][:url]}/awesome_sauce_#{node[:sauce][:version]}.tgz" checksum node[:sauce][:checksum] end
  14. packaging

  15. fpm

  16. Example Packaging Step fpm -s dir \ -t deb \

    --name awesome_sauce \ --version "$(shell git describe --always --tag)" \ --before-install ./etc/preinst.sh \ --deb-upstart ./etc/saucy \ --config-files /etc/saucy.yml \ ./bin/saucy=/usr/bin/ \ saucy.yml.sample=/etc/saucy/
  17. shelling out

  18. None
  19. RVM 4 custom RVM install ahead of chef-rvm 4 install

    RVM via tarball according to the offline steps 4 rvm mount ruby-version.tgz 4 carry on with our uses of chev-rvm 4 rvm-shell mostly
  20. None
  21. None
  22. python's default.rb include_recipe "python::#{node['python']['install_method']}" include_recipe "python::pip" include_recipe "python::virtualenv"

  23. python_shim.rb %w(python-pip python-virtualenv).each do |pkg| package pkg do action :install

    end end link "/usr/local/bin/pip" do to "/usr/bin/pip" end directory "/root/.pip/" file "/root/.pip/pip.conf" do content "[global]\ntimeout = 1\n" end
  24. Getting Stuff on Your Servers (Review) 4 remote_file 4 packages

    4 shelling out :(
  25. A Tale of Three Caches

  26. Library Cache

  27. bundle package (for ruby peeps)

  28. Package Cache

  29. None
  30. apt-cacher-ng

  31. Chef Cache

  32. vagrant-cachier

  33. monkeypatch

  34. class ::Chef class Provider class RemoteFile class Content < Chef::FileContentManagement::ContentBase

    private def current_resource_matches_target_checksum? ::Chef::Log.info("Airgapped - skipping content checksum for #{@new_resource}") true end end end end end
  35. Mo' Better? (things I haven't got working yet)

  36. chef-client --local-mode

  37. Shim Cookbook AntiPattern?

  38. no 3rd party cookbooks?

  39. omnibus packages?

  40. containers?

  41. Shoulders of Giants Mark Olson - Lookingglass Eric Sproul -

    Circonus
  42. Review 4 history 4 recipe patterns 4 caching tricks 4

    future possibilities
  43. Payoff 4 works without access to network resources 4 chef

    convergence is faster! 4 chef convergence is predictable!
  44. 4 Mind the Gap photo by Clicsouris 4 Vagrant -

    Mitchell Hashimoto/Hashicorp 4 vagrant-cachier - Fabio Rehm 4 fpm - Jordan Sissell 4 knife-solo - Mat Schaffer