Upgrade to Pro — share decks privately, control downloads, hide ads and more …

GKE in practice

GKE in practice

A talk about running an application on GKE in the production environment

827e4946bfbf81ecea3e12ef788fcdfb?s=128

Shun Yanaura

July 25, 2016
Tweet

Transcript

  1. GKE in Practice @ya7_ @GCPUG Shonan #4

  2. 8IPBSFZPV w 4IVO:BOBVSB w !ZB@PO5XJUUFS !ZBOBOBPO(JU)VC w ЕЕЕ'VODUJPOBM1SPHSBNNFSЕЕЕ w —)BTLFMM

    4DBMB $MPKVSF 1VSF4DSJQU 0$BNM *ESJT FUD w *OUFSFTUFEJO5ZQF5IFPSZ $BUFHPSZ5IFPSZ "MHPSJUINT w "MTP— #4% -JOVY w #VJMEJOH%.1BU%JHJUBM"EWFSUJTJOH$POTPSUJVN *OD
  3. ʮ࠷ۙͷ%PDLFSࣄ৘ʯ

  4. ͷ࿩͸͠·ͤΜ

  5. w ͔ͤͬ࣌ؒ͘Λ͍ͬͺ͍͍͚ͨͩͨͷͰɼ QSPEVDUJPO؀ڥͰ($1ɼಛʹ(,&ΛͲ͏࢖͍ͬͯΔ ͔ͱݴ͏࿩Λ͍ͨ͠ͱࢥ͍·͢ɻ

  6. w ͕࣌ؒ͋·ͬͨΒɼ࣮ࡍʹಈ͍͍ͯΔγεςϜߏ੒ ʹ͍ͭͯ΋આ໌͢Δ͔΋

  7. $POUBJOFSPSJFOUFEEFTJHO w ίϯςφΛલఏͱͨ͠ΞϓϦέʔγϣϯͷઃܭ͕ʢ͋ Δఔ౓ʣඞཁ w ͍ΘΏΔ5XFMWF'BDUPS"QQʹ͍ۙ΋ͷʹͳΔ

  8. $POUBJOFSPSJFOUFEEFTJHO w ؀ڥม਺ɼϙʔτɼڞ༗͢ΔσΟϨΫτϦͷ*0 w ઃܭ࣌ʹ·͔ͣ͜͜Βߟ͑Δ

  9. ,VCFSOFUFTͷجຊʢࡶʣ • “Kubernetes is an open-source platform for automating deployment,

    scaling, and operations of application containers across clusters of hosts, providing container-centric infrastructure.” - What is Kubernetes w ,VCFSOFUFT͸ίϯςφΛΫϥελ্Ͱ੍ޚ͢Δͷʹ ඞཁͳػೳΛఏڙ͢ΔΑɼͱͷ͜ͱʢࡶʣ
  10. ,VCFSOFUFTͷجຊʢࡶʣ w ௒୯७Խͯ͠આ໌͠·͢ w ຊ౰͸,VCFSOFUFT"1*ͷ֤ΦϒδΣΫτͷ࢓༷ΛݟΔͷ͕Ұ൪Θ͔ Γ΍͍͢ w /PEFɿ࣮ࡍʹίϯςφ͕ಈ͘Ϛγϯ w 1PEɿಉҰͷ/PEF্Ͱಈ͘ίϯςφͷू߹

    w 4FSWJDFɿ1PEʢͷू߹ʣ΁ͷΞΫηεΛಛఆͷ໊લΛ༩͑ͯެ։͢ Δ࢓૊Έ
  11. ,VCFSOFUFTͷجຊʢࡶʣ w ΄ͱΜͲ͸͜Ε͚ͩͰ0, w ,VCFSOFUFTͷυΩϡϝϯτʹ͋ΔɼνϡʔτϦΞϧ Λ΍Ε͹Πϝʔδ͸͙͢ʹΘ͘ͱࢥ͍·͢

  12. ΑΓ۩ମతʹ͸ʁ w ΦʔτεέʔϦϯά w ಉҰͷϗετ಺Ͱಈ͘ґଘؔ܎ͷ͋Δίϯςφؒͷ࿈ܞʢFHqVFOUEͷ GPSXBSEFSʣɻཁ͸TJEFLJDLɻ w αʔϏεσΟεΧόϦ w ϩʔϦϯάΞοϓσʔτ

    w ΞϓϦέʔγϣϯͷϨϓϦέʔγϣϯ w ͳͲͳͲ
  13. ͔͠͠

  14. ʅɾ@ɾA w ϗετΛIFUFSPHFOFPVTʹ͍ͨ͠ w ίϯςφͷϥΠϑαΠΫϧͱ͸ҟͳΔϥΠϑαΠΫϧͰ มΘΔΫϥελͷϝλ৘ใΛࢀর͍ͨ͠ w ϫϯγϣοτͷδϣϒ΍ఆظ࣮ߦδϣϒͷ࣮ߦΛͨ͠ ͍ w

    Φʔτεέʔϥʔ͏·͘ಈ͔ͳ͍
  15. ϗετΛIPNPHFOJPVTʹ͍ͨ͠ w ಉҰΫϥελ্Ͱɼผϗετʹ෼͚͍͚ͨͲɼඞཁ ͳϦιʔε͕େ͖͘ҟͳΔΑ͏ͳ৔߹ w ʢগͳ͘ͱ΋(,&্Ͱ͸ʣ͔ͭͯ͸࣮ݱͰ͖ͳ͔ͬ ͨ w OPEFQPPMͱ͍͏ػߏΛ༻͍Δ͜ͱͰ࣮ݱՄೳʹ

  16. ίϯςφͷϥΠϑαΠΫϧͱ͸ҟͳΔϥΠϑαΠ ΫϧͰมΘΔΫϥελͷϝλ৘ใΛࢀর͍ͨ͠ w 5XFMWF'BDUPS"QQͷྲّྀʹै͏ͱίϯςΫετ͸ ؀ڥม਺Ͱ౉͢͜ͱʹͳΔ͕ɼසൟʹΠϯϑϥɾΞ ϓϦέʔγϣϯͷߏ଄͕มΘΔ$POUBJOFS$FOUSJD "QQMJDBUJPOTͷ৔߹ʹ͸͜ͷ΍Γํ͕ϑΟοτ͠ͳ ͍ɻ w ͜ΕʹมΘΔ৽͍͠ϝλ৘ใ؅ཧػߏ͕ඞཁʂ

  17. ϝλ৘ใͷ؅ཧͲ͏͢Δʁ w ࣮͸,VCFSOFUFTࣗ਎͕ϝλ৘ใΛFUDEͱ͍͏ઐ༻ͷ EBUBCBTFʹ֨ೲ͍ͯ͠Δ w ͔͠͠(,&؀ڥͰ͸͜ͷFUDEʹΞΫηεͰ͖ͳ͍ w ࣗ෼ͰݐͯΔ͔ʜ ʅɾ@ɾA 

    w )BTIJDPSQͷ$POTVM͔$PSF04ͷFUDE͔ʜ ʅɾ@ɾA
  18. ϝλ৘ใͷ؅ཧͲ͏͢Δʁ w ͔͠͠ͲͪΒͰݐͯΔʹͯ͠΋ɼ,VCFSOFUFTελΠ ϧͰҰ༷ʹίϯςφઃఆΛ͹Β·͘ͱɼ͏·͘ઃఆ ͕Ͱ͖ͳ͍ɻ w Ϧʔμʔϊʔυ͕ͲΕ͔ɼͱ͔ϊʔυݻ༗ͷ৘ใ͕ ඞཁɻ·ͨɼԿׂ͔͸QSPYZͰಈ͔͍͚ͨ͠Ͳɼ͜ Ε΋ϊʔυݻ༗ͷΠϯσοΫε͕ඞཁʜɻ

  19. 1FUTWT$BUUMF w ,VCFSOFUFTͰ1FU4FUͱ͍͏֓೦͕ಋೖ͞Εͯɼ ϊʔυݻ༗ͷ৘ใΛ؅ཧͰ͖ΔΑ͏ʹͳͬͨΒ͍͠ ʢ·ͩͪΌΜͱݟ͍ͯͳ͍ʣɻ w ͪΌΜͱௐ΂·͢ ʅɾ@ɾA

  20. ϫϯγϣοτͷδϣϒ΍ఆظ࣮ߦδϣ ϒΛ࣮ߦ͍ͨ͠ • “Use the Jobs, Luke.”

  21. ϫϯγϣοτͷδϣϒ΍ఆظ࣮ߦδϣ ϒΛ࣮ߦ͍ͨ͠ w ͔ͦ͠͠͏୯७ͳ࿩Ͱ͸ແ͔ͬͨʜ ʅɾ@ɾA  w ,VCFSOFUFT·Ͱͷ+PCT͸ग़དྷͳ͍͜ͱ͕͋·Γʹଟ ͘ɼ$SPOͷ༷ͳεέδϡʔϧ࣮ߦ͸Ͱ͖ͳ͍ͷͰͨ͠ w

    ͔͠͠,VCFSOFUFTͰೖΔ༧ఆͩͬͨ4DIFEVMFE+PCT ʹΑͬͯ$ISPOPTͬΆ͍εέδϡʔϧ࣮ߦ͕Ͱ͖ΔΑ ͏ʹͳΔʜ͸ͣʜʹԆظ͞Εͨʜ ʅɾ@ɾA
  22. Φʔτεέʔϥʔ͏·͘ಈ͔ͳ͍ w ,VCFSOFUFTͷ)PMJ[POUBM1PE"VUP4DBMFSͱ($&ͷΦʔ τεέʔϧͷλΠϛϯά͕߹Θͳ͍ʜ ʅɾ@ɾA  w ͨͩ͠ɼ,VCFSOFUFT͕(,&ʹೖͬͨλΠϛϯά Ͱ͏·͍͘͘Β͍͠ͷͰ͜Ε͔Β࣮ݧ͠·͢ʂ