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

kubefork - development experience like owning your own cluster

Takamichi Omori
November 21, 2022
960

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

Transcript

  1. ©2021 Wantedly, Inc.
    kubefork
    ࣗ෼ઐ༻ͷΫϥελΛॴ༗͍ͯ͠ΔΑ͏ͳ։ൃମݧ
    CloudNative Days Tokyo 2022
    Nov 21, 2022 - Takamichi Omori
    1

    View full-size slide

  2. ©2022 Wantedly, Inc.
    *BN
    2
    Takamichi Omori @onsd_
    Engineer at DX Squad
    Love Kubernetes, Go, etc.
    Wantedly, Inc.

    View full-size slide

  3. ©2022 Wantedly, Inc.
    %94RVBEͱ͸ʁ
    %FWFMPQFSF9QFSJFODF4RVBE
    ٕज़ج൫νʔϜͱ঺հ͞ΕΔ͜ͱ΋ଟ͍Ͱ͢
    ະདྷͷ։ൃମݧΛͭ͘Δ
    ։ൃऀͷੜ࢈ੑΛ޲্ͤ͞ΔͨΊʹ͸ԿͰ΋΍͍ͬͯ͘νʔϜ
    ৽͍͠.JDSPTFSWJDFͷ։ൃମݧ
    ෳࡶͳ.JDSPTFSWJDFͰ΋։ൃ͕؆୯ʹߦ͑ΔΑ͏ͳ࢓૊Έ࡞Γ

    View full-size slide

  4. ©2022 Wantedly, Inc.
    ࿩͢͜ͱ
    LVCFGPSL
    ࣗ෼ઐ༻ͷΫϥελΛॴ༗͍ͯ͠ΔΑ͏ͳ։ൃମݧ
    LVCFGPSLͱ͸ʁ
    LVCFGPSLͷ࢓૊Έ
    LVCFGPSLͷ۩ମతͳ࣮૷
    LVCFGPSLΛࢧ͑ΔDVTUPNDPOUSPMMFS

    LVCFGPSLͷσϞ
    LVCFGPSLͷͳΓͨͪ
    LVCFGPSLͷ͔͍ͭΈͪ

    View full-size slide

  5. ©2022 Wantedly, Inc.
    Kubefork ͱ͸
    ࣗ෼ઐ༻ͷΫϥελΛ͍࣋ͬͯΔΑ͏ͳମݧ
    Ұͭͷ։ൃ༻Ϋϥελ͔ΒԾ૝తͳΫϥελΛ࡞Δ࢓૊Έ
    Copy on Write
    ΫϥελΛίϐʔ͢Δͷ͸ίετ͕͔͔Δ

    มߋ͍ͨ͠Օॴ͚ͩมߋ͠ɺ


    ڞ༗Ͱ͖ΔϦιʔε͸ڞ༗͢Δ
    ΞΫηε͕෼཭͞Ε͍ͯΔͷͰ

    ଞͷ։ൃऀʹ໎࿭͕͔͔Βͳ͍
    ߴ଎
    มߋՕॴ͕࠷খݶ


    ؀ڥʹΞΫηεͰ͖Δ·Ͱ͕ߴ଎
    5

    View full-size slide

  6. ©2021 Wantedly, Inc.
    Photo by Jay Heike on Unsplash
    LVCFGPSLͷͳΓͨͪ
    6

    View full-size slide

  7. ©2022 Wantedly, Inc. 7
    8BOUFEMZͱϚΠΫϩαʔϏε
    ϚΠΫϩαʔϏε

    ΞʔΩςΫνϟ
    લޙͷίϯϙʔωϯτ
    ೥ʹLVCFSFOFUFTຊ൪ಋೖ
    https://docs.wantedly.dev/introduction/technical-overview
    ೥ʹ&,4Ҡߦ׬ྃ

    View full-size slide

  8. ©2022 Wantedly, Inc.
    ϚΠΫϩαʔϏε։ൃͰେ੾ͳͭͷ͜ͱ
    มߋΛૉૣ͘ࢼͤΔ
    ΋ͷͮ͘Γશൠʹ͓͍ͯେࣄ

    มߋ͕ྑ͔ͬͨɾѱ͔ͬͨ͜ͱͷϑΟʔυόοΫϧʔϓ
    ଞਓͷมߋͷӨڹΛड͚ͳ͍
    ૝ఆͱҟͳΔϨεϙϯεͷݪҼ͸୭ʁ
    ݪҼ͕ࣗ෼Ҏ֎ʹ͋ͬͨ৔߹ɺ֬ೝ͕೉͍͠
    ґଘؔ܎Λҙࣝ͢Δඞཁ͕ͳ͍
    ͜ͷαʔϏε͸Կʹґଘ͍ͯ͠Δʁ
    ։ൃ͢ΔͨΊʹ͸ԿʹΞΫηεͰ͖ΔΑ͏ʹ͢Δඞཁ͕͋Δʁ
    αʔϏεɾػೳ͝ͱʹґଘؔ܎Λ͓֮͑ͯ͘ͷ͸େม

    View full-size slide

  9. ©2022 Wantedly, Inc.
    ΑΓΑ͍։ൃํ๏
    େ੾ͳ͜ͱΛຬͨ͢։ൃํ๏͸͋Δʁ
    wมߋΛૉૣ͘ࢼͤΔ
    wଞਓͷมߋͷӨڹΛड͚ͳ͍
    wґଘؔ܎Λҙࣝ͠ͳ͍
    ϩʔΧϧͰ։ൃ͢Δ
    εςʔδϯά؀ڥʹσϓϩΠ͢Δ
    5FMFQSFTFODFΛ࢖͏
    ϚΠΫϩαʔϏε։ൃͷख๏Λൺֱ

    8BOUFEMZͰߦΘΕ͍ͯͨ։ൃख๏Λൺֱ

    View full-size slide

  10. ©2022 Wantedly, Inc.
    طଘͷख๏ʢ̍ʣ
    ϩʔΧϧͰ։ൃ͢Δ
    ˓มߋΛૉૣ͘ࢼͤΔ
    %PDLFSCVJMEΛ଴ͨͳͯ͘Α͍
    ˓ଞਓͷมߋͷӨڹΛड͚ͳ͍
    खݩͰ։ൃ͍ͯ͠ΔͷͰଞਓͷӨڹ͸ड͚ͳ͍
    ✕ґଘؔ܎Λҙࣝ͢Δඞཁ͕ͳ͍
    αʔϏεؒͷґଘؔ܎Λ஌Δඞཁ͕͋Δ
    ։ൃ؀ڥͷϝϯςφϯείετ͕͔͔Δ
    10

    View full-size slide

  11. ©2022 Wantedly, Inc.
    طଘͷख๏ʢ̎ʣ
    εςʔδϯά؀ڥʹσϓϩΠ͢Δ
    ˓ґଘؔ܎Λҙࣝ͢Δඞཁ͕ͳ͍
    ɹಈ͍͍ͯΔγεςϜͷҰ෦ΛೖΕସ͑Δ͚ͩ

    ✕มߋΛૉૣ͘ࢼͤΔ
    ɹ%PDLFSCVJMEΛ଴ͭඞཁ͕͋Δ
    ✕ଞਓͷมߋͷӨڹΛड͚ͳ͍
    ɹڞ༻ͷ؀ڥͳͷͰɺଞͷ։ൃऀͷӨڹΛड͚Δ
    11

    View full-size slide

  12. ©2022 Wantedly, Inc.
    طଘͷख๏ʢ̏ʣ
    5FMFQSFTFODF
    ৄ͘͠͸IUUQTXXXUFMFQSFTFODFJP
    ˓มߋΛૉૣ͘ࢼͤΔ
    ɹEPDLFSCVJMEΛ଴ͭඞཁ͕ͳ͍
    ˓ґଘؔ܎Λҙࣝ͢Δඞཁ͕ͳ͍
    ɹಈ͍͍ͯΔγεςϜͷதͷϦΫΤετ͕खݩʹඈΜͰ͘Δ

    ✕ଞਓͷมߋͷӨڹΛड͚ͳ͍
    ɹڞ༻ͷΫϥελͰ࣮ߦ͢ΔͱଞਓͷϦΫΤετ΋खݩʹདྷͯ͠·͏
    $/$'4BOECPY1SPKFDU
    બ୒ͨ͠TFSWJDF΁ͷϦΫΤετΛ

    ϩʔΧϧʹྲྀ͢͜ͱ͕Ͱ͖Δπʔϧ
    12

    View full-size slide

  13. ©2022 Wantedly, Inc.
    ఺Λຬͨ͢։ൃख๏
    *TUJPUFMFQSFTFODF
    *TUJPͷϦΫΤετϧʔςΟϯάΛ׆༻
    ಛఆͷϦΫΤετ͚ͩΛखݩʹϧʔςΟϯά
    ଞͷϦΫΤετ͸ڞ༻ͷ؀ڥΛ௨Δ


    LVCFGPSLͷߟ͑ํ͸͔͜͜Βग़ൃ
    ˓มߋΛૉૣ͘ࢼͤΔ
    %PDLFSCVJMEΛ଴ͨͳͯ͘Α͍
    ˓ଞਓͷมߋͷӨڹΛड͚ͳ͍
    खݩͰ։ൃ͍ͯ͠ΔͷͰଞਓͷӨڹ͸ड͚ͳ͍
    ˓ґଘؔ܎Λҙࣝ͢Δඞཁ͕ͳ͍
    ಈ͍͍ͯΔγεςϜͷதͷϦΫΤετ͕खݩʹඈΜͰ͘Δ
    ߋʹৄ͘͠͸ͪ͜ΒɿIUUQTTQFBLFSEFDLDPNNPSVYJTUJPJOUFHSBUFEUFMFQSFTFODF 13

    View full-size slide

  14. ©2022 Wantedly, Inc.
    *TUJPUFMFQSFTFODF͔ΒͷਐԽ
    HBUFXBZϨΠϠͷ࣮૷
    TPNFEFWXBOUFEMZDPN
    GPSLFEBTPNFEFWXBOUFEMZDPN
    (BUFXBZ
    ࣗ෼ͷมߋʹϧʔςΟϯά͢ΔͨΊʹ
    ಛผͳIFBEFS͕ඞཁͩͬͨ

    (BUFXBZϨΠϠͷಋೖʹΑΓIFBEFSͳ͠Ͱ
    ࣗ෼ͷมߋʹ౸ୡͰ͖ΔΑ͏ʹ
    14
    ࣮Ϋϥελ͔Β࡞੒͞ΕΔԾ૝ΫϥελΛࢦ͢
    'PSLFE"͕7JSUVBM$MVTUFSʹ֘౰

    ϔομΛ࢖ͬͯϧʔςΟϯάΛૢ࡞͢Δମݧ͔ΒɺΫϥελΛίϐʔ͢ΔΑ͏ͳମݧʹ
    7JSUVBM$MVTUFS

    View full-size slide

  15. ©2022 Wantedly, Inc.
    LVCFGPSL
    LVCFGPSLͷ׬੒
    ϦΫΤετϧʔςΟϯάͳͲɺ

    7JSUVBM$MVTUFSΛ࣮ݱ͢ΔͨΊʹ͸

    ଟ͘ͷϦιʔε͕ඞཁ

    ͦ͜ͰϦιʔεΛҰׅͯ͠؅ཧ͢Δ

    ΧελϜίϯτϩʔϥʔΛ࣮૷

    GPSLϦιʔεΛBQQMZ͢Δ͜ͱͰ

    ඞཁʹͳΔϦιʔεΛશͯ࡞੒Ͱ͖Δ

    Α͏ʹ
    ͜͜·ͰͰݱࡏͷ࢓૊Έ͕׬੒

    LVCFGPSLͱݺͿΑ͏ʹ
    15

    View full-size slide

  16. ©2022 Wantedly, Inc.
    5FSNJOPMPHZ
    7JSUVBM$MVTUFS
    Ծ૝తͳLVCFSFOUFTΫϥελ
    'PSL*EFOUJ
    fi
    FS
    'PSL͢Δ
    7JSUVBMDMVTUFSΛ۠ผ͢Δࣝผࢠ
    TIBSFE͔ΒWJSUVBMDMVTUFSΛ
    ಛఆͷGPSLJEFOUJ
    fi
    FSΛ΋ͱʹ
    ΞΫηεͰ͖Δ
    ࡞੒͢Δ͜ͱ
    4ͭͷϚΠΫϩαʔϏε͔ΒͳΔγεςϜͱɺA,B ͷ fork ͞ΕͨΫϥελ
    16

    View full-size slide

  17. ©2022 Wantedly, Inc.
    5FSNJOPMPHZ
    7JSUVBM$MVTUFS
    Ծ૝తͳLVCFSFOUFTΫϥελ
    'PSL*EFOUJ
    fi
    FS
    'PSL͢Δ
    7JSUVBMDMVTUFSΛ۠ผ͢Δࣝผࢠ
    TIBSFE͔ΒWJSUVBMDMVTUFSΛ
    ಛఆͷGPSLJEFOUJ
    fi
    FSΛ΋ͱʹ
    ΞΫηεͰ͖Δ
    ࡞੒͢Δ͜ͱ
    4ͭͷϚΠΫϩαʔϏε͔ΒͳΔγεςϜͱɺA,B ͷ fork ͞ΕͨΫϥελ
    17

    View full-size slide

  18. ©2022 Wantedly, Inc.
    5FSNJOPMPHZ
    7JSUVBM$MVTUFS
    Ծ૝తͳLVCFSFOUFTΫϥελ
    'PSL*EFOUJ
    fi
    FS
    'PSL͢Δ
    7JSUVBMDMVTUFSΛ۠ผ͢Δࣝผࢠ
    TIBSFE͔ΒWJSUVBMDMVTUFSΛ
    ಛఆͷGPSLJEFOUJ
    fi
    FSΛ΋ͱʹ
    ΞΫηεͰ͖Δ
    ࡞੒͢Δ͜ͱ
    4ͭͷϚΠΫϩαʔϏε͔ΒͳΔγεςϜͱɺA,B ͷ fork ͞ΕͨΫϥελ
    18

    View full-size slide

  19. ©2022 Wantedly, Inc.
    5FSNJOPMPHZ
    7JSUVBM$MVTUFS
    Ծ૝తͳLVCFSFOUFTΫϥελ
    'PSL*EFOUJ
    fi
    FS
    'PSL͢Δ
    7JSUVBMDMVTUFSΛ۠ผ͢Δࣝผࢠ
    TIBSFE͔ΒWJSUVBMDMVTUFSΛ
    ಛఆͷGPSLJEFOUJ
    fi
    FSΛ΋ͱʹ
    ΞΫηεͰ͖Δ
    ࡞੒͢Δ͜ͱ
    4ͭͷϚΠΫϩαʔϏε͔ΒͳΔγεςϜͱɺA,B ͷ fork ͞ΕͨΫϥελ
    19

    View full-size slide

  20. ©2021 Wantedly, Inc.
    Photo by Deva Darshan on Unsplash
    LVCFGPSLͷ͔͍ͭΈͪ
    20

    View full-size slide

  21. ©2022 Wantedly, Inc.
    ,VCFGPSLͷ͔͍ͭΈͪ
    Ϣʔεέʔε
    ౰ॳ૝ఆ͍ͯͨ͠Ϣʔεέʔε
    wΞϓϦέʔγϣϯ։ൃࢧԉ
    wखಈςετࢧԉ
    ೥Ҏ্ͷӡ༻Λܦͯൃݟ͞ΕͨϢʔεέʔε
    w1VMM3FRVFTU1SFWJFX
    w'FBUVSF
    fl
    BHͷͨΊͷ؀ڥੜ੒
    21

    View full-size slide

  22. ©2022 Wantedly, Inc.
    *TUJPͷϦΫΤετϧʔςΟϯάΛ׆༻


    ಛఆͷϦΫΤετ͚͕ͩϧʔςΟϯά͞ΕΔ

    4FSWJDF %FQMPZNFOUΛ࡞੒
    4FSWJDFʹUFMFQSFTFODFΛ࣮ߦ͠
    Ϋϥελ͔ΒͷϦΫΤετΛखݩʹϧʔςΟϯά
    ࣾ಺Ͱ͸MPDBMGPSLͱݺ͹Ε͍ͯΔ
    ૝ఆ͍ͯͨ͠ϢʔεέʔεɿΞϓϦέʔγϣϯ։ൃࢧԉ
    22

    View full-size slide

  23. ©2022 Wantedly, Inc.
    ૝ఆ͍ͯͨ͠Ϣʔεέʔεɿखಈςετࢧԉ
    23
    *TUJPͷϦΫΤετϧʔςΟϯάΛ׆༻


    ಛఆͷϦΫΤετ͚͕ͩϧʔςΟϯά͞ΕΔ

    4FSJWJDF %FQMPZNFOUΛ࡞੒

    ͜͜Ͱ࡞੒͢Δ%FQMPZNFOU͸ࣗ෼͕มߋͨ͠

    *NBHFΛઃఆ͓ͯ͘͠
    WJSUVBMDMVTUFS͕࡞੒Ͱ͖Ε͹
    ϒϥ΢β͔Βมߋ͕ࢼͤΔ
    खಈςετɾϨϏϡʔͳͲͷ༻్Ͱར༻


    ࣾ಺Ͱ͸SFNPUFGPSLͱݺ͹Ε͍ͯΔ

    View full-size slide

  24. ©2022 Wantedly, Inc.
    ͪͳΈʹɿࣾ಺ͷ࿩
    LVCF
    LVCFDUMͷϥούʔЋͷίϚϯυ
    Ϋϥελ͝ͱͷΞΫηεΛӅṭͨ͠Γ
    7JSUVBMDMVTUFSͷ࡞੒UFMFQSFTFODF
    ΛશࣗಈͰߦ͏
    LVCFDUMʹ͸ͳ͍ศརػೳ͕ར༻Մೳ
    LVCFGPSL
    24
    มߋ͕ೖͬͨ7JSUVBM$MVTUFSͷ࡞੒Λ

    ࣗಈͰߦ͏
    LVCFGPSLSFNPUF

    View full-size slide

  25. ©2022 Wantedly, Inc.
    ৽͍͠Ϣʔεέʔε: Pull Request Preview
    3FWJFX؀ڥͷࣗಈੜ੒
    13࡞੒࣌ʹWJSUVBMDMVTUFSΛࣗಈੜ੒
    ੜ੒͞Εͨ63-ʹΞΫηε͢ΔͱࢼͤΔ
    .JDSPTFSWJDFͰ΋1SFWJFX
    ֎͔Β௚઀౸ୡͰ͖ͳ͍.JDSPTFSWJDF

    ʹ΋ϧʔςΟϯάՄೳ
    ੜ੒͞Εͨ63-ʹΞΫηε͢Δ͜ͱͰ

    Ұ෦͚ͩมߋ͞ΕͨγεςϜΛࢼͤΔ
    ඇΤϯδχΞʹࢼͯ͠΋Β͏ͱ͖΋ศར

    ؀ڥߏங͕͍Βͳ͍
    TBOECPYͷσʔλΛ͔ͭͬͯࢼͤΔ
    25

    View full-size slide

  26. ©2022 Wantedly, Inc.
    ৽͍͠Ϣʔεέʔε: Pull Request Preview
    3FWJFX؀ڥͷࣗಈੜ੒
    13࡞੒࣌ʹWJSUVBMDMVTUFSΛࣗಈੜ੒
    ੜ੒͞Εͨ63-ʹΞΫηε͢ΔͱࢼͤΔ
    .JDSPTFSWJDFͰ΋1SFWJFXͰ͖Δ
    ֎͔Β௚઀౸ୡͰ͖ͳ͍.JDSPTFSWJDF

    ʹ΋ϧʔςΟϯάՄೳ
    ੜ੒͞Εͨ63-ʹΞΫηε͢Δ͜ͱͰ

    Ұ෦͚ͩมߋ͞ΕͨγεςϜΛࢼͤΔ
    ඇΤϯδχΞʹࢼͯ͠΋Β͏ͱ͖΋ศར

    ؀ڥߏங͕͍Βͳ͍
    TBOECPYͷσʔλΛ͔ͭͬͯࢼͤΔ
    26

    View full-size slide

  27. ©2022 Wantedly, Inc.
    Pull Request Preview URL ͷ࢓૊Έ
    27
    ։ൃऀ͕(JU)VCʹมߋΛQVTI
    มߋ͝ͱʹ%PDLFSJNBHFΛ࡞੒
    %PDLFSJNBHFͷ४උ͕Ͱ͖ͨΒ

    'PSLϦιʔεΛΫϥελʹ"QQMZ
    7JSUVBM$MVTUFSͷ४උ͕Ͱ͖ͨΒ

    13ʹίϝϯτ
    ίϝϯτ͞Εͨ63-ʹΞΫηε

    View full-size slide

  28. ©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Λ࢖੍ͬͨޚ

    View full-size slide

  29. ©2022 Wantedly, Inc.
    ৽͍͠Ϣʔεέʔε: Feature Flag ͷͨΊͷ؀ڥੜ੒
    'FBUVSF'MBH(BUFXBZ
    ಛఆͷGFBUVSF
    fl
    BH͕༗ޮʹͳͬͨԾ૝Ϋϥελ͕࡞੒Մೳ
    TPNFEFWXBOUFEMZDPN
    TPNFGFBUVSFFOBCMFETPNFEFWXBOUFEMZDPN

    "#UFTUͷಛఆͷWBSJBOUͰදࣔ
    ϦϦʔεલͷػೳΛ༗ޮʹ͢Δ
    3BJMTͷΞϓϦέʔγϣϯͷBTTFUT

    ͚ͩखݩͷϦιʔεΛ࢖͏
    29
    'FBUVSF
    fl
    BHͳΒ৽نͷQPEແ͠Ͱར༻Մೳ

    View full-size slide

  30. ©2022 Wantedly, Inc.
    ͜͜·Ͱͷ·ͱΊ
    ,VCFGPSL
    wҰͭͷΫϥελ͔ΒԾ૝ΫϥελΛ࡞੒Ͱ͖Δ͘͠Έ
    wϢʔεέʔε
    wΞϓϦέʔγϣϯ։ൃࢧԉ
    wଞͷ։ൃऀʹ໎࿭Λ͔͚ͣʹUFMFQSFTFODFͰ͖Δ
    wखಈςετࢧԉ
    wखݩʹΞϓϦέʔγϣϯͷಈ࡞؀ڥ͕ͳͯ͘΋มߋΛ࣮ࡍͷϦΫΤετΛ࢖ͬͯࢼͤΔ
    w1VMM3FRVFTU1SFWJFX
    wͲΜͳαʔϏεͰ΋৮Γͳ͕ΒࢼͤΔ؀ڥͷࣗಈੜ੒
    w'FBUVSF'MBHͷͨΊͷ؀ڥੜ੒
    wσόοάʹศརͳ؀ڥ΍ɺ"#ςετͷൺֱͷͨΊͷ؀ڥͷੜ੒
    30

    View full-size slide

  31. ©2021 Wantedly, Inc.
    Photo by Kaleidico on Unsplash
    LVCFGPSLͷৄ͍͠࢓૊Έ
    31

    View full-size slide

  32. ©2022 Wantedly, Inc.
    ߏ੒ཁૉ
    Service Mesh


    *TUJPͷϦΫΤετϧʔςΟϯάΛ׆༻
    ಛఆͷϔομ͕෇͍͍ͯΔϦΫΤετΛ
    ࢦఆͨ͠TFSWJDFʹϧʔςΟϯά͢Δ
    32
    Gateway


    "NCBTTBEPSͷIFBEFS෇༩ػೳΛ׆༻
    ϗετ໊ͱϔομͷରԠ෇͚Λߦ͏

    View full-size slide

  33. ©2022 Wantedly, Inc.
    ߏ੒ཁૉ
    Service Mesh


    *TUJPͷϦΫΤετϧʔςΟϯάΛ׆༻
    ಛఆͷϔομ͕෇͍͍ͯΔϦΫΤετΛ
    ࢦఆͨ͠TFSWJDFʹϧʔςΟϯά͢Δ
    33
    Gateway


    "NCBTTBEPSͷIFBEFS෇༩ػೳΛ׆༻
    ϗετ໊ͱϔομͷରԠ෇͚Λߦ͏

    View full-size slide

  34. ©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෇༩ػೳΛ׆༻
    ϗετ໊ͱϔομͷରԠ෇͚Λߦ͏

    View full-size slide

  35. ©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෇༩ػೳΛ׆༻
    ϗετ໊ͱϔομͷରԠ෇͚Λߦ͏

    View full-size slide

  36. ©2022 Wantedly, Inc.
    ߏ੒ཁૉ
    Service Mesh


    *TUJPͷϦΫΤετϧʔςΟϯάΛ׆༻
    ಛఆͷϔομ͕෇͍͍ͯΔϦΫΤετΛ
    ࢦఆͨ͠TFSWJDFʹϧʔςΟϯά͢Δ
    36
    Gateway


    "NCBTTBEPSͷIFBEFS෇༩ػೳΛ׆༻
    ϗετ໊ͱϔομͷରԠ෇͚Λߦ͏

    View full-size slide

  37. ©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෇༩ػೳΛ׆༻
    ϗετ໊ͱϔομͷରԠ෇͚Λߦ͏

    View full-size slide

  38. ©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෇༩ػೳΛ׆༻
    ϗετ໊ͱϔομͷରԠ෇͚Λߦ͏

    View full-size slide

  39. ©2022 Wantedly, Inc.
    7JSUVBMDMVTUFSͷ࡞੒
    7JSUVBM$MVTUFSʹඞཁͳϦιʔε
    w%FQMPZNFOU
    w4FSWJDF
    w7JSUVBM4FSWJDF
    w.BQQJOH
    39
    'PSLϦιʔε
    ্هͷϦιʔεΛҰׅͯ͠࡞੒͢Δ
    'PSLϦιʔεΛBQQMZ͢Δͱ
    7JSUVBMDMVTUFS͕࡞੒͞ΕΔମݧ
    'PSLϦιʔε͸LVCFGPSLDPOUSPMMFS͕ఏڙɾ؅ཧ͢Δ

    View full-size slide

  40. ©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͕ఏڙɾ؅ཧ͢Δ

    View full-size slide

  41. ©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͕ఏڙɾ؅ཧ͢Δ

    View full-size slide

  42. ©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͕ఏڙɾ؅ཧ͢Δ

    View full-size slide

  43. ©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͕ఏڙɾ؅ཧ͢Δ

    View full-size slide

  44. ©2022 Wantedly, Inc.
    kubefork ʹؔ࿈͢ΔϦιʔε
    44
    ਫ৭Ͱғ·Ε͍ͯΔͷ͕WJSUVBMDMVTUFSͷ࡞੒ʹඞཁͳϦιʔε

    View full-size slide

  45. ©2022 Wantedly, Inc.
    LVCFGPSLDPOUSPMMFS

    ͕044ʹͳΓ·ͨ͠
    (JU)VCʹͯެ։த
    45
    https://github.com/wantedly/kubefork-controller

    View full-size slide

  46. ©2022 Wantedly, Inc.
    LVCFGPSLDPOUSPMMFSʹؚ·Ε͍ͯΔ΋ͷ
    $POUPSPMMFSͷ࣮૷
    ,VCFGPSLͷ࣮ݱʹඞཁͳ࣮૷શͯ
    LVCFGPSLͱ͸ʁͱ͍ͬͨͱ͜Ζ͔Βɺ֤छϦιʔεͷઆ໌·Ͱ
    LVCFGPSLͷυΩϡϝϯτ
    46
    'PSLϦιʔεΛੜ੒͢ΔͨΊͷ$-*
    LVCFGPSLDUM

    View full-size slide

  47. ©2022 Wantedly, Inc.
    σϞ
    47
    5PEPදࣔαʔϏε
    ̏ͭͷαʔϏε͔ΒͳΔ
    'SPOUFOE
    #BDLFOE͔ΒUPEPΛऔಘ
    #BDLFOE
    5PEPͷϦετΛ͍࣋ͬͯΔ
    ϦΫΤετ͕དྷΔͱɺ0QUJPO͔Β

    5PEPͷ৭Λऔಘͯ͠ฦ͢
    0QUJPO
    5PEPͷ৭Λฦ͢αʔϏε

    View full-size slide

  48. ©2022 Wantedly, Inc.
    σϞ
    48
    7JSUVBM$MVTUFS
    ඞͣ੺৭Λฦ͢มߋΛPQUJPOͰࢼͨ͢Ίʹ
    มߋ͕ೖͬͨWJSUVBMDMVTUFSΛ࡞੒͢Δ


    GPSLJEFOUJ
    fi
    FS͸SFEʹͨ͠

    SFEUPEPUFTUͰΞΫηεՄೳ

    View full-size slide

  49. ©2022 Wantedly, Inc.
    σϞ
    49
    7JSUVBM$MVTUFS
    ෳ਺ͷมߋ͕ೖͬͨ

    7JSUVBM$MVTUFS΋࡞੒Մೳ

    View full-size slide

  50. ©2022 Wantedly, Inc.
    LVCFGPSLDPOUSPMMFSͷվળҊ
    (BUFXBZϨΠϠͷࠩ͠ସ͑ʹରԠ
    ݱঢ়"NCBTTBEPSͱີ݁߹

    )PTU໊͝ͱʹϔομΛ෇͚Δػೳ͕͋Ε͹ଞͷHBUFXBZͰ΋͍͍͸ͣ
    ݱঢ়ϔομ఻ൖ͸ΞϓϦέʔγϣϯͰ࣮૷͢Δඞཁ͕͋Δ

    ΞϓϦέʔγϣϯͷରԠແ͠Ͱϔομ఻ൖ͕࣮ݱͰ͖ͳ͍͔ʁ
    )FBEFS1SPQBHBUJPOػೳͷఏڙ
    50

    View full-size slide

  51. ©2022 Wantedly, Inc.
    ·ͱΊ
    51
    kubefork


    ҰͭͷΫϥελ͔ΒԾ૝తͳΫϥελΛ࡞੒

    มߋΛͲΜͲΜࢼ͢͜ͱ͕Ͱ͖Δ؀ڥΛ࡞Δ
    େࣄͳͷ͸࣍ͷ̎ͭ
    wϔομΛ΋ͱʹͨ͠ϦΫΤετϧʔςΟϯά
    wϗετ໊ͱϔομͷରԠ෇͚
    kubefork-controller


    ΧελϜϦιʔεΛ΋ͱʹԾ૝తͳΫϥελΛ࡞੒
    (JU)VCʹͯެ։த

    View full-size slide

  52. ©2022 Wantedly, Inc.
    ͋Γ͕ͱ͏͍͟͝·ͨ͠
    52

    View full-size slide