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

Amazon EKS を活用した個人開発環境の整備と自動化への取り組み / CNDT2021

YuyaKoda
November 05, 2021

Amazon EKS を活用した個人開発環境の整備と自動化への取り組み / CNDT2021

CloudNativeDays Tokyo 2021
https://event.cloudnativedays.jp/cndt2021/

YuyaKoda

November 05, 2021
Tweet

More Decks by YuyaKoda

Other Decks in Technology

Transcript

  1. ΞδΣϯμ • ։ൃ؀ڥͷ֓ཁ ◦ ͳΓͨͪ΍γεςϜߏ੒ • ։ൃ؀ڥʹ͓͚Δ༷ʑͳ׆༻ࣄྫ ◦ &$4QPU*OTUBODFΛ׆༻ͨ͠ίετ࡟ݮࣄྫ ◦

    ,VCFSOFUFTͱ5FSSBGPSNͷϦιʔε؅ཧʹ͍ͭͯ ◦ ෳ਺ͷ*OHSFTT$POUSPMMFSͷ૊Έ߹Θͤ ◦ "OTJCMFLT.PEVMFΛ࢖ͬͨϦιʔε؅ཧ • ։ൃ༻%#ӡ༻ࣗಈԽʹ͍ͭͯ ◦ "844UFQ'VODUJPOTΛ࢖༻ͨ͠ϫʔΫϑϩʔ
  2. ࣾ಺։ൃ؀ڥͷͳΓͨͪ • ΞϓϦέʔγϣϯຊମ ݹΊͷ1)1  • ෳ਺୆ͷ3FEJT • ෳ਺୆ͷ.Z42- •

    ෳ਺ͷػೳΛ࣋ͬͨ"1*αʔό • ผΞϓϦέʔγϣϯͷ༧໿γεςϜ  3FUUZΛ։ൃ͢ΔͨΊʹ͸ෳ਺ͷγεςϜ͕ඞཁ ͜ΕΒ͢΂ͯΛϩʔΧϧ؀ڥʹ༻ҙ͢Δͷ͸େมʜ
  3. ࣾ಺։ൃ؀ڥͷͳΓͨͪ • ୆ͷαʔόΛ༻ҙ͠ɺͦ͜ʹ44)ͯ͠։ൃ͢ΔελΠϧ ◦ 1)1ͳͲඞཁͳ΋ͷ͸͢΂ͯଗ͍ͬͯΔ ϩʔΧϧͰ͸ෆཁ  ◦ ؀ڥߏங͸ෆཁͰ44)ϩάΠϯͯ͠HJUDMPOF͢ΔͷΈ ◦

    ϨϯλϧαʔόͷΑ͏ͳΠϝʔδ • Ͱ͖ͨ౰ॳ͸ࣾ಺ͷ,VCFSOFUFTΫϥελ W͘Β͍ Ͱಈ͍͍ͯͯɺ (,&ʹҠߦͨ͠ޙɺݱࡏ͸&,4ͰՔಇத ͦ͜Ͱ࡞ΒΕͨͷ͕ࣾ಺։ൃ؀ڥ
  4. ࣾ಺։ൃ؀ڥͷߏ੒ /'4 TTITFSWFS 1PE 1)1"QQ 4FSWJDF UZQF-PBE#BMBODFS *OHSFTT 44)ϩάΠϯͯ͠ίʔυΛฤू ˞ϗετ໊ͳͲ͸͢΂ͯՍۭͷ΋ͷ

    7PMVNF .PVOU IPNF\VTFS^SFUUZJOEFYQIQ ϢʔβYαʔϏεຖʹ࡞੒͞ΕΔϦιʔε 4FSWJDF WBSXXXIUNMJOEFYQIQ TTITFSWFSͰฤूͨ͠ίʔυΛ7PMVNF.PVOU IUUQT\VTFS^TFSWJDFGPPSFUUZNF ͷΑ͏ͳ63-ʹΞΫηεͯ֬͠ೝ
  5. ͳͥ,VCFSOFUFTʁ • ઃఆΛ:".-ϑΝΠϧͰ؅ཧͰ͖Δͷศར ◦ ʮجຊతʹ͸ಉ͡ઃఆͰϢʔβ໊ͷՕॴͷΈҟͳΔʯͳͲ͕਺ଟ͋͘Δ ͨΊɺςϯϓϨʔτԽͯ͠࢖͍΍͍͢ ◦ ͲͪΒ͔ͱ͍͏ͱ*B$ͷྑ͞తͳ࿩ʹ͍ۙ • ๛෋ͳΤίγεςϜΛ׆༻Ͱ͖Δ

    ◦ "84ͷαʔϏεͰ͸଍Γͳ͍෦෼Λิ͏͜ͱ͕Ͱ͖Δ ◦ ྫ͑͹"-#ͷෆ଍෦෼Λ/(*/9*OHSFTT$POUSPMMFSͰิ͏ͳͲ ʮࣗ෼͕ೖࣾ͢Δલ͔Βطʹ,VCFSOFUFTͰಈ͍͍͔ͯͨΒʜʯͱ͍͏ͷ΋ ͋Γ·͕͢ɺӡ༻ͯ͠Έͯಘͨؾ͖ͮΛ͍͔ͭ͘
  6. ./(ʹ&$4QPU*OTUBODF͕ରԠ ೥݄೔ʹ.BOBHFE/PEF(SPVQͰ&$4QPU*OTUBODF͕ରԠ ͞Εͨ🎉 • BXTOPEFUFSNJOBUJPOIBOEMFS͕ෆཁʹ✨  ◦ ./(୯ମͰLVCFDUMESBJO૬౰ͷॲཧΛߦͬͯ͘ΕΔΑ͏ʹͳͬͨ • &$JOTUBODFSFCBMBODFSFDPNNFOEBUJPOT΋👀

     ◦ ऴྃͷ෼લʹ௨஌͞ΕΔJOUFSSVQUJPO௨஌ΑΓ΋ઌʹ௨஌͞ΕΔ΋ͷ Ͱʮதஅͷةݥੑ͕ߴ·ͬͨ࣌ʯʹ௨஌͞ΕΔ ◦ ༨༟ͷ͋Δ͏ͪʹ৽͍͠ΠϯελϯεΛ্ཱͪ͛ͯΠΠײ͡ʹϦόϥϯγ ϯάͯ͘͠ΕΔ ˞ ˞&$JOTUBODFSFCBMBODFSFDPNNFOEBUJPOTIUUQTEPDTBXTBNB[PODPN"84&$MBUFTU6TFS(VJEFSFCBMBODFSFDPNNFOEBUJPOTIUNM
  7. &$4QPU*OTUBODFͷ·ͱΊ • Ͳ͏ͯ͠΋தஅͰ͖ͳ͍ϫʔΫϩʔυʹ͸ΦϯσϚϯυΠϯελϯε ◦ ࢖͑Δͱ͜Ζ͸εϙοτΛ࢖͏ ։ൃ؀ڥͰ͸ׂ͕εϙοτ  • ඞͣෳ਺ΠϯελϯελΠϓΛࢦఆ͢Δ͜ͱ ◦

    &$ͷࡏݿ੾ΕΛͳΔ΂͘๷͙ͨΊ ◦ ͪͳΈʹฐࣾ͸छྨͰӡ༻͍ͯ͠·͕͢೥Ҏ্େ͖ͳ໰୊͸ͳ͠ • ΦϯσϚϯυͱൺֱͯ͠&$Πϯελϯεʹ͔͔ΔίετΛׂ΄Ͳ࡟ݮ Ͱ͖ͨ💰
  8. 5FSSBGPSNͱ,VCFSOFUFT ,VCFSOFUFTͷϥΠϑαΠΫϧʹඥͮ͘ͱԿ͕໰୊͔ʁ • Ϋϥελ֎ͷ΋ͷ͸5FSSBGPSNͰ؅ཧ͍ͨ͠ ◦ 71$3%4ͳͲ"84Ϧιʔεͷ؅ཧΛ5FSSBGPSNʹد͍ͤͯΔͨΊ ◦ Ұํ,VCFSOFUFTͷϦιʔε͸,VCFSOFUFTϚχϑΣετͰ؅ཧ͍ͨ͠ • ۩ମతʹ͸"-#ͷઃఆ΋5FSSBGPSNͰ؅ཧ͍ͨ͠

    ◦ 5FSSBGPSNͰ࡞ͬͨ"$.ͷূ໌ॻΛ࢖͍͍ͨ ▪ ΞλονͰ͖Δ͚Ͳূ໌ॻͷ࡞੒͸5FSSBGPSNͰ΍ΔͷͰʜ ◦ 5FSSBGPSNͰ࡞ͬͨ4(Λ࢖͍͍ͨ ▪ ΞλονͰ͖Δ͚Ͳ4(ͷ࡞੒͸5FSSBGPSNͰ΍ΔͷͰʜ
  9. "84-PBE#BMBODFS$POUSPMMFS ԼهͷΑ͏ʹΫϥελ֎ͷϦιʔε͸5FSSBGPSNͰ࡞੒Ͱ͖Δ Kubernetes Terraform -JTUFS3VMF 5BSHFU(SPVQ "QQMJDBUJPO-PBE#BMBODFS 5BSHFU(SPVQ#JOEJOH 4FSWJDF 1PE

    -JTUFS3VMF 5BSHFU(SPVQ 4FSWJDF 1PE ˞5BSHFU5ZQF͕JQͷ৔߹ʹ͸5(͔Β௚઀1PEͷ*1ΞυϨε͕ࢦఆ͞ΕΔ 4FDVSJUZ (SPVQ 3PVUF 5BSHFU(SPVQ#JOEJOH3FTPVSDFΛ࢖༻ͨ͠Ϧιʔεͷ؅ཧ "$. πʔϧͷ؅ཧର৅ͷڥք͕෼͔Γ΍͘͢ͳͬͨ👍
  10. "-#Ͱ՝୊ʹͳͬͨͱ͜Ζ BXTMPBECBMBODFSDPOUSPMMFSʹΑΓΠΠײ͡ʹϦιʔεΛ؅ཧͰ͖ΔΑ͏ʹ ͳΓ·͕ͨ͠ɺ"-# *OHSFTT ͚ͩͰ͸গ͠ෆ҆ͳ෦෼͕͋Γ·ͨ͠ /'4 TTITFSWFS 1PE 1)1"QQ 4FSWJDF

    UZQF-PBE#BMBODFS *OHSFTT 44)ϩάΠϯͯ͠ίʔυΛฤू 7PMVNF.PVOU IPNF\VTFS^SFUUZJOEFYQIQ ϢʔβYαʔϏεຖʹ࡞੒͞ΕΔϦιʔε 4FSWJDF WBSXXXIUNMJOEFYQIQ TTITFSWFSͰฤूͨ͠ίʔυΛ7PMVNF.PVOU IUUQTEFW\VTFS^TFSWJDFSFUUZNF ͷΑ͏ͳ63-ʹΞΫηεͯ֬͠ೝ
  11. "-#Ͱ՝୊ʹͳͬͨͱ͜Ζ BXTMPBECBMBODFSDPOUSPMMFSʹΑΓΠΠײ͡ʹϦιʔεΛ؅ཧͰ͖ΔΑ͏ʹ ͳΓ·͕ͨ͠ɺ"-# *OHSFTT ͚ͩͰ͸গ͠ෆ҆ͳ෦෼͕͋Γ·ͨ͠ /'4 TTITFSWFS 1PE 1)1"QQ 4FSWJDF

    UZQF-PBE#BMBODFS *OHSFTT 44)ϩάΠϯͯ͠ίʔυΛฤू 7PMVNF.PVOU IPNF\VTFS^SFUUZJOEFYQIQ ϢʔβYαʔϏεຖʹ࡞੒͞ΕΔϦιʔε 4FSWJDF WBSXXXIUNMJOEFYQIQ TTITFSWFSͰฤूͨ͠ίʔυΛ7PMVNF.PVOU IUUQTEFW\VTFS^TFSWJDFSFUUZNF ͷΑ͏ͳ63-ʹΞΫηεͯ֬͠ೝ
  12. LVCFSOFUFTJOHSFTT /(*/9 ˞ϗετ໊͸Սۭͷ΋ͷ Kubernetes 1PE BMJDFSFUUZ *OHSFTT BMJDFSFUUZ 4FSWJDF BMJDFSFUUZ

    1PE OHJOYJOHSFTT 1PE CPCSFUUZ *OHSFTT CPCSFUUZ 4FSWJDF CPCSFUUZ BMJDFSFUUZGPPSFUUZNF CPCSFUUZGPPSFUUZNF "QQMJDBUJPO -PBE#BMBODFS GPPSFUUZNF Ұ୴͢΂ͯͷϦΫΤετΛ"-#Ͱड͚ͯͦͷ··/(*/9ʹྲྀ͠ɺ࣮ࡍͷ ϗετϕʔεͷϧʔςΟϯά͸/(*/9ଆͰߦ͏ "-#Λ׆༻ͭͭ͠"-#ͷ੍໿Λճආ͢Δ͜ͱ͕Ͱ͖ͨ👍 "$. 44-5FSNJOBUJPO
  13. LVCFSOFUFTJOHSFTT /(*/9 ͷ·ͱΊ • ػೳ͕଍Γͳ͍࣌͸ෳ਺ͷ*OHSFTT$POUSPMMFSΛ૊Έ߹Θͤͯྑ͍ͱ͜ औΓ͢Δબ୒ࢶ΋ΞϦ ◦ *OHSFTT$POUSPMMFSʹΑͬͯͦΕͧΕ࢖͑Δػೳ͕ҟͳΔͷͰཁ݅ ʹ߹Θͳ͍έʔε͸ෳ਺࢖͏બ୒ࢶ΋ ▪

    ,VCFSOFUFT*OHSFTT$POUSPMMFST4QSFBE4IFFUT ◦ ,VCFSOFUFT্Ͱ͸*OHSFTT$MBTT ˞ Λ࢖༻ͯ͠࢖͍෼͚Մೳ • ͨͩ͠౰વ؅ཧ͢Δର৅͕૿͑ΔͨΊͦͷ఺͸஫ҙ ˞*OHSFTTDMBTTIUUQTLVCFSOFUFTJPEPDTDPODFQUTTFSWJDFTOFUXPSLJOHJOHSFTTJOHSFTTDMBTT
  14. "OTJCMFLTNPEVMF Ansible k8s module ͱ͸ʁ🤔 • ,VCFSOFUFT্ͷϦιʔεΛ؅ཧ͢ΔͨΊͷϞδϡʔϧ OPU&,4  •

    ௨ৗͷ"OTJCMFͱಉ͡Α͏ʹ+JOKBςϯϓϨʔτ͕࢖͑Δ ◦ XIFO΍JG΍GPSͳͲ΋࢖͑ΔͷͰෳࡶͳ஋ͷग़͠෼͚͕Մೳ IUUQTHJUIVCDPNBOTJCMFDPMMFDUJPOTDPNNVOJUZLVCFSOFUFT
  15. "OTJCMFLTNPEVMF ݱࡏ͸ԼهͷΑ͏ʹม਺ϑΝΠϧʹ໊લͱඞཁͳ؀ڥΛॻ͖଍͚ͩ͢Ͱ௥ՃՄೳ ։ൃ؀ڥ௥Ճ࡟আͷ࡞ۀ࣌ؒ΍ख͕ܹؒݮͨ͠👍 • OBNF ։ൃऀ໊  ◦ 63-΍Ϧιʔεͷࣝผࢠ •

    HJUIVC (JU)VCΞΧ΢ϯτ໊  ◦ 44)αʔόͷެ։ݤऔಘ༻ ◦ IUUQTHJUIVCDPN\VTFSOBNF^LFZT • NJTTJPO@UZQF ෦ॺ໊  ◦ Ұ෦ͷ஋ͷग़͠෼͚ʹ࢖༻ • TFSWJDFT ௥Ճ͢ΔαʔϏε໊  ◦ ෳ਺Ͱ΋Ұ෦Ͱ΋Մ
  16. DSFBUF@EFW@ECTI  ຊ൪ͷεφοϓγϣοτ͔Β3%4ΛϦετΞ  σʔλͷϚεΩϯά 536/$"5&61%"5&   ։ൃ༻%#ͷ%/4Ϩίʔυ੾Γସ͑ 

    ߋ৽લͷ3%4Λ࡟আ ࠓ·Ͱͷߋ৽ํ๏ • ൿ఻ͷεΫϦϓτDSFBUF@EFW@ECTIΛ୲౰ऀ͕खݩͰ࣮ߦ͍ͯͨ͠ ◦ #BTI "84$-*੡ ◦ ௨஌͸ͳ͍ͷͰλʔϛφϧΛݟͯਐ௙֬ೝ ◦ ԿΒ͔ͷཧ༝Ͱࣦഊ͢Δ࣌΋Α͋͘Δ ͦͷࡍ͸࠷ॳ͔Β΍Γ௚͠😇 ࣌ؒ΋͔͔ͬͯͭΒ͍ʜ
  17. "844UFQ'VODUJPOT  εφοϓγϣοτΛ࡞੒ B ׬ྃ·Ͱ଴ػ 4MFFQ -PPQ   εφοϓγϣοτ͔ΒΠϯελϯεΛϦετΞ

    B ׬ྃ·Ͱ଴ػ 4MFFQ -PPQ   ϚεΩϯά42-Λྲྀ͢ B %#"ͳΒ%#"༻ͷ42-Λྲྀ͢ *G   DSFBUF@EFW@ECTIͷஔ͖׵͑ʹͪΐ͏Ͳ͍͍ͷͰ͸ʁ
  18. ։ൃ༻%#ࣗಈߋ৽ϫʔΫϑϩʔ &WFOU#SJEHF DSPO 4UFQ'VODUJPOT -BNCEB ݺͼग़͠ ຊ൪3%4 ։ൃ༻3%4 4MBDL ֤छ௨஌

    3PVUF ݄Ͱ࣮ߦ εφοϓγϣοτऔಘ ϦετΞϚεΩϯά Ϩίʔυ੾Γସ͑