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

DockerとKubernetesでアプリケーション開発にコンテナをフル活用!

0aac627116c6e2a87b9ae179500801df?s=47 stormcat24
November 08, 2018

 DockerとKubernetesでアプリケーション開発にコンテナをフル活用!

11/7開催:DockerとKubernetesでアプリケーション開発にコンテナをフル活用!

http://www.itstaffing.jp/engineer/entry/20181022_2_1

0aac627116c6e2a87b9ae179500801df?s=128

stormcat24

November 08, 2018
Tweet

Transcript

  1. %PDLFSͱ,VCFSOFUFTͰ ΞϓϦέʔγϣϯ։ൃʹ ίϯςφΛϑϧ׆༻ʂɹ  "LJOPSJ:BNBEB!TUPSNDBU

  2. 1SPGJMF ‣ "LJOPSJ:BNBEB ‣ $ZCFS"HFOU *OD ‣ '3&4)-*7&UFDIMFBE ‣ IUUQTCMPHTUPSNDBUJP

    stormcat24
  3. %PDLFS,VCFSOFUFT ࣮ફίϯςφ։ൃೖ໳ ʢٕज़ධ࿦ࣾʣ

  4. ίϯςφ஌ࣝθϩ͔ΒͰ΋ɺ ຊ൪؀ڥͰίϯςφΛ࢖͑Δ·Ͱʹ ҰؾʹεΩϧҾ্͖͛ΔຊͰ͢

  5. )FBEMJOF ‣ %PDLFSͱ͸ʁίϯςφͱ͸ʁ ‣ %PDLFSΛମݧ͢Δ ‣ %PDLFSϑϨϯυϦͳΠϝʔδΛͭ͘Δ ‣ ίϯςφΦʔέετϨʔγϣϯͱ͸ʁ ‣

    ,VCFSOFUFTͰͷ࣮ફతͳΞϓϦέʔγϣϯ։ൃ ‣ ύϒϦοΫΫϥ΢υͰͷίϯςφӡ༻ ‣ ίϯςφͷӡ༻Λࢧ͑Δπʔϧ
  6. %PDLFSͱ͸ʁ ίϯςφͱ͸ʁ

  7. %PDLFS΍ίϯςφʹͲͷΑ͏ͳ ҹ৅Λ͍࣋ͬͯ·͔͢ʁ

  8. %PDLFSʁίϯςφʁ Ծ૝؀ڥʁ Πϯϑϥ ٕज़ʁ ܰྔʁ ࢖͍ॴ͸ʁ ։ൃ؀ڥ ޲͚ʁ

  9. %PDLFSͱ͸ ‣ ίϯςφܕԾ૷ٕज़Λ࣮ݱ͢ΔͨΊͷৗறΞϓϦέʔγϣϯͱ ίϚϯυϥΠϯπʔϧ͔Β੒ΔϓϩμΫτ ‣ Πϯϑϥٕज़ͱ͍͏ΑΓ͸ɺΞϓϦέʔγϣϯͷσϓϩΠʹಛ Խٕͨ͠ज़ ‣ ೥ɺ4PMPNPO)ZLFT͕044ͱͯ͠ެ։ ‣

    Ҏޙɺ%PDLFSࣾ΍ίϛϡχςΟΛத৺ʹ༷ʑͳπʔϧ΍Τίγ εςϜ͕։ൃɺίϯςφٕज़ͷΦʔϓϯԽ͕ਐΊΒΕ͍ͯΔ
  10. ୅දతͳԾ૝Խٕज़ ϗετ04ܕ Ծ૝Խٕज़ ίϯςφܕ Ծ૝Խٕज़

  11. Ծ૝Խٕज़ͷҧ͍

  12. ϗετܕԾ૝Խٕज़ͷಛ௃ ‣ ϗετܕԾ૝ԽͰ͸ɺԾ૝Խιϑτ΢ΣΞΛར༻͠ɺϋʔυ΢Σ ΞΛ$16ԋࢉʹΑͬͯ࠶ݱ͠ɺήετ04Λ࡞Γग़͢ ‣ Ծ૝04ͷ࠶ݱ౓͕ߴ͍෼ɺىಈॲཧ౳ͷΦʔόʔϔου͕େ͖ ͘ͳΔ ‣ 7.XBSF1MBZFS 0SBDMF7JSUVBM#PY౳

  13. ίϯςφܕԾ૝Խٕज़ͷಛ௃ ‣ ϗετܕͱ͸ҧ͍ɺίϯςφ͸ϗετ04ͷΧʔωϧϦιʔεΛ ڞ༗ͯ͠ར༻ ‣ ιϑτ΢ΣΞແ͠Ͱɺ04ͷϦιʔεΛ࿦ཧతʹԾ૝04ʢίϯς φʣͱִͯ͠཭͢Δ ‣ ίϯςφܕͰ͸ɺԾ૝04͸04ͷશͯͷػೳΛ࠶ݱ͢ΔΘ͚Ͱ͸ ͳ͍ͨΊɺͦͷ෼ϗετܕΑΓΦʔόʔϔου͕খ͍͞

    ‣ %PDLFSҎલ͸-9$ -JOVY$POUBJOFST ͕༗໊
  14. %PDLFSͷԾ૝ԽΞʔΩςΫνϟͷมભ

  15. %PDLFSΛԿʹ࢖͏ʁ

  16. %PDLFSΞϓϦέʔγϣϯͷ σϓϩΠʹಛԽٕͨ͠ज़

  17. ΞϓϦέʔγϣϯͷσϓϩΠʹಛԽͨ͠ಛ௃ ‣ ϗετʹࠨӈ͞Εͳ͍࣮ߦ؀ڥɺ؀ڥࠩҟ໰୊͔Βͷ୤٫ ‣ %PDLFSGJMFͰͷίϯςφߏ੒ɾΞϓϦέʔγϣϯ഑ஔఆٛ ‣ Πϝʔδͷόʔδϣϯ؅ཧ ‣ ࠩ෼Ϗϧυ͕ՄೳͳϨΠϠʔߏ଄Λ࣋ͭΠϝʔδϑΥʔϚοτ ‣

    %PDLFSϨδετϦʢΠϝʔδͷอ؅αʔόʣ ‣ ϓϩάϥϚϒϧͳ֤छ"1* ˞-9$͸ܰྔ͕ͩɺ͜ͷ؍఺͕͚͍ܽͯΔ
  18. ༏ΕͨϙʔλϏϦςΟ MPDBM EFWFMPQNFOU TUBHJOH QSPEVDUJPO %PDLFS͕Πϯετʔϧ͞Ε͍ͯΕ͹ɺ ಉ͡Πϝʔδ͔Β࡞ΒΕΔίϯςφΛଞͷϗετͰ༰қʹ࣮ߦͰ͖Δ

  19. ϙʔλϏϦςΟ͕΋ͨΒͨ͠΋ͷ ‣ ίϯςφʹΑͬͯɺήετ04ͱΞϓϦέʔγϣϯΛηοτͰΠ ϝʔδͱͯ͠ύοέʔδϯάͰ͖Δ ‣ %PDLFSίϯςφʹΑΔ؀ڥͷ࠶ݱੑ ‣ ΠϯϑϥͷଘࡏΛʢ͋·ΓʣؾʹͤͣʹσϓϩΠͰ͖Δ %PDLFSΛϑϧ׆༻ͨ͠։ൃͷྲྀߦ

  20. %PDLFSΛମݧ͢Δ

  21. ؀ڥߏங

  22. ϩʔΧϧͰͷ%PDLFS؀ڥߏங ‣ %PDLFS%FTLUPQ ‣ IUUQTXXXEPDLFSDPNQSPEVDUTEPDLFSEFTLUPQ

  23. ϩʔΧϧͰͷ%PDLFS؀ڥߏங

  24. ϩʔΧϧͰͷ%PDLFS؀ڥߏங EPDLFSWFSTJPO $MJFOU 7FSTJPODF "1*WFSTJPO (PWFSTJPOHP (JUDPNNJU⒎B #VJMU8FE+VM 04"SDIEBSXJOBNE &YQFSJNFOUBMGBMTF

    4FSWFS &OHJOF 7FSTJPODF "1*WFSTJPO NJOJNVNWFSTJPO  (PWFSTJPOHP (JUDPNNJU⒎B #VJMU8FE+VM 04"SDIMJOVYBNE
  25. %PDLFSΠϝʔδΛऔಘ͠ɺ %PDLFSίϯςφΛ࣮ߦ͢Δ

  26. Πϝʔδͱίϯςφͷҧ͍ ‣ %PDLFSΠϝʔδ ‣ %PDLFSίϯςφΛߏ੒͢ΔϑΝΠϧγεςϜ΍ɺ࣮ߦ͢ΔΞ ϓϦέʔγϣϯ΍ઃఆΛ·ͱΊͨ΋ͷ ‣ ίϯςφΛ࡞੒͢ΔͨΊʹར༻͞ΕΔςϯϓϨʔτͱͳΔ ‣ %PDLFSίϯςφ

    ‣ %PDLFSΠϝʔδΛجʹ࡞੒͞Εɺ۩ݱԽ͞ΕͨϑΝΠϧγε ςϜͱΞϓϦέʔγϣϯ͕࣮ߦ͞Ε͍ͯΔঢ়ଶ
  27. Πϝʔδͱίϯςφͷҧ͍

  28. FDIPίϯςφΛ࣮ߦ͢Δ ‣ HJIZPEPDLFSFDIPMBUFTUͱ͍͏Πϝʔδ͔ΒίϯςφΛ࣮ߦ ‣ ͜ͷΠϝʔδ͸%PDLFS)VCʹอ࣋͞Ε͍ͯΔ ‣ (&5ϦΫΤετΛ౤͛Δͱʮ)FMMP%PDLFSʯΛฦ͢ Demo-1

  29. FDIPίϯςφΛ࣮ߦ͢Δ Demo-1 %PDLFSΠϝʔδͷμ΢ϯϩʔυ EPDLFSJNBHFQVMMHJIZPEPDLFSFDIPMBUFTU %PDLFSίϯςφͷ࣮ߦ EPDLFSDPOUBJOFSSVOJUQHJIZPEPDLFSFDIPMBUFTU ϗετOS echoίϯςφ Port 8080

    Port 9000 ϙʔτϑΥϫʔυ HTTP GET
  30. FDIPίϯςφΛ࣮ߦ͢Δ Demo-1 ϑΥΞάϥ΢ϯυͰͷ࣮ߦ EPDLFSDPOUBJOFSSVOJUQHJIZPEPDLFSFDIPMBUFTU TUBSUTFSWFS SFDFJWFESFRVFTU όοΫάϥ΢ϯυͰͷ࣮ߦ EPDLFSDPOUBJOFSSVOEQHJIZPEPDLFSFDIPMBUFTU GEGGBBFCEʜ "1*΍8FCΞϓϦέʔγϣϯͰ͸ɺόοΫάϥ΢ϯυͰ࣮ߦ͢Δ

  31. %PDLFSΠϝʔδΛϏϧυ͢Δ

  32. %PDLFSGJMF ‣ '30.ϕʔεͱ͢ΔΠϝʔδΛܾఆ͢Δ ‣ $01:ϗετ͔ΒίϯςφʹϑΝΠϧΛίϐʔ͢Δ ‣ 36/ίϯςφ಺Ͱ೚ҙͷॲཧΛ࣮ߦ͢Δ ‣ $.%Πϝʔδ͔ΒίϯςφΛ࡞੒͢ΔࡍʹɺίϯςφͰ࣮ߦ ͢ΔϝΠϯϓϩηεΛઃఆ͢Δ

  33. %PDLFSΠϝʔδΛϏϧυ͢Δ Demo-2 USFF  ᵓᴷᴷ%PDLFSpMF ᵋᴷᴷIFMMPXPSME EJSFDUPSJFT pMFT IFMMPXPSMEεΫϦϓτΛίϯςφͰ࣮ߦ͢ΔͨΊͷΠϝʔδΛͭ͘Δ

  34. %PDLFSΠϝʔδΛϏϧυ͢Δ Demo-2 '30.VCVOUV $01:IFMMPXPSMEVTSMPDBMCJO 36/DINPE YVTSMPDBMCJOIFMMPXPSME $.%<IFMMPXPSME>

  35. %PDLFSΠϝʔδΛϏϧυ͢Δ Demo-2 IFMMPXPSMEMBUFTUͱ͍͏໊લͰΠϝʔδΛϏϧυ EPDLFSJNBHFCVJMEUIFMMPXPSMEMBUFTU  3FNPWJOHJOUFSNFEJBUFDPOUBJOFSDEBB DGBF 4VDDFTTGVMMZCVJMUDGBF 4VDDFTTGVMMZUBHHFEIFMMPXPSMEMBUFTU ࡞੒ͨ͠ΠϝʔδΛ֬ೝ

    EPDLFSJNBHFMTcHSFQIFMMPXPSME IFMMPXPSMEMBUFTUDGBFNJOVUFTBHP.#
  36. Πϝʔδ͔ΒίϯςφΛ࣮ߦ Demo-2 ࡞੒ͨ͠Πϝʔδ͔ΒίϯςφΛ࣮ߦ EPDLFSDPOUBJOFSSVOIFMMPXPSMEMBUFTU )FMMP 8PSME IFMMPXPSMEεΫϦϓτ͕ίϯςφͰ࣮ߦ εΫϦϓτ͕ऴྃ͢Δͱίϯςφ΋ऴྃ͢Δ

  37. %PDLFSϑϨϯυϦͳ ΠϝʔδΛͭ͘Δ

  38. ˞͓͞Β͍ %PDLFS͸༏ΕͨϙʔλϏϦςΟΛ࣋ͭ

  39. ίϯςφ͸ෳ੡͠΍͍͕͢ɾɾɾ EFWFMPQNFOU TUBHJOH QSPEVDUJPO ࣮ࡍʹ͸ΞϓϦέʔγϣϯͷڍಈ͸ σϓϩΠ͢Δ؀ڥʹΑ੍ͬͯޚ͢Δඞཁ͕͋Δ FHσʔλϕʔεͷ઀ଓઌ FHΞϓϦέʔγϣϯ͕ར༻͢Δ"1*ͷϗετ

  40. ίϯςφͷڍಈΛઃఆͰ੍ޚ͢Δ

  41. ઃఆΛίϯςφʹ౉͢ํ๏ ‣ ࣮ߦ࣌ͷҾ਺ ‣ ઃఆ͕ଟ͍৔߹ɺऔΓճ͠ʹ͍͘ ‣ ΞϓϦέʔγϣϯͷ؀ڥผઃఆϑΝΠϧ ‣ EFWFMPQ TUBHJOH

    QSPEVDUJPOผͷઃఆϑΝΠϧΛؚΊΔ ‣ ؀ڥ͕૿͑Δ৔߹ɺΞϓϦέʔγϣϯʴΠϝʔδͷϏϧυ͕ඞཁ ‣ ؀ڥม਺ ‣ ࠷΋Ԧಓͷख๏
  42. ؀ڥม਺੍ޚͷྑ͞ ‣ ؀ڥผઃఆϑΝΠϧͱҧ͍ɺ؀ڥ௥Ճͷ৔߹ʹઃఆϑΝΠϧΛ ௥Ճͯ͠Ϗϧυ͢Δඞཁ͕ແ͍ ‣ ؀ڥม਺୯ҐͰ੍ޚͰ͖ΔͷͰখճΓ͕ޮ͘ ‣ FH%#ͷίωΫγϣϯϓʔϧαΠζ͚ͩΛมߋ͢Δ ‣ τϥΠΞϯυΤϥʔͷ͠΍͢͞

  43. ؀ڥม਺Λ׆༻͢Δ %PDLFSϑϨϯυϦͳ Πϝʔδ࡞੒ʹܨ͕Δ

  44. FH4QSJOHͷQSPQFSUJFTϑΝΠϧ ECESJWFS$MBTT\%#@%3*7&3@$-"44DPNNZTRMKECD%SJWFS^ ECKECD6SM\%#@+%#$@63-^ ECVTFS\%#@64&3^ ECQBTTXPSE\%#@1"44803%^ ECJOJUJBM4J[F\%#@*/*5*"-@4*;&^ ECNBY"DUJWF\%#@."9@"$5*7&^ ECNBY*EMF\%#@."9@*%-&^ ECNJO*EMF\%#@.*/@*%-&^ ΞϓϦέʔγϣϯ͸؀ڥม਺ΛऔΕΔ࡞Γʹ͢Δ͜ͱ͕ॏཁʂ

  45. ίϯςφΦʔέετϨʔγϣϯ ͱ͸ʁ

  46. ίϯςφͰγεςϜΛߏங͢Δ ଟ͘ͷίϯςφΛσϓϩΠͰ͖Δ ଟ͘ͷ%PDLFSϗετ͕ඞཁ

  47. ίϯςφͷ഑ஔ͸೉͍͠ ‣ ͲͷछྨͷίϯςφΛͲͷΑ͏ʹ഑ஔ͢Δ͔ʁ ‣ ϗετͷϚγϯϦιʔεΛޮ཰తʹ࢖͏഑ஔ͸Ͳ͏ͳΔ͔ʁ ‣ ίϯςφ΁ͷΞΫηεܦ࿏ΛͲ͏ܾΊΔ͔ʁ ‣ εέʔϧΞ΢τΠϯΛͲͷΑ͏ʹߦ͏͔ʁ %PDLFS)PTU

    %PDLFS)PTU %PDLFS)PTU %PDLFS)PTU # & " % # & $ % & " $ %
  48. ਓ͕ؒߟ͑Δ͜ͱ͡Όͳ͍

  49. ෳ਺ͷϗετΛލ͗ ෳ਺छͷίϯςφΛໃ६ͷແ͍ܗͰ αʔόϦιʔεΛߟྀ͠ޮ཰తʹ഑ஔ͢Δ ίϯςφΦʔέετϨʔγϣϯٕज़

  50. ୅දతͳίϯςφΦʔέετϨʔγϣϯٕज़ ‣ %PDLFS$PNQPTF ‣ %PDLFS4XBSN4UBDL ‣ ,VCFSOFUFT ‣ "QBDIF.FTPT ‣

    "NB[PO&$$POUBJOFS4FSWJDFT &$4
  51. σϑΝΫτελϯμʔυ͸ ,VCFSOFUFT

  52. ,VCFSOFUFTͰͷ ࣮ફతͳΞϓϦέʔγϣϯ։ൃ

  53. ,VCFSOFUFTͱ͸ʁ ‣ ΫόωςΟεɺΫʔϕϧωΟςΟε౳ͱಡΉ ‣ ུশ͸LVCF΍LT ‣ (PPHMFࣾ಺ͷίϯςφج൫͔Β೿ੜ ‣ 044ͷίϯςφΦʔέετϨʔγϣϯγεςϜ ‣

    ༷ʑͳϓϥοτϑΥʔϜʹରԠͰߴػೳ ‣ ίϯςφͷ഑ஔ΍ɺϧʔςΟϯάͷܾఆ౳Λ͍͍ײ͡ʹ΍ͬͯ ͘ΕΔ
  54. ϩʔΧϧ؀ڥߏங %PDLFS%FTLUPQͷ,VCFSOFUFT౷߹Λ༗ޮʹ͢Δ

  55. LVCFDUM ‣ ,VCFSOFUFTΫϥελͷϦιʔεΛૢ࡞ɾӾཡ͢ΔͨΊͷίϚϯ υϥΠϯπʔϧ ‣ %PDLFS%FTLUPQͷ,VCFSOFUFT౷߹Λ༗ޮʹ͢ΔͱɺࣗಈͰΠ ϯετʔϧ͞ΕΔ

  56. ,VCFSOFUFTͷϦιʔε

  57. Ϧιʔεͱ͸ʁ ‣ ,VCFSOFUFTʹ͓͍ͯɺΞϓϦέʔγϣϯͷσϓϩΠΛ࣮ݱ͢Δ ͨΊʹඞཁͳ෦඼ͷΑ͏ͳ΋ͷ ‣ ࣮ߦ͞ΕΔΞϓϦέʔγϣϯ͸༷ʑͳϦιʔεͱڠௐ͢Δ͜ͱ ͰɺγεςϜͱͯ͠ಈ࡞͢Δ

  58. %FQMPZNFOU /BNFTQBDF 4FSWJDF *OHSFTT $POGJH.BQ %BFNPO4FU 4UBUFGVM4FU +PC 1PE 3FQMJDB4FU

    +PC $SPO+PC ,VCFSOFUFTͷϦιʔεͨͪ
  59. %FQMPZNFOU /BNFTQBDF 4FSWJDF *OHSFTT $POGJH.BQ %BFNPO4FU 4UBUFGVM4FU +PC 1PE 3FQMJDB4FU

    +PC $SPO+PC ,VCFSOFUFTͷϦιʔεͨͪ ࠓ೔͸͜ͷͭΛ঺հ͠·͢
  60. 1PE

  61. 1PE ‣ ίϯςφͷू߹ମͷ୯ҐͰɺগͳ͘ͱ΋ͭͷίϯςφΛ࣋ͭ ‣ ίϯςφಉ͕࢜ີ݁߹Ͱ͋Δํ͕౎߹͕ྑ͍৔߹ɺ1PEͱͯ͠ ෳ਺छίϯςφΛ·ͱΊͯσϓϩΠ͢Δ ‣ ,VCFSOFUFTͰ͸ίϯςφ୯ҐͰ͸ͳ͘ɺ1PE୯ҐͰσϓϩΠ͞ ΕΔ

  62. 1PE

  63. 1PEͷ഑ஔΠϝʔδ

  64. /PEFލ͗͸/( 1PEͰάϧʔϐϯά͞Εͨίϯςφ͸ ಉ͡/PEFʹ഑ஔ͞ΕΔ

  65. 1PEΛσϓϩΠ͢Δ Demo-3 apiVersion: v1 kind: Pod metadata: name: simple-echo spec:

    containers: - name: nginx image: gihyodocker/nginx-proxy:latest env: - name: BACKEND_HOST value: localhost:8080 ports: - containerPort: 80 - name: echo image: gihyodocker/echo:latest ports: - containerPort: 8080 /HJOYͱFDIPΞϓϦέʔγϣϯͰߏ੒͞ΕΔ1PEΛσϓϩΠ͢Δ
  66. ଞͷίϯςφ͸Ͳ͏ࢀর͢Δ͔ʁ Demo-3 1PEࣗ਎͕ͭͷԾ૝ϚγϯͷΑ͏ͳ΋ͷ FDIPίϯςφͷϙʔτ͸ɺ OHJOY͔Β͸MPDBMIPTUͱݟ͑Δ

  67. 1PEΛσϓϩΠ͢Δ Demo-3 ϚχϑΣετϑΝΠϧΛɺ,VCFSOFUFTΫϥελʹద༻͢Δ LVCFDUMBQQMZGTJNQMFQPEZBNM ࡞੒ͨ͠1PEΛ֬ೝ͢Δ LVCFDUMHFUQPE ࡞੒ͨ͠1PEͷϩάΛ֬ೝ͢Δ LVCFDUMMPHTGTJNQMFFDIPDFDIP ࡞੒ͨ͠1PEͷίϯςφͷதʹೖΔɹ LVCFDUMFYFDJUTJNQMFFDIPTIDOHJOY

  68. %FQMPZNFOU

  69. %FQMPZNFOU ‣ 1PE͸ͭͷϚχϑΣετϑΝΠϧʹ͖͔ͭͭ͠࡞੒Ͱ͖ͳ͍ ‣ ࣮ӡ༻Ͱ͸ɺಉ͡1PEΛେྔʹෳ੡͢Δ͜ͱͰՄ༻ੑΛߴΊΔ ‣ 3FQMJDB4FUͰ1PEͷෳ੡͕Ͱ͖Δ͕ɺ%FQMPZNFOU͸3FQMJDB4FU Λੈ୅؅ཧͰ͖ΔͨΊɺϩʔϧόοΫ΋Մೳ ‣ جຊతʹɺ1PE΍3FQMJDB4FUͷϚχϑΣετͰ͸ͳ͘

    %FQMPZNFOUͷϚχϑΣετϑΝΠϧΛ࡞੒͢Δͱߟ͑ͯ0,
  70. %FQMPZNFOUͱͷؔ࿈

  71. %FQMPZNFOUͷ࡞੒ Demo-4 apiVersion: apps/v1 kind: Deployment metadata: name: echo labels:

    app: echo spec: replicas: 3 selector: matchLabels: app: echo template: metadata: labels: app: echo spec: containers: - name: nginx image: gihyodocker/nginx:latest env: - name: BACKEND_HOST value: localhost:8080 ports: - containerPort: 80 - name: echo image: gihyodocker/echo:latest ports: - containerPort: 8080 ˡUFNQMBUFҎԼ͸ɺઌఔͷ1PEఆٛͱಉ͡
  72. %FQMPZNFOUΛ࡞੒͢Δ Demo-4 ϚχϑΣετϑΝΠϧΛɺ,VCFSOFUFTΫϥελʹద༻͢Δ LVCFDUMBQQMZGTJNQMFEFQMPZNFOUZBNM ࡞੒ͨ͠%FQMPZNFOUΛ֬ೝ͢Δ LVCFDUMHFUEFQMPZNFOUTFMFDUPSBQQFDIP 1PE͕ෳ਺ੜ੒͞Ε͍ͯΔ͔Λ֬ೝ͢Δ LVCFDUMHFUQPETFMFDUPSBQQFDIP

  73. 4FSWJDF

  74. 4FSWJDF ‣ 1PEͷू߹ʹର͢ΔϧʔςΟϯά΍αʔϏεσΟεΧόϦػೳ Λఏڙ͢ΔϦιʔε ‣ ಉ͡छྨͷෳ਺1PEʹର͠ɺτϥϑΟοΫΛྲྀͨ͢Ίͷϩʔυ όϥϯαʔͱͯ͠ͷػೳ΋࣋ͭ ‣ 4FSWJDF͔ΒͷτϥϑΟοΫͷసૹ͸ɺઃఆ͞ΕͨTFMFDUPSTͷ ϥϕϧͷ஋ʹΑܾͬͯఆ͞ΕΔ

    ‣ ,VCFSOFUFTΫϥελ಺෦Ͱ͸ɺ4FSWJDFͷ໊લͰ4FSWJDFʹ໊લ ղܾͰ͖Δ
  75. 4FSWJDFʹΑΔ1PEͷݟ͚ͭํ

  76. 4FSWJDFͷϚχϑΣετ Demo-5 apiVersion: v1 kind: Service metadata: name: echo spec:

    selector: app: echo release: summer ports: - name: http port: 80 ˡTFMFDUPSͰఆٛͨ͠ϥϕϧʹ Ϛον͢Δ1PEʹτϥϑΟοΫΛྲྀ͢
  77. 4FSWJDFΛ࡞੒͢Δ Demo-5 ϚχϑΣετϑΝΠϧΛɺ,VCFSOFUFTΫϥελʹద༻͢Δ LVCFDUMBQQMZGTJNQMFTFSWJDFZBNM ࡞੒ͨ͠4FSWJDFΛ֬ೝ͢Δ LVCFDUMHFUTWDFDIP σόοά༻ͷ1PEΛ࡞Γɺ͔ͦ͜Β࡞੒ͨ͠4FSWJDFʹରͯ͠)551ϦΫΤετ LVCFDUMSVOJSNUUZEFCVHJNBHFHJIZPEPDLFSGVOEBNFOUBM SFTUBSU/FWFSCBTIJM

  78. *OHSFTT

  79. *OHSFTT ‣ 4FSWJDF͸Ϋϥελ಺෦͔Β͔͠ΞΫηεͰ͖ͳ͍ ‣ 4FSWJDF͸Ϋϥελ֎෦΁ެ։͢ΔͨΊͷϦιʔε͕*OHSFTT ‣ 8FCΞϓϦέʔγϣϯ΍"1*ΞϓϦέʔγϣϯΛΠϯλʔωο τʹެ։͢Δ৔߹ඞཁ

  80. *OHSFTTͷϚχϑΣετ Demo-6 apiVersion: extensions/v1beta1 kind: Ingress metadata: name: echo spec:

    rules: - host: echo.gihyo.local http: paths: - path: / backend: serviceName: echo servicePort: 80 ˡެ։͢Δ4FSWJDF ˡެ։͢ΔυϝΠϯ ʢ7JSUVBM)PTUʣ
  81. *OHSFTTΛ࡞੒͢Δ Demo-6 ϚχϑΣετϑΝΠϧΛɺ,VCFSOFUFTΫϥελʹద༻͢Δ LVCFDUMBQQMZGTJNQMFJOHSFTTZBNM ࡞੒ͨ͠*OHSFTTΛ֬ೝ͢Δ LVCFDUMHFUJOHSFTT Ϋϥελ֎ʢϩʔΧϧʣ͔Βɺެ։͍ͯ͠Δ*OHSFTTʹରͯ͠ϦΫΤετΛૹΔɹ DVSMIUUQMPDBMIPTU))PTUFDIPHJIZPMPDBM`

  82. ͜͜·Ͱ͕Ұ௨ΓͷྲྀΕ ‣ 4FSWJDF΍*OHSFTT͸Ұ౓࡞ͬͯ͠·͑͹ɺมߋ͕ͳ͍ݶΓͦͷ ·· ‣ ܁Γฦ͠σϓϩΠ͢Δ৔߹͸ɺ%FQMPZNFOUʹߋ৽Λ͔͚ɺ৽͠ ͍ੈ୅ͷ3FQMJDB4FUͱ1PE͕࡞ΒΕΔ ‣ *OHSFTT4FSWJDF%FQMPZNFOU౳ͷϚχϑΣετΛύοέʔδϯ ά͠ɺҰׅͰσϓϩΠ͢Δ)FMNͱ͍͏πʔϧ΋͋Δ

  83. ࢀߟɿΑΓ࣮ફతͳߏ੒

  84. ύϒϦοΫΫϥ΢υͰͷ ίϯςφӡ༻

  85. ,VCFSOFUFTΛθϩ͔Βߏங͠ ӡ༻͢Δͷ͸ͱͯ΋େมͰ͢

  86. .BTUFS/PEF,VCFSOFUFTΫϥελશମͷ੍ޚ΍"1*Λఏڙ͢Δαʔό /PEF։ൃऀ͕σϓϩΠ͢Δ1PE౳ͷϦιʔε͕഑ஔ͞ΕΔαʔό

  87. ӡ༻ʹඞཁͳ࡞ۀΞϨίϨ ‣ ,VCFSOFUFTΫϥελͷߏங࡞ۀ ‣ LVCFTQSBZ LPQT౳ͷπʔϧ͕͋Δ͕ɺͦΕͰ΋؆୯Ͱ͸ͳ͍ ‣ Ϛελʔϊʔυͷ؅ཧ͕ඞཁ ‣ ,VCFSOFUFTΫϥελͷόʔδϣϯΞοϓ࡞ۀ

    ‣ *OHSFTT$POUSPMMFS΍"VUPTDBMJOH౳ɺӡ༻ʹඞཁͳ࢓૊ΈΛηο τΞοϓ͢Δඞཁ͕͋Δ ‣ ϞχλϦϯά΋ࣗલͰηοτΞοϓ
  88. ,VCFSOFUFT ϚωʔδυαʔϏεΛ࢖͓͏

  89. ୅දతͳϚωʔδυαʔϏε ‣ (PPHMF,VCFSOFUFT&OHJOF (,&  ‣ "NB[PO&MBTUJD$POUBJOFS4FSWJDFGPS,VCFSOFUFT &,4  ‣

    ౦ژϦʔδϣϯ͸·ͩະରԠ ‣ LTͰ͸ͳ͍ίϯςφϚωʔδυαʔϏε &$4 ΋͋Δ ‣ "[VSF,VCFSOFUFT4FSWJDF ",4
  90. ϚωʔδυαʔϏεͷྑ͍ͱ͜Ζ ‣ ,VCFSOFUFTΫϥελߏங͕ࣗಈ ‣ Ϛελʔϊʔυͷ؅ཧ͕ෆཁ ‣ ΫϥελͷόʔδϣϯΞοϓ΋͓·͔ͤ ‣ ϓϥοτϑΥʔϜผͷαʔϏεͱɺ਌࿨ੑͷߴ͍࿈ܞ͕Ͱ͖Δ ‣

    *OHSFTT΍ϩʔυόϥϯαʔͱͷ࿈ܞ౳ɹ ‣ "VUPTDBMJOHͰͷϊʔυ૿ݮʹ΋΋ͪΖΜରԠ ‣ ϩάͷӾཡ΍ϞχλϦϯάʹରԠ ‣ ։ൃऀʹͱͬͯຊ࣭తͰͳ͍࡞ۀ͸Ϛωʔδυ͕୅ߦ
  91. (,&Ͱͷ؅ཧը໘

  92. Ϛωʔδυͷબ୒͸(,&͕ݱ࣮త ‣ LT։ൃΛओಋ͢Δ(PPHMFʹΑΔϚωʔδυαʔϏεͰ͋Δ ‣ ",4΍&,4͸(,&ʹൺ΂ɺ΍΍஗ΕΛऔ͍ͬͯΔ෦෼͕ଟ͍ ‣ ػೳ໘΍؅ཧը໘ͷૢ࡞ੑ౳ɹ ‣ ಛघͳཧ༝͕ͳ͍ݶΓɺ(,&Λબ୒͢Δ͜ͱΛ͓͢͢Ί͠·͢

  93. ίϯςφӡ༻Λࢧ͑Δπʔϧ

  94. ίϯςφӡ༻Λࢧ͑Δπʔϧ ‣ &MBTUJDTFBSDI ,JCBOB ‣ TUBDLESJWFS ‣ TUFSO

  95. &MBTUJDTFBSDI ,JCBOB ‣ &MBTUJDTFBSDI ‣ શจݕࡧΤϯδϯ ‣ ίϯςφͷϩάΛอଘ͢ΔͨΊʹར༻ ‣ ,JCBOB

    ‣ ϩάσʔλՄࢹԽπʔϧ ‣ &MBTUJDTFBSDIʹอ࣋͞ΕͨϩάσʔλΛӾཡͰ͖Δ
  96. ϩάऩूͷ࢓૊Έ

  97. LJCBOBͰϩάӾཡ

  98. TUBDLESJWFSͰͷϩά֬ೝ

  99. TUFSO ‣ ίϚϯυϥΠϯͰɺ,VCFSOFUFTͷ1PE͕ग़ྗ͢ΔϩάΛUBJM͢ ΔͨΊͷπʔϧ ‣ IUUQTHJUIVCDPNXFSDLFSTUFSO ‣ ࢦఆͨ͠ϥϕϧʹώοτ͢Δ1PEͷϩάʹߜΓࠐΊΔ

  100. ·ͱΊ

  101. ·ͱΊ ‣ %PDLFS͸ܾͯ͠ΠϯϑϥدΓͷٕज़Ͱ͸ͳ͘ɺΞϓϦέʔγϣ ϯͷσϓϩΠʹಛԽٕͨ͠ज़ ‣ ϙʔλϏϦςΟʹຬͪͨɺ%PDLFSϑϨϯυϦͳΠϝʔδΛͭ͘ Δ͜ͱʹՁ஋͕͋Δ ‣ ༷ʑͳ,VCFSOFUFTϦιʔεΛ૊Έ߹ΘͤͯɺΞϓϦέʔγϣϯ ΛσϓϩΠ͢Δ

    ‣ ϚωʔδυαʔϏεʹཔΖ͏ʂʢಛʹཧ༝͕ͳ͚Ε͹(,&ʣ ‣ ίϯςφ։ൃΛࢧԉ͢Δɺ༷ʑͳπʔϧ͕ॆ࣮͍ͯ͠·͢
  102. 5IBOLT✋