OkinawaOpendays2016_ネットワーク運用コード化への取り組み

B722d457f803a630f3c55429b526510b?s=47 komeinw
December 13, 2016

 OkinawaOpendays2016_ネットワーク運用コード化への取り組み

B722d457f803a630f3c55429b526510b?s=128

komeinw

December 13, 2016
Tweet

Transcript

  1. ωοτϫʔΫӡ༻ίʔυԽ΁ͷ औΓ૊Έ αΠόʔΤʔδΣϯτ ΞυςΫຊ෦ ࢁຊ ޸໌ @Okinawa Open Days 2016

  2. Okinawa Open Days 2016 1.͸͡Ίʹ 
 2.ωοτϫʔΫࣗಈԽ(?)Λ΍ͬͯΈͨ࿩
 3.ࣾ಺ʹAPI GatewayΛཱͯͨ࿩
 4.ۤ࿑ͨ͠ϙΠϯτͱΘ͔ͬͨ͜ͱ


    5.͓ΘΓʹ Agenda
  3. ࣗݾ঺հ Okinawa Open Days 2016 ΞυςΫຊ෦ͷΠϯϑϥΤϯδχΞɻ ओʹΦϯϓϨͷωοτϫʔΫ(෺ཧ/Ծ૝)͓Αͼ OpenStackͷҰ෦Λ୲౰ɻ • SDN

    Japan 2016 ΞυςΫʹඞཁͳSDN • IT PRO EXPOʮωοτϫʔΫΛ؂ࢹ͢ΔZabbix ͷ׆༻ࣄྫʯ • Interop Tokyo 2015 / 2016 ͳͲ https://speakerdeck.com/komeiy/ ϓϩϑΟʔϧ@komeinw
  4. αΠόʔΤʔδΣϯτ ΞυςΫຊ෦ͱ͸

  5. ΞυςΫຊ෦ͷઆ໌ͷલʹɾɾɾ αΠόʔΤʔδΣϯτʹ͍ͭͯ ؆୯ʹઆ໌ͤͯ͞௖͖·͢ɹɹ

  6. αΠόʔΤʔδΣϯτʹ͍ͭͯ 1998೥ͷ૑ۀҎདྷɺΠϯλʔωοτΛ࣠ʹࣄۀΛల։͠ ݱࡏͰ͸୅දతͳαʔϏεͰ͋ΔʮAmebaʯΛ͸͡Ίɺ εϚʔτϑΥϯ޲͚ʹଟ਺ͷίϛϡχςΟαʔϏε΍ήʔϜΛ ఏڙ͍ͯ͠·͢ɻ and m ore !!

  7. αΠόʔΤʔδΣϯτͷࣄۀ಺༰

  8. ΞυςΫຊ෦ʹ͍ͭͯ Πϯλʔωοτ޿ࠂʹ͓͍ͯɺ޿ࠂ഑৴ͷ࠷దԽ΍ϝσΟΞͷऩӹ࠷େԽͱ͍͏ ؍఺͔ΒΞυςΫϊϩδʔͷॏཁ౓͕ߴ·͍ͬͯ·͢ɻ αΠόʔΤʔδΣϯτͰ͸ΞυςΫϊϩδʔ෼໺ʹ͓͚Δ ͜ΕΒͷαʔϏεʹ͍֤ͭͯࢠձࣾΛ௨͡։ൃ͓ͯ͠Γ·͕ͨ͠ɺ ֤αʔϏεͷ։ൃ෦໳Λԣஅͯ͠૊৫Խ͢Δઐ໳෦ॺͱͯ͠ ΞυςΫຊ෦͕ઃཱ͞Ε·ͨ͠ɻ

  9. None
  10. αΠόʔΤʔδΣϯτͷΞυςΫϚοϓ

  11. αΠόʔΤʔδΣϯτͷΞυςΫ ৄࡉ͸ʮ೔ຊҰ΍͍͞͠ΞυςΫڭࣨʯΛޚཡ͍ͩ͘͞ʂ https://www.cyberagent.co.jp/ir/personal/adtech/adtech_01/

  12. ͔͜͜Βຊ୊ʹೖΓ·͢ɾɾɾɻ

  13. Okinawa Open Days 2016 ࠓ೔͸ओʹΦϯϓϨ؀ڥͷ
 ͓࿩Λ͠·͢

  14. ٻΊΒΕΔωοτϫʔΫͬͯʁ Okinawa Open Days 2016 
 Not ख࡞ۀ but ࣗಈԽ

  15. Okinawa Open Days 2016 ࣗಈԽʁ
 
 ηϧϑαʔϏεԽʁ ٻΊΒΕΔωοτϫʔΫͬͯʁ

  16. SDNͰղܾʁ Okinawa Open Days 2016 ɹSDNͱ͸ɺίϯϐϡʔλωοτϫʔΫΛߏ੒͢Δ௨৴ػثΛ୯Ұͷιϑτ΢ΣΞʹΑͬͯूதతʹ ੍ޚ͠ɺωοτϫʔΫͷߏ଄΍ߏ੒ɺઃఆͳͲΛॊೈʹɺಈతʹมߋ͢Δ͜ͱΛՄೳͱ͢Δٕज़ͷ૯শɻ ɹ·ͨɺͦͷΑ͏ͳٕज़ʹΑΓɺωοτϫʔΫͷ૷ஔͷ഑ஔ΍഑ઢͳͲͷ෺ཧతߏ੒ͱ͸͋Δఔ౓ಠཱ ʹɺ໨తʹԠͯ͡ෳ਺ͷԾ૝తͳωοτϫʔΫΛߏங͢Δ͜ͱ΍ɺͦͷΑ͏ʹͯ͠ߏங͞Εͨωοτϫʔ Ϋͷ͜ͱɻ͜Ε͸ʮωοτϫʔΫԾ૝Խʯͱ΋ݺ͹Εɺݫີʹ͸SDNͷԠ༻ͷҰͭͰ͋Γɺ·ͨɺ

    SDNʹΑΒͣผͷٕज़ʹΑ࣮ͬͯݱ͢Δख๏΋͋ΔͨΊɺSDNͦͷ΋ͷͱ͸۠ผ͢Δඞཁ͕͋Δɻ ग़ల: http://e-words.jp/w/SDN.html ཁ͢Δʹɺ͍ΘΏΔίϯτϩʔϥʹ૬౰͢Δ΋ͷ͕ϓ ϥΠϕʔτΫϥ΢υج൫ͷσʔλϕʔεͱ࿈ܞͯ͠ಈ తʹωοτϫʔΫͷઃఆΛ࣮ߦ͢Ε͹OK
  17. ฐࣾͷωοτϫʔΫߏ੒ Okinawa Open Days 2016 • SDN ͳ؀ڥ͸͋Δɻ ৽ͨʹ࡞ͬͨҰ෦ͷ؀ڥͰ࠾༻ •

    ඞཁʹԠͯͦ͡ͷ࣌ʑͰ࠷దͳϋʔυ΢ΣΞΛબ୒͠࠾༻͍ͯ͠Δ • ࠾༻͍ͯ͠Δϋʔυ΢ΣΞʹ͍ͭͯ͸ϚϧνϕϯμʔͰߏ੒ ͳΔ΂͘Φʔϓϯͳٕज़ͰSDNͳ ؀ڥͱͦ͏Ͱͳ͍؀ڥͷ྆ํΛέ Ξ͢Δඞཁ͕͋Δ
  18. ҰൠతͳωοτϫʔΫΤϯδχΞͷ͓࢓ࣄ • VLAN௥Ճ/มߋ • ϧʔςΟϯά௥Ճ/มߋ • ϩʔυόϥϯαʔઃఆ௥Ճ • ACL௥Ճ •

    τϥϑΟοΫ֬ೝ • VPNϢʔβ௥Ճ/มߋ Okinawa Open Days 2016 • ૿ڧͳͲͷߏ੒มߋ • ৽ٕज़ͷݕূ • τϥϒϧγϡʔτ • ߏ੒؅ཧ • ϕϯμʔίϯτϩʔϧ etc… ΤϯδχΞͱͯ͠͸ɺ ͜͜ʹ஫ྗ͍ͨ͠
  19. ωοτϫʔΫΤϯδχΞͷ೰Έ Okinawa Open Days 2016 ʮACL௥Ճͯ͠΄͍͠Μ͚ͩͲɻࠓ೔ʯ ʮVPNϢʔβͬͯࠓ୭͕ొ࿥͞Εͯ·͚ͨͬ͠ʁʯ ʮτϥϑΟοΫ͍ͬͯ·Ͳͷ͘Β͍ग़ͯ·͢ʁʯ ໘౗ʹࢥͬͨΓޙճ͠ʹͨ͠ͱࢥ͍ͳ͕Β࡞ۀͨ͠ ܦݧ͸͋Γ·ͤΜ͔ʁʁ

  20. ࢓૊ΈతʹΑ͘ͳ͍ͷͰɺ
 
 SDNͰ͸ͳ͍؀ڥͰ΋
 
 ָͳӡ༻ʹ͍ͨ͠ ʢશ෦SDNͳ ΒɾɾɾϘιʣ

  21. ͱ͍͏͜ͱͰɺ࡞ͬͯΈ·ͨ͠ɻ Okinawa Open Days 2016

  22. ԿΛ࡞ͬͨʁͲΜͳޮՌʁ • ެ։༻API Gateway • AWS CLI ΍ gcloud Έ͍ͨͳίϚϯυϥΠϯͷఏڙ

    • গਓ਺Ͱͷӡ༻ΛΧόʔ • ৽نαʔϏεͷ্ཱͪ͛εϐʔυΛଛͳΘͳ͍࢓૊Έ • ͭ·Βͳ͍࡞ۀ͸ۃྗ΍Γͨ͘ͳ͍ μϝɻ࡞ۀϛεɺϦϦʔε೔΁ͷӨڹɺΤϯδχΞͷϞνϕʔγϣϯ௿Լ Okinawa Open Days 2016 ͜ͷೋ͕ͭ͋Ε͹ࣗಈԽɾηϧϑαʔϏεԽ͸ଅਐͰ͖Δ
  23. Okinawa Open Days 2016 ϓϥΠϕʔτΫϥ΢υͷૢ࡞Πϝʔδ • ֶशίετ͕௿͍ʢΞϓϦέʔγϣϯͷ։ൃऀ͕ ɹ֤੡඼ݻ༗ͷίϚϯυΛ֮͑Δඞཁ͕ͳ͍ʣ • ؆୯ʹJOBʹ૊ΈࠐΜͩΓ͢Δ͜ͱ͕Մೳ

    • ࢥཱ͍ͬͨͱ͖ʹ͙͢Πϯϑϥͷૢ࡞͕Ͱ͖Δ • Ϛϧνϕϯμʔͳ؀ڥͰ΋Ϣʔβ͸ҙࣝ͠ͳ͍ ͜Μͳײ͡ͰͷϧʔλɾεΠονɾϩʔ υόϥϯαʔɺNeutronͷઃఆ͕Ͱ͖ Δɻ Regionͷ֓೦΋͍࣋ͨͤͯ·͢
  24. Okinawa Open Days 2016 αʔϏεϝχϡʔ • ৽نαʔϏε্ཱ͕͕ͪΔ͝ͱʹ૿͑Δ΋ ͷ΍ૢ࡞͢Δ΋ͷΛجຊʹߏ੒ • جװܥͷ࡞ۀ͸ಛఆͷϢʔβݖݶͷΈͰ͠

    ͔৮Εͳ͍Α͏ʹ੍ޚ • αʔϏεϝχϡʔ͸ӈهҎ֎ʹ΋ෳ਺ଘࡏ • DC಺ͷϩʔΧϧϨϙδτϦ͔Β഑෍
  25. ߏ੒Πϝʔδͱ࢖༻ٕज़ Okinawa Open Days 2016 • ݴޠ Python Shell Script

    • ιϑτ΢ΣΞ ɹ Flask Nginx Gunicorn ͦͷଞ API Server ग़లɿhttps://dzone.com/articles/learn-python-overtakes-learn-java "Learn Python" Overtakes "Learn Java" on Google Trends ೝՄɾೝূ REST API REST API REST API SSH command ଞʹ͸ɾɾɾ
  26. @api.route('/pool/<poolname>/member', methods=['POST']) def poolmemberpost(poolname): if not request.json: abort(400) if 'name'

    not in request.json: abort(400) return b.memberpost(g.bigip_partition, poolname, request.json) • apiΛϧʔςΟϯά͢Δ͚ͩͷ΋ͷ͸ͦͷ··ྲྀ͢ɻՃ޻͕ඞཁͳ΋ͷ ͸ɺదٓσʔλͷ append ΍ ਖ਼౰ੑνΣοΫΛ͍ͯ͠Δ • api ඇରԠσόΠεͱ͸ɺ pexpect Λར༻ APIαʔόͷΠϝʔδ • Python ͷ؆қ WEB ΞϓϦέʔγϣϯͰ͋Δ FLASK Λ࢖༻ Okinawa Open Days 2016
  27. APIαʔόͷΠϝʔδ " API αʔόʹ͸֤ϝʔΧʔͷૢ࡞༻ͷεΫϦϓτ͕֨ೲ͞Ε͍ͯΔ ྫʣneutron ͷ port list / port

    show / port update Λ·ͱ·ͨ΋ͷ ɹɹL3 SW΁ͷΞΫηεϦετ౤ೖͱΞυϨενΣοΫΛ࣮ߦ͢Δ΋ͷ " GitHub (ࣾ಺ Organization) ΁ެ։͠ɺisuue ΍ pull request ϕʔεͰϢʔ β͔Βͷཁ๬ΛऔΓࠐΈ " ݖݶ΋ FLASK ଆͰ؅ཧ͍ͯ͠ΔͨΊɺςφϯτͷ֓೦͕ͳ͍ઃఆઌʹ ʹରͯ͠΋ݖݶΛ֬ೝ͠ద੾ͳૢ࡞͚ͩʹ੍ݶ͍ͯ͠Δ " API Λެ։͢Δ͚ͩͩͱؾܰʹར༻ͯ͠΋Β͑ͳ͍ͨΊɺίϚϯυϥΠ ϯπʔϧΛఏڙͯ͠རศੑͷ޲্ΛਤΔ Okinawa Open Days 2016
  28. ͳͥ͜ͷΑ͏ͳߏ੒Λ ࠾༻ͨ͠ͷ͔ Okinawa Open Days 2016

  29. REST APIͷ࿩ Okinawa Open Days 2016 • Τϥʔॲཧָ͕ ɹɹͳͷͰɺώϡʔϚϯΤϥʔ͞Α͏ͳΒʹۙͮ͘ •

    ωοτϫʔΫΤϯδχΞҎ֎Ͱ΋ૢ࡞͠΍͍͢ ɹɹͳͷͰɺެ։͢Ε͹࢖ͬͯ͘Εͦ͏ • ౰વɺߏ੒؅ཧπʔϧͱ͔ͱ͸ҧ͏ • దࡐదॴͰ࢖͍·͠ΐ͏ ΞϓϦέʔγϣϯϓϩάϥϛϯάΠϯλϑΣʔε (APIɺӳ: Application Programming Interface) ͱ͸ɺιϑτ΢ΣΞί ϯϙʔωϯτ͕ޓ͍ʹ΍ΓͱΓ͢Δͷʹ࢖༻͢ΔΠϯλϑΣʔεͷ࢓༷Ͱ͋Δɻ APIʹ͸ɺαϒϧʔνϯɺσʔλߏ଄ɺΦ ϒδΣΫτΫϥεɺม਺ͳͲͷ࢓ؚ༷͕·ΕΔɻ ग़లɿAPI - ΢ΟΩϖσΟΞ https://ja.wikipedia.org/wiki/ΞϓϦέʔγϣϯϓϩάϥϛϯάΠϯ λϑΣʔε
  30. Okinawa Open Days 2016 ChatͰ࿩͔͚Δͱɾɾɾ SVI / VLAN࡞੒ɺLBઃఆɺNeutronઃఆɺςετɺςετ؀ڥ࡟আ ·ͰͷҰ࿈ͷྲྀΕΛ࣮ࢪɻ݁Ռ͸ChatͰ௨஌ɻ APIԽ͢ΔͱChatOpsָ͕ʹͳΔ

  31. Okinawa Open Days 2016 • άϥϑΟΧϧͳ෦෼͸ChatͰͰ͖ΔΑ ͏ʹ͓ͯ͘͠ͱҎ֎ͱศརɻ • “པ·ΕΔଆ” ΋

    ”པΉଆ” ʹऔͬͯ΋ε τϨεϑϦʔ • ଞʹ΋ՄࢹԽͱ؆୯ͳϓϩϏδϣϯͰ ׆༻ • Jobʹ૊ΈࠐΜͩΓ͢ΔՄೳੑ͕͋Δ ΋ͷ͸ɺCLIͳ͍͠͸APIͰఏڙͨ͠ํ ͕Α͍ APIԽ͢ΔͱChatOpsָ͕ʹͳΔ
  32. Okinawa Open Days 2016 • ؂ࢹ͸ Zabbix ͕ࣗಈͰरͬͯ͘Δ • Zabbix͕ϝʔΧ΍໾ׂΛ൑ผͯ͠άϧʔϐϯά͢Δ

    • ωοτϫʔΫ؅ཧऀ͸ DNS ͷొ࿥ͱ ZTP ͷ४උ͚͓ͩͯ͘͠ • όοΫΞοϓͷδϣϒ͸ Jenkins ͕ຖ൩࣮ߦͯ͠ɺ໰୊͋Ε͹ Slack Ͱ௨஌ • όοΫΞοϓର৅͸ Zabbix ͷ API Λ Jenkins ͔Βୟ͍ͯ࠷৽Λऔ ಘ • VLAN ࡞੒ͳͲͷ JOB ΋ Zabbix ͷ࠷৽Λݩʹੜ੒͞ΕΔ ଞʹ΋͜Μͳͱ͜ΖͰAPI͕ɾɾɾ
  33. ωοτϫʔΫΤϯδχΞͷ೰Έ Okinawa Open Days 2016 ʮACL௥Ճͯ͠΄͍͠Μ͚ͩͲɻࠓ೔ʯ ʮVPNϢʔβͬͯࠓ୭͕ొ࿥͞Εͯ·͚ͨͬ͠ʁʯ ʮτϥϑΟοΫ͍ͬͯ·Ͳͷ͘Β͍ग़ͯ·͢ʁʯ ͜͏͍͏࡞ۀ͔Βղ์͞Ε·ͨ͠ɻ͓ޓ͍ʹɻ

  34. Okinawa Open Days 2016 ੈؒҰൠͷSDNͱ͸ҧ͏͚Ͳɺ
 
 ͜Ε΋Ұͭͷ
 Software Defined Network??

  35. ۤ࿑ͨ͠ϙΠϯτ Okinawa Open Days 2016 • APIͳ͠ͷػثΛૢ࡞͢Δ৔߹ɺexpectͰରԠͤ͟ΔΛಘͳ͍ ɹɹˠॲཧ్͕தͰࢭ·Δͱ͔ɾɾɾ ɹɹɹෛ୲ʹͳΒͳ͍ఔ౓ͷΤϥʔॲཧΛɻ •

    ໰୊͕͋ͬͨ࣌ͷ੾Γ෼͚ΛͲ͏͢Δ͔ ɹɹˠ DebugΦϓγϣϯΛ࣮૷ɻClientଆͰऔΕΔΑ͏ʹɻ ɹɹɹ APIͷΤϥʔίʔυͱϝοηʔδΛΫϥΠΞϯτଆ΁ग़ྗ • REST APIͷઃܭ ɹɹˠ ૉਓ͕΍ͬͨͷͰԚ͍ɻۤ࿑ͨ͠ํ͕ྑ͔ͬͨϙΠϯτɻ ɹɹɹ ޙչɻ
  36. Θ͔ͬͨ͜ͱ Okinawa Open Days 2016 • ݖݶपΓ͸ࣗ෼Ͱ࡞ͬͨ΄͏͕͍͍ ɹɹˠ ֤ػثͷػೳࠩΛٵऩ͢Δඞཁ͋Γ •

    ঎༻ʹཔΓ͗ͯ͢ϕϯμʔϩοΫΠϯʹͳΒͳ͍Α͏஫ҙ ɹɹˠ ίϯτϩʔϥʔཚཱ΋ͪΐͬͱɾɾɾ • Ͱ΋ࣗ࡞ͰଐਓԽʹ΋஫ҙɻΤϯδχΞʹҰఆͷϨϕϧΛ ɹɹˠ νʔϜ։ൃͰ͖Δ؀ڥΛ
  37. Interop Tokyo 2016 ෭࢈෺తͳ΋ͷͰ͕͢ɾɾɾ • ωοτϫʔΫػثͱͯ͠΋ɺσϓϩΠπʔϧͱͯ͠΋ɺӡ༻πʔϧͱͯ͠΋ɺط੒ ͷιϑτ΢ΣΞΛ׆༻͢Δ͜ͱͰΦʔϓϯͳωοτϫʔΫʹۙͮ͘͜ͱ͕Ͱ͖Δ • ࣮ࡍͷωοτϫʔΫΛ੍ޚ͢Δ૷ஔͷมΘΓʹιϑτ΢ΣΞͰωοτϫʔΫ Λ૊Ήʢϋʔυͱιϑτͷ෼཭ʣ͜ͱ΋͋Δ

    • σϓϩΠपΓͰ͸ɺదٓඞཁͳ࢓૊ΈΛࣾ಺Ͱ࡞ͬͯӡ༻ΛΧόʔ͍ͯ͠Δ έʔε΋͋ΔʢPython෦෼ͰதؒϨΠϠʔ࡞ͬͯHWͷࠩΛٵऩ͍ͯ͠·͢ʣ • Ͳ͜Ͳ͜੡ͷίϯτϩʔϥΛങ͏ͷ͔ɺࣗ෼ͰͦΕͬΆ͍࢓૊ΈΛ࡞Δͷ͔ ͸ɺϙϦγʔ࣍ୈͰ൑அ Okinawa Open Days 2016
  38. ·ͱΊ Okinawa Open Days 2016 • ϨΨγʔͳ؀ڥͰ΋ SDN ͷΑ͏ʹརศੑͷ޲্Λ໨ࢦ͢͜ ͱ͸Մೳ

    • ωοτϫʔΫΑΓ΋αʔόଆͷٕज़ֵ৽͕ਐΜͰ͓ΓɺΦʔ ϓϯͳٕज़Λར༻͍ͯ͠ΔͷͰඇৗʹࢀߟʹͳΔ 5෼ͷख࡞ۀΑΓ15෼ͰίʔυΛॻ͖·͠ΐ͏ ʢͦΜͳ࣌୅ʁʣ Automation is the new skillset that network engineers need to pick up. Much like sysadmins have had to learn how to use new tools like Chef and Puppet, network engineers are learning that they just can't do things manually anymore. With examples in each chapter, this practical book provides you with baseline skills in network programmability and automation, using a range of technologies including Linux, Python, JSON, and XML. No previous knowledge of software development, programming, automation, or DevOps is required.