Save 37% off PRO during our Black Friday Sale! »

Docker Docker Docker Chef

Ea72b50eef37ebe730c37d96c5b5dd51?s=47 someara
February 02, 2016

Docker Docker Docker Chef

Configuration Management Camp
Ghent Belgium
February 2016

Ea72b50eef37ebe730c37d96c5b5dd51?s=128

someara

February 02, 2016
Tweet

Transcript

  1. Docker Docker Docker Chef

  2. Config Management Camp Ghent, Belgium February 2016

  3. Sean OMeara sean@chef.io @someara

  4. whoami

  5. Part 1

  6. Remember the time

  7. Remember that time we didn’t need configuration management because we

    had packaging?
  8. Remember that time the cloud came out and we didn’t

    need sysadmins?
  9. Remember that time when we didn’t need schemas because we

    had MongoDB?
  10. Repeat after me

  11. CONFIGURATION MANAGEMENT AND IMMUTABLE INFRASTRUCTURE ARE NOT MUTUALLY EXCLUSIVE

  12. Say it again

  13. CONFIGURATION MANAGEMENT AND IMMUTABLE INFRASTRUCTURE ARE NOT MUTUALLY EXCLUSIVE

  14. We good?

  15. The Docker cookbook

  16. Configuration Management is not restricted to files, directories, packages and

    services
  17. Configuration Management tests and repairs any programmable noun

  18. Images are nouns

  19. Containers are nouns

  20. hello world

  21. https://flic.kr/p/br26Cb Setup v0.0.1

  22. Install ChefDK

  23. git clone https:// github.com/someara/chef- docker-tutorial

  24. kitchen test

  25. git checkout v0.0.1 git checkout v0.1.0 git checkout v0.1.1 git

    checkout v0.2.0 git checkout v0.2.1 git checkout v0.3.0 git checkout v0.3.1
  26. https://flic.kr/p/s684tk Feature v0.1.0

  27. metadata.rb

  28. .kitchen.yml

  29. recipes/hello.rb

  30. kitchen converge hello kitchen login hello docker images docker ps

    -a docker logs hello-world
  31. git add . git commit -a -m “v0.1.0 - hello”

    git tag v0.1.0
  32. https://flic.kr/p/53stX2 Patch v0.1.1

  33. Bug report: “hello is not idempotent”

  34. kitchen converge hello kitchen converge hello

  35. kitchen login hello docker ps -a docker logs hello-world

  36. hello-world exits after every run

  37. This is expected!

  38. http://gliderlabs.com/

  39. recipes/hello.rb

  40. rubocop \ && rspec \ && kitchen test hello

  41. metadata.rb

  42. git add . git commit -a -m “v0.1.1 - hello”

    git tag v0.1.1
  43. an echo server https://flic.kr/p/6WtX6X

  44. https://flic.kr/p/s684tk Feature v0.2.0

  45. Recipe work Kitchen work Behavior testing Unit Final Acceptance Commit

  46. .kitchen.yml

  47. recipes/echo.rb

  48. Docker Containers have 40+ (and growing) runtime API options

  49. None
  50. kitchen converge echo kitchen converge echo kitchen login echo docker

    images docker ps -a docker logs an_echo_server docker inspect an_echo_server echo "hi" | nc localhost 7
  51. test/integration/echo/inspec/run_spec.rb

  52. rubocop \ && rspec \ && kitchen test echo

  53. metadata.rb

  54. git add . git commit -a -m “v0.2.0 - echo”

    git tag v0.2.0
  55. https://flic.kr/p/dRGr3t Patch v0.2.1

  56. Security team recommends a change… Service should listen on explicitly

    defined interfaces
  57. kitchen converge echo kitchen login echo netstat -anp

  58. Listening on :::7 Let’s fix that.

  59. recipes/echo.rb

  60. test/integration/echo/inspec/run_spec.rb

  61. rubocop \ && rspec \ && kitchen test echo

  62. metadata.rb

  63. git add . git commit -a -m “v0.2.1 - echo

    patch” git tag v0.2.1
  64. https://flic.kr/p/ayDujN notifications and subscriptions

  65. https://flic.kr/p/cNdyo Feature v0.3.0

  66. recipes/web.rb

  67. recipes/web.rb

  68. kitchen converge web kitchen converge web kitchen login web docker

    images docker ps -a curl localhost docker logs bob
  69. test/integration/web/inspec/run_spec.rb

  70. rubocop \ && rspec \ && kitchen test web

  71. metadata.rb

  72. git add . git commit -a -m “v0.3.0 - web”

    git tag v0.3.0
  73. https://flic.kr/p/o9c2G3 Patch v0.3.1

  74. Marketing team recommends a change… Bob wasn’t there.

  75. kitchen converge web kitchen login web curl localhost

  76. Bob was here. Let’s fix that.

  77. recipes/web.rb

  78. test/integration/echo/inspec/run_spec.rb

  79. rubocop \ && rspec \ && kitchen test web

  80. metadata.rb

  81. git add . git commit -a -m “v0.3.1 - echo

    patch” git tag v0.3.1
  82. Part 2

  83. kitchen-dokken http://on.mtv.com/1ls5SRc

  84. Experimental status Soon to be renamed something less clever

  85. Removes bootstrap overhead Uses Docker volumes Chef not baked into

    images Works on Travis
  86. https://github.com/someara/ kitchen-dokken/

  87. Install ChefDK chef gem install kitchen-dokken

  88. git clone https://github.com/ someara/hello_dokken

  89. kitchen list docker ps -a

  90. None
  91. kitchen create docker ps -a

  92. Chef container Data container Runner container

  93. docker run \ —volumes-from chef \ —volumes-from data \ imagename

    \ chef-client
  94. docker diff suitename

  95. https://travis-ci.org/ someara/etcd-cookbook

  96. fin

  97. None