社内の Platform を作る取り組み / #ocif16

Bc1e4b3a33fe6718f50285d1c1f53feb?s=47 Kodai Sakabe
September 17, 2016

社内の Platform を作る取り組み / #ocif16

OPEN CLOUD INNOVATION FESTA 2016@電気通信大学 B棟 1F 102

Wantedly は技術を使って課題解決しています。
すべてのエンジニアが大胆に美しく、スマートに「すごい」が自然と出てくる場を支えるために、インフラチームは存在します。

インフラチームの大事にしていること、自作ツール、新しいインフラをご紹介させていただきました。

Bc1e4b3a33fe6718f50285d1c1f53feb?s=128

Kodai Sakabe

September 17, 2016
Tweet

Transcript

  1. ,PEBJ4BLBCF!LPVEBJJJ8BOUFEMZ *OD ࣾ಺ͷ1MBUGPSNΛ࡞ΔऔΓ૊Έ 01&/$-06%*//07"5*0/'&45"

  2. ABOUT ME — Software Engineer — 2010/4- TIS ࡔ෦ ޿େ

    (KOUDAI SAKABE) 2015/8- Wantedly @koudaiii Site: http://koudaiii.com
  3. WANTEDLY — γΰτͰίίϩΦυϧͻͱΛ;΍͢—

  4. None
  5. -BVODI/FX WANTEDLY JOURNAL ͸ͨΒ͘Λ໘ന͘͢ΔϝσΟΞ ੈքʹࣗ෼ͷ੠Λൃ৴͠Α͏ ࿩Λฉ͖ʹߦ͖͍ͨ

  6. 3 @

  7. Wantedly Open API ͸ͨΒ͘Λ໘ന͘ʯΛςʔϚʹ͜Ε·ͰαʔϏε։ൃΛల։͖ͯͨ͠ 8BOUFEMZ͕ͦͷՁ஋Λ8BOUFEMZDPNυϝΠϯҎ֎ʹ΋޿͍͖͛ͯ·͢ɻ ੈͷதͷҰਓͰ΋ଟ͘ͷਓ͕ɺ͸ͨΒ͘Λ໘ന͘ʯײ͡ΒΕΔੈͷதʹͳΓ·͢Α͏ʹɻ Ͱ͖Δ͜ͱ ࣗಈೖྗ ΫοΫύουגࣜձࣾ ΫοΫύουגࣜձࣾ

    5݄13೔ʹฐࣾΦϑΟε಺ͷεϖʔεʹͯʮʲୈ17ճʳpotatotips(iOS/Android։ൃTips ڞ༗ձ)ʯ http://connpass.com/event/14143/ Λ։࠵͠·ͨ͠ʂ 18໊ͷൃදऀ͕5෼ؒͷLTʢϥΠτχϯάτʔΫɿΧϯϑΝϨϯεͳͲͰߦΘΕΔ୹͍ ΋ͬͱݟΔ ஑ా୓࢘ ϢʔβʔϑΝʔετਪਐ෦෦௕   ਓ͕ϑΥϩʔத  ਓ͕ϑΥϩʔத ϑΥϩʔ͢Δ ձࣾϑΟʔυϘοΫε ࿩Λฉ͖ʹߦ͘Ϙλϯ ϑΥʔϜࣗಈೖྗϘλϯ Wantedly্ʹ͋ΔʮձࣾϑΟʔυʯ Λɺϒϩά΍ίʔϙϨʔταΠτͳ Ͳɺ޷͖ͳϖʔδʹ؆୯ʹຒΊࠐΉ͜ ͱ͕Ͱ͖·͢ɻखܰͳ࠾༻ϒϥϯσΟ ϯά΍৘ใൃ৴ʹར༻Ͱ͖·͢ɻ ৄ͘͠ ৄ͘͠ ৄ͘͠ ࣗࣾαΠτ౳ͷืूཁ߲ʹɺʮ࿩Λฉ ͖ʹߦ͖͍ͨʯϘλϯΛઃஔ͠ɺ Wantedly্ͷʮ༡ͼʹ͍͘ମݧʯΛࣗ ࣾαΠτͰ΋ల։Ͱ͖·͢ɻ ࠾༻؅ཧγεςϜఏڙاۀ༷౳΁ͷಛ ผఏڙAPIͰ͢ɻީิऀ͕ืूʹΤϯ τϦ͢ΔࡍʹɺWantedly্ͷϓϩϑΟ ʔϧ৘ใΛ׆༻ͯ͠ΤϯτϦ͕Մೳʹ ͳΓ·͢ɻ
  8. WANTEDLY JOURNAL ͸ͨΒ͘Λ໘ന͘͢ΔϝσΟΞ γΰτͰίίϩΦυϧͬͯͳΜͩΖ͏ʁ 8BOUFMEZ͸ɺγΰτͰίίϩΦυϧਓΛ;΍͍ͨ͠ͱߟ͍͑ͯ·͢ɻ Ͱ͸ɺzγΰτͰίίϩΦυϧzͱ͸Ͳ͏͍͏ঢ়ଶͳͷͰ͠ΐ͏ʁ ͓٬͞Μʹʮ͋Γ͕ͱ͏ʯͱݴΘΕͨͱ͖ ໨ඪͷച্Λୡ੒ͨ͠ͱ͖ νʔϜϝϯόʔͷসإΛݟͨͱ͖ʜ ͦΕ͸ɺਓʹΑͬͯҧ͏Ͱ͠ΐ͏͠ɺ

    ࣌୅΍ࠃʹΑͬͯ΋·ͬͨ͘ҟͳΔͰ͠ΐ͏ɻ ࠓճϦϦʔε͢Δʮ8"/5&%-:+063/"-ʯͰ͸ɺ 8BOUFEMZΛ௨ͯ͠స৬ͨ͠ํ΍ɺීஈ͋·Γݟͨ͜ͱ͕ͳ͍اۀ΁ͷ ΠϯλϏϡʔΛ௨ͯ͠ɺzγΰτͰίίϩΦυϧzͱ͸Կͳͷ͔Λ୳ٻ͠·͢ɻ γΰτΛ୳͍ͯ͠Δਓ΋ɺͦ͏Ͱͳ͍ਓʹͱͬͯ΋ɺ ʮ8"/5&%-:+063/"-ʯ͕ಇ͖ํͷώϯτʹͳΕ͹޾͍Ͱ͢ɻ
  9. ੈքʹࣗ෼ͷ੠Λൃ৴͠Α͏

  10. None
  11. ࣾ಺ͷ1MBUGPSNΛ࡞ΔऔΓ૊Έ

  12. 8):

  13. େ୾ʹඒ͘͠ɺεϚʔτʹ ʮ͍͢͝ʯ͕ࣗવͱग़ͯ͘Δ৔Λࢧ͑Δ

  14. )08

  15. ٕज़తʹ༏Ґੑͷ͋ΔΠϯϑϥ ͬ͘͞ͱ୆ݐͯΕΔɾ৽͍͠෺͕͙͢ʹग़ͤΔ

  16. 8)"5

  17. ࣾ಺ͷ1MBUGPSNΛ࡞Δ ΤϯδχΞ͕ࠔ͍ͬͯΔ͜ͱΛͳ͘͢ɻίίϩΦυϧ͜ͱΛ΍Δɻ

  18. 8BOUFEMZ8BZ 6TFS'JSTU$PEF8JOT"SHVNFOUT4JNQMFJT/PU&BTZ

  19. 6TFS'JSTU w ʮ΋ͬͱ଎͍അं͕΄͍͠ʯͱ͍͏Ϣʔβͷ੠Λฉ͖ଓ͚ΔͷͰ͸ͳ͘ɺ ʮ଎͘Ҡಈ͍ͨ͠ʯͱ͍͏Ϣʔβͷຊ࣭తͳཉٻʹԠ͑Δߦҝ w ʮݴ༿ߦಈʯ w ϢʔβʔςετͰਓؒҧ͑ΔΑ͏ͩͬͨΓ·͍ͭͨ͝Γͨ͠Βվળ ͯ͠ɺ΋͏Ұճࢼͯ͠΋Βͬͯҧ͏ਓʹ΋ࢼͯ͠΋Β͏

  20. $PEF8JOT"SHVNFOUT w νʔϜͰ࣌ؒ.5(͢ΔͳΒDPEFΛॻ͍ͯݕূ͠Α͏ w ΤϯδχΞͷ৔߹ w ݶΒΕͨ৘ใͰܾஅΛͯ͠ɺલʹਐΜͰ͍Δ͔ w ԾઆΛ͋Ε͜Εߟ͑ΔΑΓɺ·ͣϓϩτλΠϓΛ࡞ͬͯૣֶ͘श͍ͯ͠Δ͔ w

    Ӧۀͷ৔߹ w ࣗ෼Ͱྑ͍ػೳ͕ු͔Μ͔ͩΒΤϯδχΞʹཔΉͷͰ͸ͳ͘ w اըॻΛॻ͍ͯձࣾΛճͬͯɺࣾఔ౓Λ֬໿ͯ͠ɺ͜ΕͳΒߦ͚ΔͱࢥͬͨΒΤϯδχΞʹཔΉ͜ͱ ͕ग़དྷΔ͔
  21. None
  22. None
  23. ೔ؒͰ݁ՌΛग़͢ʮάϩʔεج൫։ൃϋοΧιϯʯ w IUUQTXXXXBOUFEMZDPNDPNQBOJFTXBOUFEMZQPTU@BSUJDMFT  w ਓ૊̐νʔϜ w 3BJMT/PEF3FBDUͱ޷͖ͳݴޠͰ৽͘͠SFQPTJUPSZΛ࡞ͬͯ࢝Ί ͨΓ w

    "84%ZOBNP%#&MBTUJ$BDIF
  24. 4JNQMFJT/PU&BTZ w ࡞Δଆ͕࢖͏ଆͷࣄΛపఈతʹߟ͑ൈ͍͍ͯΔ͔ w ଍͢ΑΓ΋Ҿ͍ͯϑΥʔΧεΛ͍ͯ͠Δ͔ w ޮՌ͕ߴ͍ࢪࡦ ޮՌ͕௿͍ͱͦͷֻ͚ͨ޻਺෼Ͱ΋ͬͱ༗ޮͳվળ͸ͳ ͔ͬͨʁ 

    w ԾઆΛͨͯͯɺͦͷԾઆͷίΞͱͳΔ෦෼͚ͩʹϑΥʔΧεͰ͖͍ͯΔ͔
  25. FUD w %FNP%BZ༵ۚ೔ʹࣗ෼Ͱ࡞ͬͨ΋ͷࢪࡦΛશࣾһͷલͰൃද͢Δ৔ ෼ͷ-5  w ෛ࠴ฦࡁ೔σβΠφʔ΋ؚΊͯΤϯδχΞશһͰؙ೔ٕज़తͳෛ࠴ʹऔΓ૊Ή೔ w $.8$BO.VTU8BOU͓ޓ͍ͷίϛϡχέʔγϣϯ w

    POϦʔμʔͱͷίϛϡχέʔγϣϯ w &YQFDUBUJPOظ଴஋ઃఆ w CJ[@RVFTUJPOϏδωεଆ͔Βͷ࣭໰ΛΤϯδχΞ͕࣋ͪճΓͰճ౴͢Δ
  26. *OGSBTUSVDUVSF ࣾ಺ͷ1MBUGPSNΛ࡞Δ

  27. ೥݄೔ΑΓ)FSPLV͔Β"84΁

  28. 9BBTͱ"84ͷ྆ํΛ࢖͏ w ར༻Ͱ͖Δ΋ͷ͸ͲΜͲΜར༻͢Δ w εϐʔυײ w ίετײ w ؀ڥͷબ୒ CVJMEQBDLͩͱ΍Γʹ͍͘

     w ωοτϫʔΫ w )FSPLV΍3FEJT΍'JSFCBTFͱ"84૊Έ߹Θͤ
  29. #PUUMFOFDL ΤϯδχΞͷ૿ՃɺαʔϏεͷ૿Ճ Developer ΠϯϑϥνʔϜ λεΫґཔ WANTEDLY JOURNAL ͸ͨΒ͘Λ໘ന͘͢ΔϝσΟΞ ੈքʹࣗ෼ͷ੠Λൃ৴͠Α͏

  30. 8BOUFEMZ*OGSBTUSVDUVSF8BZ w $PEF8JOT"SHVNFOUT w มԽʹڧ͍ΠϯϑϥΛ w 6TFS'JSTU w %FWFMPQFS͕͍ͭͷؒʹ͔࢖͍ͬͯΔ΋ͷΛ w

    4JNQMFJT/PU&BTZ w ৔౰ͨΓతͳରԠͰ͸ͳ͘ɺࠜຊղܾΛ
  31. ίʔυԽͱࣗಈԽ w ΠϯϑϥΛૢ࡞͢Δ5PPMࣾ಺Ͱศརͳ$-*(6*৽͍ٕ͠ज़ج൫ Developer ΠϯϑϥνʔϜ API and Tool WANTEDLY JOURNAL

    ͸ͨΒ͘Λ໘ന͘͢ΔϝσΟΞ ੈքʹࣗ෼ͷ੠Λൃ৴͠Α͏
  32. ͜Ε·ͰͷऔΓ૊Έ w ศརπʔϧ w TBQEFQMPZTFSWFS w ೋஈ֊ϏϧυʹΑΔEFQMPZߴ଎ԽCMVFHSFFOEFQMPZNFOU w 5FSSBGPSN w

    $PSF04 w DFMM w SFQMBDF
  33. $ s3url —help #ظݶ෇͖URLΛൃߦ Usage of s3url: s3url https://s3-region.amazonaws.com/BUCKET/KEY [-d

    DURATION] s3url s3://BUCKET/KEY [-d DURATION] s3url -b BUCKET -k KEY [-d DURATION] $ ec2c —help # vagrant Ͱࢼͨ͠΋ͷΛ instance ͰݐͯΔ / tag Λ෇͚ΕΔ / ip Λ֬ೝͰ͖Δ Available commands are: launch Launch new EC2 instance list List EC2 instances tag Tag EC2 instances terminate Terminate the specified EC2 instance untag Tag EC2 instances ศརπʔϧ
  34. TBQ%FQMPZ4FSWFS w ඞཁͳ༷ʑͳ伴΍؀ڥม਺ΛݸਓͰઃఆ͠ͳͯ͘Α͍ w %FQMPZํ๏͕มΘΔΑ͏ͳΠϯϑϥͷߏ੒มߋ࣌ʹ΋ɺ֤ΤϯδχΞ͸खݩͷΞοϓσʔτΛ͢Δඞཁ͕ͳ͍ w %FQMPZ࣌ͷ֤ݸਓͷ࡞ۀ͕ίϯςφͷϩάͱͯ͠࢒Δ IUUQEFWDMBTTNFUIPEKQEFWPQTEFWPQTXBOUFEMZ TBQRBQT %FQMPZ4FSWFS

    TBQTZODEFQMPZ DBQTZODEFQMPZ TBQQSPESVOSBJMTD
  35. ೋஈ֊ϏϧυʹΑΔ%FQMPZߴ଎Խ w ϏϧυαʔόͰ%PDLFSΠϝʔδΛϏϧυ w ϓϥΠϕʔτ%PDLFSϨδετϦ 4 ΁Ξοϓϩʔυ

  36. ຊ൪αʔό܊ʹ࠷৽ͷ%PDLFSΠϝʔδΛμ΢ϯϩʔυ

  37. CMVFHSFFOEFQMPZNFOU w TUBOECZͰݹ͍ίϯςφΛ࡟আ͠৽͍͠ίϯςφΛىಈ w IFBMUIDIFDL͕੒ޭͨ͠ΒTXJUDIDPMPSͰ-PBE#BMBODFSΛ੾ସ

  38. %FQMPZ'MPX ϏϧυαʔόͰࢦఆͨ͠ϒϥϯνΛ(JU)VC͔Βऔಘ ϏϧυαʔόͰ༧Ί࡞੒͞ΕͨΠϝʔδΛݩʹ%PDLFSΠϝʔδΛ࠶Ϗϧυ ϓϥΠϕʔτ%PDLFSϨδετϦ 4 ΁Ξοϓϩʔυ ຊ൪αʔό܊ʹ࠷৽ͷ%PDLFSΠϝʔδΛμ΢ϯϩʔυ ຊ൪αʔό܈Ͱ৽͍͠ίϯςφΛىಈ͠ɺIFBMUIDIFDLΛ௨͢ ݹ͍΋ͷͱ੾ସ

  39. 5FSSBGPSN 1VMM3FRVFTUͰΠϯϑϥͷਃ੥ w "84 43%4&-#FUD EOTJNQMFEBUBEPHΛૢ࡞ IUUQTTQFBLFSEFDLDPNEUBOUFSSBGPSNBUXBOUFEMZUFDIDJSDMFOVNCFS

  40. $PSF04 w 6CVOUVΛར༻͍ͯͨ࣌͠ɺ%PDLFS΍3FHJTUSZͷWFSTJPOVQ͕େม w $PSF04͸EPDLFS͕ೖ͍ͬͯΔ0⒏DJBMBNJ͕͋Δ w CMVFHSFFOʹΑΔ04WFSTJPOVQ w 4ZTUFNE w

    )PTU্Ͱ࡞ۀ͕ग़དྷͳ͍ w ͢΂ͯͷαʔόʔΛ$PSF04ʹม͑ͨ
  41. "84ͷ5"(ͱ"VUP4DBMF(SPVQ w ͢΂ͯͷJOTUBODFͷಛఆ͸ɺ"84ͷ5"(Ͱఆٛ w \BQQXBOUFEMZ SPMFXFC EFQMPZNFOUCVMFHSFFO^ w Կ୆ಈ͔͍͔ͨ͠ʁ"4(ʹΠϯελϯε਺Λఆٛ w

    ඞཁͳΠϯϑϥπʔϧ͸-BVODI$POpHͰఆٛ w JOTUBODF্ཱ͕͕ͪΔͱ౰࣌ʹ5"(Λ֬ೝ͠ɺඞཁͳTFSWJDFΛ TZTUFNE͔Β্ཱͪ͛Δ
  42. DFMM w "845"(ΛݩʹαʔϏεΛಛఆ͠TZTUFNEʹొ࿥ w ࣗಈͰ4FSWJDFJO͢Δ w "EE%FMFUF%/43FDPSE

  43. SFQMBDFDPNNBOE w 0QFO44-΍*NBHF.BHJDL౳ͷ੬ऑੑ͸೥ʹԿճ͔ൃݟ͞ΕΔ w *OTUBODFΛ͢΂ͯೖΕସ͑Δͷ͸޻਺ֻ͕͔Δ w ಉ͡Α͏ͳ࡞ۀ͸ίʔυʹͯ͠ɺࣗಈԽͤ͞Δ w αʔϏε͝ͱʹίϚϯυҰͭͰ͢΂ͯͷΠϯελϯεΛೖΕସ͑Δ w

    ྫTBQTZODSFQMBDF
  44. ,VCFSOFUFT $MVTUFSJOHෳ਺ͷJOTUBODF͔Βେ͖͞ϦιʔεΛ࣮ݱ

  45. 8): w αʔϏεͷ෼ׂ΍৽نαʔϏεΛग़͢৔ ߹ɺΠϯϑϥνʔϜͷ΍Δ͜ͱ͕ଟ͍ w Πϯϑϥͷ҆ఆԽʹΑΓෳࡶԽ w ಉ͡Α͏ͳ࡞ۀ΋ଟ͍ Web Application

    Monitoring Logging Auto Scale Load Balancer Internal DNS
  46. ΫϥελϦϯά w "QQMJDBUJPOΛಈ͔ͤΔΠϯϑϥΛ͙͢࡞ͬͯ͘ΕͱݴΘΕͨ࣌ʹ࡞ΕΔ w ճݶΓͷ͙͢ऴΘΔλεΫͰ΋ಉ͡ΠϯλʔϑΣʔεͰग़ͤΔ w Τϥʔ͕͋ͬͨͱͯ͠΋ɺผͷͱ͜ΖͰ૸Βͤ௚ͤΔ w Ұͭͷେ͖ͳϦιʔεͱͯ͠ಈͨ͘Ίɺࠓ·Ͱߦ͖͍ͬͯͯͨ.POJUPSJOH ༻ʹίϯςφΛઃఆͯ͠ɺ࣍͸"4(༻ʹϚγϯΛཱͯͯɺ࣍͸Έ͍ͨͷ

    Α͏ͳΠϯϑϥ࡞ۀ͜ͱ͕ͳ͍ ʮԿ͕ԿॲͰಈ͍͍ͯΔ͔Λҙ͍ࣝͯ͠ͳ͚Ε͹ͳΒͳ͍ੈքʯ͔ΒʮԿ͕ಈ͍͍ͯΔ͔͚ͩҙ͍ࣝͯ͠Ε͹ྑ͍ੈքʯ
  47. ΫϥελϦϯά ʮԿ͕ԿॲͰಈ͍͍ͯΔ͔Λҙ͍ࣝͯ͠ͳ͚Ε͹ͳΒͳ͍ੈքʯ͔ΒʮԿ͕ಈ͍͍ͯΔ͔͚ͩҙ͍ࣝͯ͠Ε͹ྑ͍ੈքʯ Web Application Monitoring Logging Auto Scale Load Balancer

    Internal DNS Web Application Monitoring Logging Auto Scale Load Balancer Internal DNS Web Application Monitoring Logging Auto Scale Load Balancer Internal DNS Monitoring Logging Auto Scale Load Balancer Internal DNS ΠϯϑϥνʔϜ ΠϯϑϥνʔϜ ΠϯϑϥνʔϜ ΠϯϑϥνʔϜ
  48. ,VCFSOFUFT w IUUQCMPHSBJOUPXOPSHMPHHJOHLVCFSOFUFTQPETVTJOHqVFOUEIUNM w /PEFJOTUBODF w ෳ਺ͷJOTUBODFΛҰͭϦιʔε w -PHHJOH΍.POJUPSJOHͷΑ͏ͳ ֤/PEFʹ഑ஔ͍ͨ͠΋ͷ΋"1*

    Λ௨࣮ͯ͡ݱ w %FWFMPQFS͸ඞཁͳ4QFDΛఆٛ ͠ɺ"1*Λݺͼग़͢
  49. .POJUPSJOHCZ%BUBEPH %BFNPO4FU ֤/PEFʹରͯ͠഑ஔ͢Δ  $MVTUFSʹରͯ͠Ұ౓NBOJGFTUpMFΛૹΕ͹ͦͷ$MVTUFS͢΂ͯͷ.POJUPSJOH͕ग़དྷΔ

  50. %BTICPBSE TDPQFQPESDSDOBNFTQBDFͰߜΓࠐΈ"MFSUઃఆ

  51. ,VCFSOFUFT଎शձ %FWFMPQFS͕ͬ͘͞ͱLVCFSOFUFTΛཧղͯ͠ɺ࣮ࡍʹϦϦʔεͰ͖Δ

  52. PROJECT — API and kube CLI—

  53. IUUQTTQFBLFSEFDLDPNBXBLJBZPSJZPJBQJXP[VPSVUBNFOJ

  54. ,POH"SDIJUFDUVSF w ,POH$MVTUFSJOH w QMVHJO w 0"VUI w "$- w

    *13FTUSJDUJPO w 3BUF-JNJU w 3FRVFTU4J[FMJNJU w 3FTQPOTFMBUFMJNJU
  55. "1*(FOFSBUPS w XBOUFEMZBQJH w (PMBOH3&45GVM"1*4FSWFS (FOFSBUPS w XBOUFEMZQRHPSN w (FOFSBUFHPSNNPEFM

    TUSVDUTGSPN1PTUHSF42- EBUBCBTFTDIFNB
  56. Kubernetes for Wantedly kube Commands: • kube deploy • kube

    migration • kube diff • kube rollback • kube enable dotenv • kube enable private-repogitory quay • kube generate • kube tags • kube (kubectl subcommands) Container Tools: • kubectl • k8sec • slack notification(kubenotification) • deploy (kubeloy) • scheduler (?????) • ps/status (kubeps) Developer kube Server Kubernetes
  57. NEXT — େ୾ʹඒ͘͠ɺεϚʔτʹ—