Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
kubefork - development experience like owning y...
Search
Takamichi Omori
November 21, 2022
1
1.2k
kubefork - development experience like owning your own cluster
Cloud Native Days Tokyo 2022
movie:
https://event.cloudnativedays.jp/cndt2022/talks/1590
Takamichi Omori
November 21, 2022
Tweet
Share
More Decks by Takamichi Omori
See All by Takamichi Omori
pprof で見つけた OOM の真相 #layerxgo
onsd
0
430
プロダクトライフサイクルに合わせた 「技術選定」の実践
onsd
1
420
Go design theory learned from Kubernetes
onsd
9
3.3k
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
222
8.9k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
What's new in Ruby 2.0
geeforr
343
31k
For a Future-Friendly Web
brad_frost
175
9.4k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
6.9k
Gamification - CAS2011
davidbonilla
80
5k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
YesSQL, Process and Tooling at Scale
rocio
169
14k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
Transcript
©2021 Wantedly, Inc. kubefork ࣗઐ༻ͷΫϥελΛॴ༗͍ͯ͠ΔΑ͏ͳ։ൃମݧ CloudNative Days Tokyo 2022 Nov
21, 2022 - Takamichi Omori 1
©2022 Wantedly, Inc. *BN 2 Takamichi Omori @onsd_ Engineer at
DX Squad Love Kubernetes, Go, etc. Wantedly, Inc.
©2022 Wantedly, Inc. %94RVBEͱʁ %FWFMPQFSF9QFSJFODF4RVBE ٕज़ج൫νʔϜͱհ͞ΕΔ͜ͱଟ͍Ͱ͢ ະདྷͷ։ൃମݧΛͭ͘Δ ։ൃऀͷੜ࢈ੑΛ্ͤ͞ΔͨΊʹԿͰ͍ͬͯ͘νʔϜ ৽͍͠.JDSPTFSWJDFͷ։ൃମݧ ෳࡶͳ.JDSPTFSWJDFͰ։ൃ͕؆୯ʹߦ͑ΔΑ͏ͳΈ࡞Γ
©2022 Wantedly, Inc. ͢͜ͱ LVCFGPSL ࣗઐ༻ͷΫϥελΛॴ༗͍ͯ͠ΔΑ͏ͳ։ൃମݧ LVCFGPSLͱʁ LVCFGPSLͷΈ LVCFGPSLͷ۩ମతͳ࣮ LVCFGPSLΛࢧ͑ΔDVTUPNDPOUSPMMFS
LVCFGPSLͷσϞ LVCFGPSLͷͳΓͨͪ LVCFGPSLͷ͔͍ͭΈͪ
©2022 Wantedly, Inc. Kubefork ͱ ࣗઐ༻ͷΫϥελΛ͍࣋ͬͯΔΑ͏ͳମݧ Ұͭͷ։ൃ༻Ϋϥελ͔ΒԾతͳΫϥελΛ࡞ΔΈ Copy on Write
ΫϥελΛίϐʔ͢Δͷίετ͕͔͔Δ มߋ͍ͨ͠Օॴ͚ͩมߋ͠ɺ ڞ༗Ͱ͖ΔϦιʔεڞ༗͢Δ ΞΫηε͕͞Ε͍ͯΔͷͰ ଞͷ։ൃऀʹ໎͕͔͔Βͳ͍ ߴ มߋՕॴ͕࠷খݶ ڥʹΞΫηεͰ͖Δ·Ͱ͕ߴ 5
©2021 Wantedly, Inc. Photo by Jay Heike on Unsplash LVCFGPSLͷͳΓͨͪ
6
©2022 Wantedly, Inc. 7 8BOUFEMZͱϚΠΫϩαʔϏε ϚΠΫϩαʔϏε ΞʔΩςΫνϟ લޙͷίϯϙʔωϯτ ʹLVCFSFOFUFTຊ൪ಋೖ
https://docs.wantedly.dev/introduction/technical-overview ʹ&,4Ҡߦྃ
©2022 Wantedly, Inc. ϚΠΫϩαʔϏε։ൃͰେͳͭͷ͜ͱ มߋΛૉૣ͘ࢼͤΔ ͷͮ͘Γશൠʹ͓͍ͯେࣄ มߋ͕ྑ͔ͬͨɾѱ͔ͬͨ͜ͱͷϑΟʔυόοΫϧʔϓ ଞਓͷมߋͷӨڹΛड͚ͳ͍ ఆͱҟͳΔϨεϙϯεͷݪҼ୭ʁ
ݪҼ͕ࣗҎ֎ʹ͋ͬͨ߹ɺ֬ೝ͕͍͠ ґଘؔΛҙࣝ͢Δඞཁ͕ͳ͍ ͜ͷαʔϏεԿʹґଘ͍ͯ͠Δʁ ։ൃ͢ΔͨΊʹԿʹΞΫηεͰ͖ΔΑ͏ʹ͢Δඞཁ͕͋Δʁ αʔϏεɾػೳ͝ͱʹґଘؔΛ͓֮͑ͯ͘ͷେม
©2022 Wantedly, Inc. ΑΓΑ͍։ൃํ๏ େͳ͜ͱΛຬͨ͢։ൃํ๏͋Δʁ wมߋΛૉૣ͘ࢼͤΔ wଞਓͷมߋͷӨڹΛड͚ͳ͍ wґଘؔΛҙࣝ͠ͳ͍ ϩʔΧϧͰ։ൃ͢Δ
εςʔδϯάڥʹσϓϩΠ͢Δ 5FMFQSFTFODFΛ͏ ϚΠΫϩαʔϏε։ൃͷख๏Λൺֱ 8BOUFEMZͰߦΘΕ͍ͯͨ։ൃख๏Λൺֱ
©2022 Wantedly, Inc. طଘͷख๏ʢ̍ʣ ϩʔΧϧͰ։ൃ͢Δ ˓มߋΛૉૣ͘ࢼͤΔ %PDLFSCVJMEΛͨͳͯ͘Α͍ ˓ଞਓͷมߋͷӨڹΛड͚ͳ͍ खݩͰ։ൃ͍ͯ͠ΔͷͰଞਓͷӨڹड͚ͳ͍ ✕ґଘؔΛҙࣝ͢Δඞཁ͕ͳ͍
αʔϏεؒͷґଘؔΛΔඞཁ͕͋Δ ։ൃڥͷϝϯςφϯείετ͕͔͔Δ 10
©2022 Wantedly, Inc. طଘͷख๏ʢ̎ʣ εςʔδϯάڥʹσϓϩΠ͢Δ ˓ґଘؔΛҙࣝ͢Δඞཁ͕ͳ͍ ɹಈ͍͍ͯΔγεςϜͷҰ෦ΛೖΕସ͑Δ͚ͩ ✕มߋΛૉૣ͘ࢼͤΔ ɹ%PDLFSCVJMEΛͭඞཁ͕͋Δ
✕ଞਓͷมߋͷӨڹΛड͚ͳ͍ ɹڞ༻ͷڥͳͷͰɺଞͷ։ൃऀͷӨڹΛड͚Δ 11
©2022 Wantedly, Inc. طଘͷख๏ʢ̏ʣ 5FMFQSFTFODF ৄ͘͠IUUQTXXXUFMFQSFTFODFJP ˓มߋΛૉૣ͘ࢼͤΔ ɹEPDLFSCVJMEΛͭඞཁ͕ͳ͍ ˓ґଘؔΛҙࣝ͢Δඞཁ͕ͳ͍ ɹಈ͍͍ͯΔγεςϜͷதͷϦΫΤετ͕खݩʹඈΜͰ͘Δ
✕ଞਓͷมߋͷӨڹΛड͚ͳ͍ ɹڞ༻ͷΫϥελͰ࣮ߦ͢ΔͱଞਓͷϦΫΤετखݩʹདྷͯ͠·͏ $/$'4BOECPY1SPKFDU બͨ͠TFSWJDFͷϦΫΤετΛ ϩʔΧϧʹྲྀ͢͜ͱ͕Ͱ͖Δπʔϧ 12
©2022 Wantedly, Inc. Λຬͨ͢։ൃख๏ *TUJP UFMFQSFTFODF *TUJPͷϦΫΤετϧʔςΟϯάΛ׆༻ ಛఆͷϦΫΤετ͚ͩΛखݩʹϧʔςΟϯά ଞͷϦΫΤετڞ༻ͷڥΛ௨Δ
LVCFGPSLͷߟ͑ํ͔͜͜Βग़ൃ ˓มߋΛૉૣ͘ࢼͤΔ %PDLFSCVJMEΛͨͳͯ͘Α͍ ˓ଞਓͷมߋͷӨڹΛड͚ͳ͍ खݩͰ։ൃ͍ͯ͠ΔͷͰଞਓͷӨڹड͚ͳ͍ ˓ґଘؔΛҙࣝ͢Δඞཁ͕ͳ͍ ಈ͍͍ͯΔγεςϜͷதͷϦΫΤετ͕खݩʹඈΜͰ͘Δ ߋʹৄͪ͘͜͠ΒɿIUUQTTQFBLFSEFDLDPNNPSVYJTUJPJOUFHSBUFEUFMFQSFTFODF 13
©2022 Wantedly, Inc. *TUJP UFMFQSFTFODF͔ΒͷਐԽ HBUFXBZϨΠϠͷ࣮ TPNFEFWXBOUFEMZDPN GPSLFEBTPNFEFWXBOUFEMZDPN (BUFXBZ ࣗͷมߋʹϧʔςΟϯά͢ΔͨΊʹ
ಛผͳIFBEFS͕ඞཁͩͬͨ (BUFXBZϨΠϠͷಋೖʹΑΓIFBEFSͳ͠Ͱ ࣗͷมߋʹ౸ୡͰ͖ΔΑ͏ʹ 14 ࣮Ϋϥελ͔Β࡞͞ΕΔԾΫϥελΛࢦ͢ 'PSLFE"͕7JSUVBM$MVTUFSʹ֘ ϔομΛͬͯϧʔςΟϯάΛૢ࡞͢Δମݧ͔ΒɺΫϥελΛίϐʔ͢ΔΑ͏ͳମݧʹ 7JSUVBM$MVTUFS
©2022 Wantedly, Inc. LVCFGPSL LVCFGPSLͷ ϦΫΤετϧʔςΟϯάͳͲɺ 7JSUVBM$MVTUFSΛ࣮ݱ͢ΔͨΊʹ ଟ͘ͷϦιʔε͕ඞཁ
ͦ͜ͰϦιʔεΛҰׅͯ͠ཧ͢Δ ΧελϜίϯτϩʔϥʔΛ࣮ GPSLϦιʔεΛBQQMZ͢Δ͜ͱͰ ඞཁʹͳΔϦιʔεΛશͯ࡞Ͱ͖Δ Α͏ʹ ͜͜·ͰͰݱࡏͷΈ͕ LVCFGPSLͱݺͿΑ͏ʹ 15
©2022 Wantedly, Inc. 5FSNJOPMPHZ 7JSUVBM$MVTUFS ԾతͳLVCFSFOUFTΫϥελ 'PSL*EFOUJ fi FS 'PSL͢Δ
7JSUVBMDMVTUFSΛ۠ผ͢Δࣝผࢠ TIBSFE͔ΒWJSUVBMDMVTUFSΛ ಛఆͷGPSLJEFOUJ fi FSΛͱʹ ΞΫηεͰ͖Δ ࡞͢Δ͜ͱ 4ͭͷϚΠΫϩαʔϏε͔ΒͳΔγεςϜͱɺA,B ͷ fork ͞ΕͨΫϥελ 16
©2022 Wantedly, Inc. 5FSNJOPMPHZ 7JSUVBM$MVTUFS ԾతͳLVCFSFOUFTΫϥελ 'PSL*EFOUJ fi FS 'PSL͢Δ
7JSUVBMDMVTUFSΛ۠ผ͢Δࣝผࢠ TIBSFE͔ΒWJSUVBMDMVTUFSΛ ಛఆͷGPSLJEFOUJ fi FSΛͱʹ ΞΫηεͰ͖Δ ࡞͢Δ͜ͱ 4ͭͷϚΠΫϩαʔϏε͔ΒͳΔγεςϜͱɺA,B ͷ fork ͞ΕͨΫϥελ 17
©2022 Wantedly, Inc. 5FSNJOPMPHZ 7JSUVBM$MVTUFS ԾతͳLVCFSFOUFTΫϥελ 'PSL*EFOUJ fi FS 'PSL͢Δ
7JSUVBMDMVTUFSΛ۠ผ͢Δࣝผࢠ TIBSFE͔ΒWJSUVBMDMVTUFSΛ ಛఆͷGPSLJEFOUJ fi FSΛͱʹ ΞΫηεͰ͖Δ ࡞͢Δ͜ͱ 4ͭͷϚΠΫϩαʔϏε͔ΒͳΔγεςϜͱɺA,B ͷ fork ͞ΕͨΫϥελ 18
©2022 Wantedly, Inc. 5FSNJOPMPHZ 7JSUVBM$MVTUFS ԾతͳLVCFSFOUFTΫϥελ 'PSL*EFOUJ fi FS 'PSL͢Δ
7JSUVBMDMVTUFSΛ۠ผ͢Δࣝผࢠ TIBSFE͔ΒWJSUVBMDMVTUFSΛ ಛఆͷGPSLJEFOUJ fi FSΛͱʹ ΞΫηεͰ͖Δ ࡞͢Δ͜ͱ 4ͭͷϚΠΫϩαʔϏε͔ΒͳΔγεςϜͱɺA,B ͷ fork ͞ΕͨΫϥελ 19
©2021 Wantedly, Inc. Photo by Deva Darshan on Unsplash LVCFGPSLͷ͔͍ͭΈͪ
20
©2022 Wantedly, Inc. ,VCFGPSLͷ͔͍ͭΈͪ Ϣʔεέʔε ॳఆ͍ͯͨ͠Ϣʔεέʔε wΞϓϦέʔγϣϯ։ൃࢧԉ wखಈςετࢧԉ Ҏ্ͷӡ༻Λܦͯൃݟ͞ΕͨϢʔεέʔε w1VMM3FRVFTU1SFWJFX
w'FBUVSF fl BHͷͨΊͷڥੜ 21
©2022 Wantedly, Inc. *TUJPͷϦΫΤετϧʔςΟϯάΛ׆༻ ಛఆͷϦΫΤετ͚͕ͩϧʔςΟϯά͞ΕΔ 4FSWJDF %FQMPZNFOUΛ࡞
4FSWJDFʹUFMFQSFTFODFΛ࣮ߦ͠ Ϋϥελ͔ΒͷϦΫΤετΛखݩʹϧʔςΟϯά ࣾͰMPDBMGPSLͱݺΕ͍ͯΔ ఆ͍ͯͨ͠ϢʔεέʔεɿΞϓϦέʔγϣϯ։ൃࢧԉ 22
©2022 Wantedly, Inc. ఆ͍ͯͨ͠Ϣʔεέʔεɿखಈςετࢧԉ 23 *TUJPͷϦΫΤετϧʔςΟϯάΛ׆༻ ಛఆͷϦΫΤετ͚͕ͩϧʔςΟϯά͞ΕΔ
4FSJWJDF %FQMPZNFOUΛ࡞ ͜͜Ͱ࡞͢Δ%FQMPZNFOU͕ࣗมߋͨ͠ *NBHFΛઃఆ͓ͯ͘͠ WJSUVBMDMVTUFS͕࡞Ͱ͖Ε ϒϥβ͔Βมߋ͕ࢼͤΔ खಈςετɾϨϏϡʔͳͲͷ༻్Ͱར༻ ࣾͰSFNPUFGPSLͱݺΕ͍ͯΔ
©2022 Wantedly, Inc. ͪͳΈʹɿࣾͷ LVCF LVCFDUMͷϥούʔ ЋͷίϚϯυ Ϋϥελ͝ͱͷΞΫηεΛӅṭͨ͠Γ 7JSUVBMDMVTUFSͷ࡞ UFMFQSFTFODF
ΛશࣗಈͰߦ͏ LVCFDUMʹͳ͍ศརػೳ͕ར༻Մೳ LVCFGPSL 24 มߋ͕ೖͬͨ7JSUVBM$MVTUFSͷ࡞Λ ࣗಈͰߦ͏ LVCFGPSLSFNPUF
©2022 Wantedly, Inc. ৽͍͠Ϣʔεέʔε: Pull Request Preview 3FWJFXڥͷࣗಈੜ 13࡞࣌ʹWJSUVBMDMVTUFSΛࣗಈੜ ੜ͞Εͨ63-ʹΞΫηε͢ΔͱࢼͤΔ
.JDSPTFSWJDFͰ1SFWJFX ֎͔Β౸ୡͰ͖ͳ͍.JDSPTFSWJDF ʹϧʔςΟϯάՄೳ ੜ͞Εͨ63-ʹΞΫηε͢Δ͜ͱͰ Ұ෦͚ͩมߋ͞ΕͨγεςϜΛࢼͤΔ ඇΤϯδχΞʹࢼͯ͠Β͏ͱ͖ศར ڥߏங͕͍Βͳ͍ TBOECPYͷσʔλΛ͔ͭͬͯࢼͤΔ 25
©2022 Wantedly, Inc. ৽͍͠Ϣʔεέʔε: Pull Request Preview 3FWJFXڥͷࣗಈੜ 13࡞࣌ʹWJSUVBMDMVTUFSΛࣗಈੜ ੜ͞Εͨ63-ʹΞΫηε͢ΔͱࢼͤΔ
.JDSPTFSWJDFͰ1SFWJFXͰ͖Δ ֎͔Β౸ୡͰ͖ͳ͍.JDSPTFSWJDF ʹϧʔςΟϯάՄೳ ੜ͞Εͨ63-ʹΞΫηε͢Δ͜ͱͰ Ұ෦͚ͩมߋ͞ΕͨγεςϜΛࢼͤΔ ඇΤϯδχΞʹࢼͯ͠Β͏ͱ͖ศར ڥߏங͕͍Βͳ͍ TBOECPYͷσʔλΛ͔ͭͬͯࢼͤΔ 26
©2022 Wantedly, Inc. Pull Request Preview URL ͷΈ 27
։ൃऀ͕(JU)VCʹมߋΛQVTI มߋ͝ͱʹ%PDLFSJNBHFΛ࡞ %PDLFSJNBHFͷ४උ͕Ͱ͖ͨΒ 'PSLϦιʔεΛΫϥελʹ"QQMZ 7JSUVBM$MVTUFSͷ४උ͕Ͱ͖ͨΒ 13ʹίϝϯτ ίϝϯτ͞Εͨ63-ʹΞΫηε
©2022 Wantedly, Inc. ৽͍͠Ϣʔεέʔε: Feature Flag ͷͨΊͷڥੜ 'FBUVSF'MBH ΞϓϦέʔγϣϯͷڍಈΛมߋ͢ΔͨΊͷج൫ දతͳྫɿ"#UFTU
8BOUFEMZͷج൫)FBEFSͰ੍ޚՄೳ 9GFBUVSF fl BHT\TPNF"#UFTUz"z^ 'PSLJEFOUJ fi FSͱಉ͡Α͏ʹGFBUVSF fl BH͢Δ͜ͱͰ ޙଆͷNJDSPTFSWJDFͷڍಈͰม͑ΒΕΔ 28 )FBEFSΛ੍ͬͨޚ
©2022 Wantedly, Inc. ৽͍͠Ϣʔεέʔε: Feature Flag ͷͨΊͷڥੜ 'FBUVSF'MBH (BUFXBZ ಛఆͷGFBUVSF
fl BH͕༗ޮʹͳͬͨԾΫϥελ͕࡞Մೳ TPNFEFWXBOUFEMZDPN TPNFGFBUVSFFOBCMFETPNFEFWXBOUFEMZDPN ྫ "#UFTUͷಛఆͷWBSJBOUͰදࣔ ϦϦʔεલͷػೳΛ༗ޮʹ͢Δ 3BJMTͷΞϓϦέʔγϣϯͷBTTFUT ͚ͩखݩͷϦιʔεΛ͏ 29 'FBUVSF fl BHͳΒ৽نͷQPEແ͠Ͱར༻Մೳ
©2022 Wantedly, Inc. ͜͜·Ͱͷ·ͱΊ ,VCFGPSL wҰͭͷΫϥελ͔ΒԾΫϥελΛ࡞Ͱ͖Δ͘͠Έ wϢʔεέʔε wΞϓϦέʔγϣϯ։ൃࢧԉ wଞͷ։ൃऀʹ໎Λ͔͚ͣʹUFMFQSFTFODFͰ͖Δ wखಈςετࢧԉ
wखݩʹΞϓϦέʔγϣϯͷಈ࡞ڥ͕ͳͯ͘มߋΛ࣮ࡍͷϦΫΤετΛͬͯࢼͤΔ w1VMM3FRVFTU1SFWJFX wͲΜͳαʔϏεͰ৮Γͳ͕ΒࢼͤΔڥͷࣗಈੜ w'FBUVSF'MBHͷͨΊͷڥੜ wσόοάʹศརͳڥɺ"#ςετͷൺֱͷͨΊͷڥͷੜ 30
©2021 Wantedly, Inc. Photo by Kaleidico on Unsplash LVCFGPSLͷৄ͍͠Έ 31
©2022 Wantedly, Inc. ߏཁૉ Service Mesh *TUJPͷϦΫΤετϧʔςΟϯάΛ׆༻ ಛఆͷϔομ͕͍͍ͯΔϦΫΤετΛ ࢦఆͨ͠TFSWJDFʹϧʔςΟϯά͢Δ 32
Gateway "NCBTTBEPSͷIFBEFS༩ػೳΛ׆༻ ϗετ໊ͱϔομͷରԠ͚Λߦ͏
©2022 Wantedly, Inc. ߏཁૉ Service Mesh *TUJPͷϦΫΤετϧʔςΟϯάΛ׆༻ ಛఆͷϔομ͕͍͍ͯΔϦΫΤετΛ ࢦఆͨ͠TFSWJDFʹϧʔςΟϯά͢Δ 33
Gateway "NCBTTBEPSͷIFBEFS༩ػೳΛ׆༻ ϗετ໊ͱϔομͷରԠ͚Λߦ͏
©2022 Wantedly, Inc. ߏཁૉ apiVersion: networking.istio.io/v1beta1 kind: VirtualService metadata: labels:
fork.k8s.wantedly.com/service: backend name: backend namespace: backend spec: hosts: - backend http: - match: - headers: x-fork-identifier: exact: many-todo-red route: - destination: host: backend-kubefork-many-todo-red - route: - destination: host: backend Service Mesh *TUJPͷϦΫΤετϧʔςΟϯάΛ׆༻ ಛఆͷϔομ͕͍͍ͯΔϦΫΤετΛ ࢦఆͨ͠TFSWJDFʹϧʔςΟϯά͢Δ 34 Gateway "NCBTTBEPSͷIFBEFS༩ػೳΛ׆༻ ϗετ໊ͱϔομͷରԠ͚Λߦ͏
©2022 Wantedly, Inc. ߏཁૉ apiVersion: networking.istio.io/v1beta1 kind: VirtualService metadata: labels:
fork.k8s.wantedly.com/service: backend name: backend namespace: backend spec: hosts: - backend http: - match: - headers: x-fork-identifier: exact: many-todo-red route: - destination: host: backend-kubefork-many-todo-red - route: - destination: host: backend Service Mesh *TUJPͷϦΫΤετϧʔςΟϯάΛ׆༻ ಛఆͷϔομ͕͍͍ͯΔϦΫΤετΛ ࢦఆͨ͠TFSWJDFʹϧʔςΟϯά͢Δ 35 Gateway "NCBTTBEPSͷIFBEFS༩ػೳΛ׆༻ ϗετ໊ͱϔομͷରԠ͚Λߦ͏
©2022 Wantedly, Inc. ߏཁૉ Service Mesh *TUJPͷϦΫΤετϧʔςΟϯάΛ׆༻ ಛఆͷϔομ͕͍͍ͯΔϦΫΤετΛ ࢦఆͨ͠TFSWJDFʹϧʔςΟϯά͢Δ 36
Gateway "NCBTTBEPSͷIFBEFS༩ػೳΛ׆༻ ϗετ໊ͱϔομͷରԠ͚Λߦ͏
©2022 Wantedly, Inc. ߏཁૉ apiVersion: getambassador.io/v2 kind: Mapping metadata: labels:
fork.k8s.wantedly.com/manager: kubefork-manager name: backend-todo-test-many-todo-red namespace: emissary ownerReferences: spec: allow_upgrade: - websocket ambassador_id: - default add_request_headers: x-fork-identifier: many-todo-red x-forwarded-host: '%REQ(:authority)%' host: many-todo-red.backend.todo.test host_rewrite: backend.backend prefix: / rewrite: "" service: backend.backend timeout_ms: 90000 Service Mesh *TUJPͷϦΫΤετϧʔςΟϯάΛ׆༻ ಛఆͷϔομ͕͍͍ͯΔϦΫΤετΛ ࢦఆͨ͠TFSWJDFʹϧʔςΟϯά͢Δ 37 Gateway "NCBTTBEPSͷIFBEFS༩ػೳΛ׆༻ ϗετ໊ͱϔομͷରԠ͚Λߦ͏
©2022 Wantedly, Inc. ߏཁૉ apiVersion: getambassador.io/v2 kind: Mapping metadata: labels:
fork.k8s.wantedly.com/manager: kubefork-manager name: backend-todo-test-many-todo-red namespace: emissary ownerReferences: spec: allow_upgrade: - websocket ambassador_id: - default add_request_headers: x-fork-identifier: many-todo-red x-forwarded-host: '%REQ(:authority)%' host: many-todo-red.backend.todo.test host_rewrite: backend.backend prefix: / rewrite: "" service: backend.backend timeout_ms: 90000 Service Mesh *TUJPͷϦΫΤετϧʔςΟϯάΛ׆༻ ಛఆͷϔομ͕͍͍ͯΔϦΫΤετΛ ࢦఆͨ͠TFSWJDFʹϧʔςΟϯά͢Δ 38 Gateway "NCBTTBEPSͷIFBEFS༩ػೳΛ׆༻ ϗετ໊ͱϔομͷରԠ͚Λߦ͏
©2022 Wantedly, Inc. 7JSUVBMDMVTUFSͷ࡞ 7JSUVBM$MVTUFSʹඞཁͳϦιʔε w%FQMPZNFOU w4FSWJDF w7JSUVBM4FSWJDF w.BQQJOH 39
'PSLϦιʔε ্هͷϦιʔεΛҰׅͯ͠࡞͢Δ 'PSLϦιʔεΛBQQMZ͢Δͱ 7JSUVBMDMVTUFS͕࡞͞ΕΔମݧ 'PSLϦιʔεLVCFGPSLDPOUSPMMFS͕ఏڙɾཧ͢Δ
©2022 Wantedly, Inc. 7JSUVBMDMVTUFSͷ࡞ apiVersion: fork.k8s.wantedly.com/v1beta1 kind: Fork metadata: generation:
1 labels: fork.k8s.wantedly.com/identifier: red name: kubefork-red namespace: option spec: deployments: replicas: 1 selector: matchLabels: app: option template: metadata: labels: app: red role: fork spec: containers: - env: - name: FORK_IDENTIFIER value: red image: onsd/todo-option:other name: todo-option resources: {} identifier: red manager: emissary/kubefork-manager services: selector: matchLabels: app: option 7JSUVBM$MVTUFSʹඞཁͳϦιʔε w%FQMPZNFOU w4FSWJDF w7JSUVBM4FSWJDF w.BQQJOH 40 'PSLϦιʔε ্هͷϦιʔεΛҰׅͯ͠࡞͢Δ 'PSLϦιʔεΛBQQMZ͢Δͱ 7JSUVBMDMVTUFS͕࡞͞ΕΔମݧ 'PSLϦιʔεLVCFGPSLDPOUSPMMFS͕ఏڙɾཧ͢Δ
©2022 Wantedly, Inc. 7JSUVBMDMVTUFSͷ࡞ apiVersion: fork.k8s.wantedly.com/v1beta1 kind: Fork metadata: generation:
1 labels: fork.k8s.wantedly.com/identifier: red name: kubefork-red namespace: option spec: deployments: replicas: 1 selector: matchLabels: app: option template: metadata: labels: app: red role: fork spec: containers: - env: - name: FORK_IDENTIFIER value: red image: onsd/todo-option:other name: todo-option resources: {} identifier: red manager: emissary/kubefork-manager services: selector: matchLabels: app: option 7JSUVBM$MVTUFSʹඞཁͳϦιʔε w%FQMPZNFOU w4FSWJDF w7JSUVBM4FSWJDF w.BQQJOH 41 'PSLϦιʔε ্هͷϦιʔεΛҰׅͯ͠࡞͢Δ 'PSLϦιʔεΛBQQMZ͢Δͱ 7JSUVBMDMVTUFS͕࡞͞ΕΔମݧ 'PSLϦιʔεLVCFGPSLDPOUSPMMFS͕ఏڙɾཧ͢Δ
©2022 Wantedly, Inc. 7JSUVBMDMVTUFSͷ࡞ apiVersion: fork.k8s.wantedly.com/v1beta1 kind: Fork metadata: generation:
1 labels: fork.k8s.wantedly.com/identifier: red name: kubefork-red namespace: option spec: deployments: replicas: 1 selector: matchLabels: app: option template: metadata: labels: app: red role: fork spec: containers: - env: - name: FORK_IDENTIFIER value: red image: onsd/todo-option:other name: todo-option resources: {} identifier: red manager: emissary/kubefork-manager services: selector: matchLabels: app: option 7JSUVBM$MVTUFSʹඞཁͳϦιʔε w%FQMPZNFOU w4FSWJDF w7JSUVBM4FSWJDF w.BQQJOH 42 'PSLϦιʔε ্هͷϦιʔεΛҰׅͯ͠࡞͢Δ 'PSLϦιʔεΛBQQMZ͢Δͱ 7JSUVBMDMVTUFS͕࡞͞ΕΔମݧ 'PSLϦιʔεLVCFGPSLDPOUSPMMFS͕ఏڙɾཧ͢Δ
©2022 Wantedly, Inc. 7JSUVBMDMVTUFSͷ࡞ apiVersion: fork.k8s.wantedly.com/v1beta1 kind: Fork metadata: generation:
1 labels: fork.k8s.wantedly.com/identifier: red name: kubefork-red namespace: option spec: deployments: replicas: 1 selector: matchLabels: app: option template: metadata: labels: app: red role: fork spec: containers: - env: - name: FORK_IDENTIFIER value: red image: onsd/todo-option:other name: todo-option resources: {} identifier: red manager: emissary/kubefork-manager services: selector: matchLabels: app: option 7JSUVBM$MVTUFSʹඞཁͳϦιʔε w%FQMPZNFOU w4FSWJDF w7JSUVBM4FSWJDF w.BQQJOH 43 'PSLϦιʔε ্هͷϦιʔεΛҰׅͯ͠࡞͢Δ 'PSLϦιʔεΛBQQMZ͢Δͱ 7JSUVBMDMVTUFS͕࡞͞ΕΔମݧ 'PSLϦιʔεLVCFGPSLDPOUSPMMFS͕ఏڙɾཧ͢Δ
©2022 Wantedly, Inc. kubefork ʹؔ࿈͢ΔϦιʔε 44 ਫ৭Ͱғ·Ε͍ͯΔͷ͕WJSUVBMDMVTUFSͷ࡞ʹඞཁͳϦιʔε
©2022 Wantedly, Inc. LVCFGPSLDPOUSPMMFS ͕044ʹͳΓ·ͨ͠ (JU)VCʹͯެ։த 45 https://github.com/wantedly/kubefork-controller
©2022 Wantedly, Inc. LVCFGPSLDPOUSPMMFSʹؚ·Ε͍ͯΔͷ $POUPSPMMFSͷ࣮ ,VCFGPSLͷ࣮ݱʹඞཁͳ࣮શͯ LVCFGPSLͱʁͱ͍ͬͨͱ͜Ζ͔Βɺ֤छϦιʔεͷઆ໌·Ͱ LVCFGPSLͷυΩϡϝϯτ 46 'PSLϦιʔεΛੜ͢ΔͨΊͷ$-*
LVCFGPSLDUM
©2022 Wantedly, Inc. σϞ 47 5PEPදࣔαʔϏε ̏ͭͷαʔϏε͔ΒͳΔ 'SPOUFOE
#BDLFOE͔ΒUPEPΛऔಘ #BDLFOE 5PEPͷϦετΛ͍࣋ͬͯΔ ϦΫΤετ͕དྷΔͱɺ0QUJPO͔Β 5PEPͷ৭Λऔಘͯ͠ฦ͢ 0QUJPO 5PEPͷ৭Λฦ͢αʔϏε
©2022 Wantedly, Inc. σϞ 48 7JSUVBM$MVTUFS ඞͣ৭Λฦ͢มߋΛPQUJPOͰࢼͨ͢Ίʹ มߋ͕ೖͬͨWJSUVBMDMVTUFSΛ࡞͢Δ
GPSLJEFOUJ fi FSSFEʹͨ͠ SFEUPEPUFTUͰΞΫηεՄೳ
©2022 Wantedly, Inc. σϞ 49 7JSUVBM$MVTUFS ෳͷมߋ͕ೖͬͨ 7JSUVBM$MVTUFS࡞Մೳ
©2022 Wantedly, Inc. LVCFGPSLDPOUSPMMFSͷվળҊ (BUFXBZϨΠϠͷࠩ͠ସ͑ʹରԠ ݱঢ়"NCBTTBEPSͱີ݁߹ )PTU໊͝ͱʹϔομΛ͚Δػೳ͕͋ΕଞͷHBUFXBZͰ͍͍ͣ ݱঢ়ϔομൖΞϓϦέʔγϣϯͰ࣮͢Δඞཁ͕͋Δ
ΞϓϦέʔγϣϯͷରԠແ͠Ͱϔομൖ͕࣮ݱͰ͖ͳ͍͔ʁ )FBEFS1SPQBHBUJPOػೳͷఏڙ 50
©2022 Wantedly, Inc. ·ͱΊ 51 kubefork ҰͭͷΫϥελ͔ΒԾతͳΫϥελΛ࡞ มߋΛͲΜͲΜࢼ͢͜ͱ͕Ͱ͖ΔڥΛ࡞Δ େࣄͳͷ࣍ͷ̎ͭ
wϔομΛͱʹͨ͠ϦΫΤετϧʔςΟϯά wϗετ໊ͱϔομͷରԠ͚ kubefork-controller ΧελϜϦιʔεΛͱʹԾతͳΫϥελΛ࡞ (JU)VCʹͯެ։த
©2022 Wantedly, Inc. ͋Γ͕ͱ͏͍͟͝·ͨ͠ 52