Canary Deployments

Canary Deployments

94500f2d1984cd5da6e445d89819052b?s=128

Yoshiki Nakagawa

September 28, 2016
Tweet

Transcript

  1. Canary Deployments ! Move Fast, Fail Fast (and Small) Sep

    / 26 / 2016 1
  2. AboutMe @yyoshiki41 Yoshiki Nakagawa Infrastructure Engineer, pairs Division Tech »

    Golang » Middleware, AWS 2
  3. What is the canary server ? By 4028mdk09 (Own work)

    [CC BY-SA 3.0], via Wikimedia Commons 3
  4. Canary Server tl;dr σϓϩΠ΍ϓϩϏδϣχϯάΛ͍͖ͳΓ ϓϩμΫγϣϯ؀ڥͷશମͰ͸ͳ͘ɺઌ ߦͯ͠Ұ෦෼ʹରͯ͠ߦ͍ɺ ͜Ε͕దԠ͞Εͨ΋ͷΛʮΧφϦΞαʔ όʯͱݺͿɻ Ұ෦෼ͷΫϥελʹΑΔݕূͰɺࣦഊ࣌ ͷμϝʔδΛগͳ͘͢Δߟ͑ํɻ

    ϑΟʔυόοΫΛ͍ͪૣ͘ड͚औΕΔɻ 4
  5. ୸߭ͰͷಟΨεݕ஌ʹɺΧφϦΞ͕࢖ ΘΕͨ͜ͱʹ༝དྷ͢Δɻ ͍ΘΏΔ୸߭ͷΧφϦΞ͸ɺ୸߭ʹ͓ ͍ͯ͠͹͠͹ൃੜ͢Δϝλϯ΍ҰࢎԽ ୸ૉͱ͍ͬͨ஠ଉΨε΍ಟΨεૣظൃ ݟͷͨΊͷܯใͱͯ͠࢖༻͞Εͨɻຊ छ͸ͭͶʹ͍͑ͣͬͯ͞ΔͷͰɺҟৗൃ ੜʹઌۦ͚·ͣ͸໐͖੠͕ࢭΉɻͭ· Γةݥͷ࡯஌Λ໨ͱࣖͰ֬ೝͰ͖Δॴ ͕ॏๅ͞ΕɺಟΨεݕ஌ʹ༻͍ΒΕ

    ͨɻ wikipedia ΑΓ 5
  6. Use Cases 6

  7. Application » มߋͨ͠ΞϓϦέʔγϣϯίʔυΛຊ൪σϓϩΠͯ͠ݕূ͍ͨ͠ » ৽ػೳͷ૝ఆ͍ͯ͠ͳ͍όάΛ࠷খݶʹ๷͍͗ͨ / ෛՙΛݕূ͍ͨ͠ Infra » ৽͍͠ϛυϧ΢ΣΞΛࢼ͍ͨ͠

    » ϛυϧ΢ΣΞͷϓϩϏδϣχϯάมߋલޙͷมԽΛݕূ͍ͨ͠ 7
  8. Use Cases in pairs Ansible commands! $ ansible-playbook -i hosts/pairs-jp/prod

    --limit web-canary playbook_pairs/delivery.yml --extra-vars="pkg_dir=v160101010101-10f29c9" That's all! 8
  9. Use Cases in Netflix σϓϩΠαΠΫϧʹΧφϦΞΫϥελ΁ͷσϓϩΠؚ͕·Ε͓ͯΓɺ ϨϙʔςΟϯά(Canary analysis report) => શମެ։͢Δ͔൱͔ͷδϟ

    οδ (Canary Score) ·Ͱ͕ࣗಈԽ͞Ε͍ͯ·͢ɻ ਺ඦ୆ͱ͍͏Α͏ͳن໛Λӡ༻͍ͯ͘͠͏͑Ͱɺ શ୆ࢮ๢͸ઈରʹආ͚ͳ͚Ε͹ͳΒͳ͍͜ͱΛߟ͑ΔͱࣗવͳྲྀΕɻ 9
  10. Development & Deployment Flow ެࣜϒϩά ʮDeploying the Netflix APIʯ 10

  11. Containers Containerͱͷ૬ੑ͕ྑ͍ͷͰɺ Container as a service΍ɺCI/CDαʔ Ϗεʹ૊Έࠐ·Ε͍ͯΔ΋ͷ΋ଟ͍ɻ e.g.) Kubernetes 11

  12. Caution ޓ׵ΛऔΕ͍ͯͳ͍΋ͷ͸ɺΧφϦΞαʔό΁ͷσϓϩΠ͕ग़དྷͳ͍ɻ e.g.) ৽͍͠APIϦΫΤετΛ౤͛ΔΫϥΠΞϯτଆͷίʔυ΋ؚΉ ! 12

  13. Others ຊ൪؀ڥ(ಉ౳)ͰͷݕূΛߦ͍͍ͨ৔߹ɺ ΧφϦΞαʔόͰ͸ͳ͘γϟυʔϓϩΩγΛ༻͍Δख๏΋ϝδϟʔɻ e.g.) cookpad/Kage 13

  14. Move Fast, Fail Fast (and Small) ୸߭ (ຊ൪؀ڥ) ʹ͸ɺةݥ͕͍ͬͺ͍Ͱ͢ɻ શ໓Λආ͚Δҝʹ΋ɺΧφϦΞͷॿ͚ΛआΓ·͠ΐ͏

    ! (΋ͪΖΜɺΧφϦΞ΋ࢮͳͤͳ͍͜ͱ͕ϕετͰ͕͢ɻ) 14