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

Spring Cloudアプリケーションの開発にDockerを活用し、Kubernetes上に...

Spring Cloudアプリケーションの開発にDockerを活用し、Kubernetes上にデプロイするまで

JJUG CCC 2016 FALL ccc_gh6 の発表資料です。

Kenichiro Murata

December 03, 2016
Tweet

Other Decks in Technology

Transcript

  1. Copyright © Acroquest Technology Co., Ltd. All rights reserved. 4QSJOH$MPVEΞϓϦέʔγϣϯͷ

    ։ൃʹ%PDLFSΛ׆༻͠ɺ ,VCFSOFUFT্ʹσϓϩΠ͢Δ·Ͱ ++6($$$'"--DDD@H  "DSPRVFTU5FDIOPMPHZ$P -UE ଜాݡҰ࿠
  2. Copyright © Acroquest Technology Co., Ltd. All rights reserved. ࣗݾ঺հ

    w ଜాɹݡҰ࿠ w !NVSBLFO w "DSPRVFTU5FDIOPMPHZ w γχΞϓϩδΣΫτϚωʔ δϟʔ w ڵຯͷର৅ɿ+BWB*$0/*9 3%3"ΠϕϯτۦಈΞʔΩ ςΫνϟ&*1/-1 
  3. Copyright © Acroquest Technology Co., Ltd. All rights reserved. ࠓ೔ͷςʔϚ

    w ࠓΞϓϦέʔγϣϯΛ࡞ΔͳΒ$MPVE/BUJWF w +BWBϢʔβͳΒ4QSJOH#PPU4QSJOH$MPVE w Ͱ΋ɺ؀ڥ࡞Δͷ͸ͦΕͳΓʹେมɾɾɾ w ίϯςφΦʔέετϨʔγϣϯ,VCFSOFUFT w ։ൃͱӡ༻Λαϙʔτ͢ΔGBCSJD w ϩʔΧϧ؀ڥͱΠϯςάϨʔγϣϯ؀ڥΛγʔϜϨεʹ 
  4. Copyright © Acroquest Technology Co., Ltd. All rights reserved. lΫϥ΢υωΠςΟϒ͸ɺҰ؏ͨ͠ιϑτ΢ΣΞ

    σϦόϦʔΛΑΓ଎࣮֬͘ʹɺ͋ΒΏΔεέʔ ϧͰߦ͍ͬͯΔɺߴύϑΥʔϚϯεͳ૊৫͕࣋ ͭύλʔϯΛө͠ग़͠·͢ɻͦͯ͠ܧଓతσϦ όϦʔɺDevOpsɺ͓ΑͼϚΠΫϩαʔϏε͕ࣔ ͢ͷ͸ɺΫϥ΢υωΠςΟϒΛಋೖ͢Δཧ༝ɺ ͦͷํ๏ɺͦͯ͠Ϋϥ΢υωΠςΟϒͱ͸ԿͰ ͋Δ͔Ͱ͢ɻz – Pivotal Ϋϥ΢υωΠςΟϒ͕ॏཁͳཧ༝ https://pivotal.io/jp/cloud-native 
  5. Copyright © Acroquest Technology Co., Ltd. All rights reserved. $MPVE/BUJWF"QQMJDBUJPO

    w ཧ༝ɿܧଓతσϦόϦʔ w ํ๏ɿ%FW0QT w ࣮ଶɿϚΠΫϩαʔϏε 
  6. Copyright © Acroquest Technology Co., Ltd. All rights reserved. ઃܭͷΞϓϩʔν

    w 5XFMWF'BDUPS"QQ w ϚΠΫϩαʔϏεΞʔΩςΫνϟ w υϝΠϯۦಈઃܭ 
  7. Copyright © Acroquest Technology Co., Ltd. All rights reserved. 4QSJOH$MPVE

     %JTUSJCVUFE WFSTJPOFE DPOpHVSBUJPO 4FSWJDF SFHJTUSBUJPO BOEEJTDPWFSZ 3PVUJOH 4FSWJDFUP TFSWJDFDBMMT -PBECBMBODJOH $JSDVJU #SFBLFST %JTUSJCVUFE NFTTBHJOH %JTUSJCVUFE USBDJOH
  8. Copyright © Acroquest Technology Co., Ltd. All rights reserved. 4QSJOH$MPVE

    w 4QSJOH$MPVE/FUqJYʹೖ໳͢ΔͳΒͪ͜Β͕Φε εϝͰ͢ɻ  IUUQXXXTMJEFTIBSFOFUNBLJOHYTQSJOHDMPVEOFUqJY
  9. Copyright © Acroquest Technology Co., Ltd. All rights reserved. ؀ڥ࡞Δͷେม

    w &VSFLB4FSWFS w )ZTUSJY%BTICPBSE w ;JQLJO4FSWFS 
  10. Copyright © Acroquest Technology Co., Ltd. All rights reserved. 4QSJOH$MPVE$-*-BVODIFS

     IUUQTTQSJOHJPCMPHJOUSPEVDJOHUIFTQSJOHDMPVEDMJMBVODIFS
  11. Copyright © Acroquest Technology Co., Ltd. All rights reserved. 4QSJOH$MPVE$-*-BVODIFS

    CSFXUBQQJWPUBMUBQ CSFXJOTUBMMTQSJOHCPPU TQSJOHJOTUBMMPSHTQSJOHGSBNFXPSLDMPVETQSJOHDMPVEDMJ 3&-&"4& TQSJOHDMPVEMJTU DPOpHTFSWFSEBUBqPXFVSFLBIIZTUSJYEBTICPBSELBGLB[JQLJO TQSJOHDMPVEFVSFLBIZTUSJYEBTICPBSE[JQLJO 
  12. Copyright © Acroquest Technology Co., Ltd. All rights reserved. ࣍ͳΔ՝୊

    w 4DBMFPVU w %FTJHOPGGBJMVSF w 5SBDJOH w -PHHJOH w .POJUPSJOH 
  13. Copyright © Acroquest Technology Co., Ltd. All rights reserved. ࣍ͳΔ՝୊

    w ෳ਺ͷϓϩηεΛڠௐͯ͠ಈ࡞ͤ͞Δ؀ڥ͕ඞཁ w %PDLFSίϯςφͰ̍ͭͷϓϩηε͸ϙʔλϒϧʹ ͢Δͱͯ͠ɺ%PDLFS$PNQPTFʁ4XBSNʁ w ϩʔΧϧ؀ڥͰͷ։ൃମݧͷԆ௕ͱͯ͠ɺγʔϜϨ εʹΠϯςάϨʔγϣϯ؀ڥΛ࢖͍͍ͨ 
  14. Copyright © Acroquest Technology Co., Ltd. All rights reserved. ,VCFSOFUFT'FBUVSFT

    w "VUPNBUJDCJOQBDLJOH w 4FMGIFBMJOH w )PSJ[POUBMTDBMJOH w 4FSWJDFEJTDPWFSZBOEMPBECBMBODJOH w "VUPNBUFESPMMPVUTBOESPMMCBDLT w 4FDSFUBOEDPOpHVSBUJPONBOBHFNFOU w 4UPSBHFPSDIFTUSBUJPO w #BUDIFYFDVUJPO 
  15. Copyright © Acroquest Technology Co., Ltd. All rights reserved. ,VCFSOFUFTͷ࢝Ίํ

    w (PPHMF$POUBJOFS&OHJOF w "[VSF$POUBJOFS4FSWJDF w "84ʹߏங w ࣾ಺αʔόʹߏங w ϩʔΧϧ؀ڥʹߏஙʢNJOJLVCFʣ 
  16. Copyright © Acroquest Technology Co., Ltd. All rights reserved. GBCSJD

    IUUQTGBCSJDJP GBCSJDJTBOPQJOJPOBUFEBOE PQFOTPVSDF*OUFHSBUFE %FWFMPQFS1MBUGPSNGPSUIF $POUJOVPVT%FMJWFSZPG .JDSPTFSWJDFTVTJOH ,VCFSOFUFTBOE+FOLJOT 
  17. Copyright © Acroquest Technology Co., Ltd. All rights reserved. GBCSJDUFDIOPMPHJFT

    w 'BCSJD.BWFO1MVHJO w 4QSJOH$MPVE,VCFSOFUFT w ,VCFqJY w 'BCSJD,VCFSOFUFT.BOJGFTUT w +FOLJOT1JQFMJOFT$*$% 
  18. Copyright © Acroquest Technology Co., Ltd. All rights reserved. ϩʔΧϧ؀ڥͱΠϯςάϨʔ

    γϣϯ؀ڥΛγʔϜϨεʹ w ϩʔΧϧ؀ڥʹNJOJLVCFͱGBCSJDNBWFOQMVHJO ʹΑͬͯ։ൃ؀ڥΛߏங w ΠϯςάϨʔγϣϯ؀ڥͷ,VCFSOFUFTΫϥελ͸ Ϋϥ΢υɺΦϯϓϨϛεΛ໰ΘͣɺϩʔΧϧ؀ڥ͔ ΒπʔϧʢLVCFDUMɺGBCSJDNBWFOQMVHJOʣͷ ޲͖ઌΛม͑Δ͚ͩ 
  19. Copyright © Acroquest Technology Co., Ltd. All rights reserved. GBCSJDNBWFOQMVHJO

    w *OTUBMMJOH,VCFSOFUFTJO0OF$PNNBOE8JUI %SJOLJO)BOE IUUQTE[POFDPNBSUJDMFTJOTUBMMJOHLVCFSOFUFTGSPNDPQFOIBHFOBJSQPSUJOP  NWOJPGBCSJDGBCSJDNBWFOQMVHJODMVTUFSTUBSU w Ϋϥελͷߏஙͯ͠։࢝ NWOJPGBCSJDGBCSJDNBWFOQMVHJODMVTUFSTUPQ w Ϋϥελͷఀࢭ
  20. Copyright © Acroquest Technology Co., Ltd. All rights reserved. ิ଍

    w NBWFO͕ඞཁ w ίϚϯυΛ࣮ߦ͢ΔͱɺඞཁπʔϧʢHPGBCSJDɺ NJOJLVCFɺLVCFDUMʣΛμ΢ϯϩʔυͯࣗ͠ಈతʹ؀ڥߏ ஙͯ͘͠ΕΔ w 049Ͱ͸ɺWNESJWFS͸YIZWFΛਪ঑ʢCSFXJOTUBMM͠ ͨʣ w NJOJLVCFͷόʔδϣϯ͸WͰLVCFSOFUFTͷόʔδϣ ϯ͸ 
  21. Copyright © Acroquest Technology Co., Ltd. All rights reserved. GBCSJDNBWFOQMVHJO

    w "CVTZ+BWBEFWFMPQFSTHVJEFUPEFWFMPQJOH NJDSPTFSWJDFTPO,VCFSOFUFTBOEEPDLFS IUUQTCMPHGBCSJDJPBCVTZKBWBEFWFMPQFSTHVJEFUPEFWFMPQJOHNJDSPTFSWJDFTPOLVCFSOFUFTBOEEPDLFSCCGEG  NWOJPGBCSJDGBCSJDNBWFOQMVHJOTFUVQ w ηοτΞοϓʢQPNYNMʹQMVHJOΛ௥Ճʣ
  22. Copyright © Acroquest Technology Co., Ltd. All rights reserved. GBCSJDNBWFOQMVHJO

     NWOGBCSJDSVO%TLJQ5FTUT w ࣮ߦʢXBUDI͠ͳ͕Βʣ NWOGBCSJDEFQMPZ%TLJQ5FTUT w %FQMPZ NJOJLVCFEPDLFSFOW FWBM NJOJLVCFEPDLFSFOW w NJOJLVCFͷEPDLFSFOHJOFʹεΠον
  23. Copyright © Acroquest Technology Co., Ltd. All rights reserved. GBCSJDNBWFOQMVHJO

     NWOGBCSJDTUBSU w 4UBSU NWOGBCSJDEFQMPZ%GBCSJDSFQMJDBT w 4UBSUʢϨϓϦΧ਺Λࢦఆͯ͠ʣ NWOGBCSJDTUPQ w 4UPQ
  24. Copyright © Acroquest Technology Co., Ltd. All rights reserved. GBCSJDNBWFOQMVHJO

     NWOGBCSJDEFCVH%TLJQ5FTUT w %FCVHʢ*%&͔ΒϦϞʔτσόοάՄೳʣ NWOGBCSJDVOEFMQPZ w 6OEFQMPZ
  25. Copyright © Acroquest Technology Co., Ltd. All rights reserved. ࢓૊Έ

    w CVJME͢Δࡍʹɺ%PDLFSpMFΛ࡞੒ w ,VCFOSFUFTʹσϓϩΠ͢ΔͨΊͷZBNMϑΝΠϧ܈ Λੜ੒ w LVCFSOFUFTʹσϓϩΠ w LVCFSOFUFT্ʹରԠ͢Δ4FSWJDFɺ%FQMPZNFOUɺ 3FQMJDB4FUɺ1PE͕࡞ΒΕΔ 
  26. Copyright © Acroquest Technology Co., Ltd. All rights reserved. %PDLFSpMF

    FROM fabric8/java-alpine-openjdk8-jdk:1.2.1 ENV JAVA_APP_DIR=/deployments EXPOSE 8080 8778 9779 COPY maven /deployments/ 
  27. Copyright © Acroquest Technology Co., Ltd. All rights reserved. ,VCFSOFUFT%/4

     w 4FSWJDFΛ࡞Δ͜ͱͰ1PEͷαʔϏεΛެ։͢Δ͜ͱ͕Ͱ͖Δ w 4FSWJDFͱͯ͠ɺGPPTFSWJDFΛ࡞Δͱɺ,VCFOSFUFT%/4ͷ ࢓૊ΈʹΑΓ࣍ͰΞΫηεՄೳͱͳΔɻ w IUUQGPPTFSWJDF w IUUQTGPPTFSWJDF w 1PEͷϨϓϦΧ਺Λ૿΍ͯ͠΋ɺ,VCFSOFUFTͷ4FSWJDF͕ ϩʔυόϥϯγϯάͯ͘͠ΕΔͨΊɺར༻͢Δଆ͸ಛʹҙࣝ͢ Δඞཁ͕ͳ͍
  28. Copyright © Acroquest Technology Co., Ltd. All rights reserved. ՝୊

    4QSJOH$MPVEΞϓϦέʔγϣϯ Λ,VCFSOFUFT্Ͱಈ͔͍ͨ͠ 
  29. Copyright © Acroquest Technology Co., Ltd. All rights reserved. 4QSJOH$MPVE,VCFSOFUFT

     w 4QSJOH$MPVEΞϓϦέʔγϣϯΛ,VCFSOFUFT্ Ͱಈ࡞ͤ͞ΔͨΊͷϓϩδΣΫτ w ,VCFSOFUFT༻ͷ%JTDPWFSZ$MJOFU w $POpH.BQʹΑΔDPOpH؅ཧ w 1PE)FBMUI*OEJDBUPS w 3JCCPOɺ;JQLJOɺ5VSCJOF༻EJTDPWFSZ
  30. Copyright © Acroquest Technology Co., Ltd. All rights reserved. 4QSJOH$MPVE,VCFSOFUFT

     <dependency> <groupId>io.fabric8</groupId> <artifactId>spring-cloud-starter-kubernetes-zipkin</artifactId> </dependency> w QPNYNMʹ࣍Λ௥Ճ͢ΔʢWFSTJPO͸ʣ 4QSJOH#PPU͸3&-&"4&ʹɺ4QSJOH$MPVE͸ #SJYUPO43ʹ߹Θ͓ͤͯ͘
  31. Copyright © Acroquest Technology Co., Ltd. All rights reserved. )ZTUSJY%BTICPBSE

    5VSCJOF4FSWFS  LVCFDUMBQQMZGIUUQDFOUSBMNBWFOPSHNBWFOJPGBCSJDLVCFqJY IZTUSJYEBTICPBSEIZTUSJYEBTICPBSELVCFSOFUFTZNM LVCFDUMBQQMZGIUUQDFOUSBMNBWFOPSHNBWFOJPGBCSJDLVCFqJY UVSCJOFTFSWFSUVSCJOFTFSWFSLVCFSOFUFTZNM w σϓϩΠ LVCFDUMMBCFMTWDCBSTFSWJDFIZTUSJYFOBCMFEUSVF w ༗ޮԽ
  32. Copyright © Acroquest Technology Co., Ltd. All rights reserved. ;JQLJO

     LVCFDUMBQQMZGIUUQDFOUSBMNBWFOPSHNBWFOJPGBCSJD[JQLJO [JQLJOTUBSUFSNJOJNBM[JQLJOTUBSUFSNJOJNBMLVCFSOFUFTZNM w σϓϩΠ HPGBCSJDWPMVNFT w NZTRM༻ͷWPMVNFΛ࡞੒
  33. Copyright © Acroquest Technology Co., Ltd. All rights reserved. -PHHJOH.FUSJDT

     w -PHHJOH w &MBTUJDTFBSDI,JCBOBqVFOU w .FUSJDT w 1SPNFUIFVT(SBGBOB
  34. Copyright © Acroquest Technology Co., Ltd. All rights reserved. ܧଓతσϦόϦʔʹ޲͚ͯ

     w ,VCFSOFUFT3PMMJOHVQEBUF w ,VCFSOFUFT4FSWJDFʹΑΔ-BCFM4FMFDUPSΛ࢖ͬ ͨ#MVF(SFFO%FQMPZNFOU
  35. Copyright © Acroquest Technology Co., Ltd. All rights reserved. ࠓ೔ͷ·ͱΊ

    w ࠓΞϓϦέʔγϣϯΛ࡞ΔͳΒ$MPVE/BUJWF w +BWBϢʔβͳΒ4QSJOH#PPU4QSJOH$MPVE w ϩʔΧϧ؀ڥͰͷ։ൃΛޮ཰Խ͢Δ4QSJOH$MPVE$-*-BVODIFS w NJOJLVCFΛ࢖ͬͨ,VCFSOFUFTϩʔΧϧ؀ڥͷߏங w GBCSJDΛ׆༻͢Δͱɺ4QSJOH$MPVEΞϓϦέʔγϣϯΛ ,VCFSOFUT্Ͱಈ͔͢͜ͱ͕Ͱ͖Δ w ϩʔΧϧ؀ڥͱΠϯςάϨʔγϣϯ؀ڥΛγʔϜϨεʹ