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

Wantedly Visit on Kubernetes

Shimpei Otsubo
September 26, 2018

Wantedly Visit on Kubernetes

Shimpei Otsubo

September 26, 2018
Tweet

More Decks by Shimpei Otsubo

Other Decks in Programming

Transcript

  1. ©2018 Wantedly, Inc. Wantedly Visit on Kubernetes Wantedly ͷ͢΂ͯͷαʔϏεΛ Kubernetes

    ΛҠߦͤͨ͞ཧ༝ͱۤ࿑ SRE Lounge #5 26.Sep.2018 - Shimpei Otsubo @potsbo
  2. ©2018 Wantedly, Inc. 4IJNQFJ0UTVCP!QPUTCP Infrastructure Team, Wantedly, Inc. 2018 New

    Grads Kubernetes Dev Tools CI / CD AuthN / Z Productivity Dvorak
  3. ©2018 Wantedly, Inc. Created github.com/wantedly/wantedly Commits Docker Image Repo ՝୊

    Sep 6, 2011 147,687 517.76MB 4GB ن໛͕େ͖͗ͯ͢૝ఆ֎ %PDLFSCVJMEʹ਺෼Ҏ্͔͔Δ͜ͱΛ૝ఆͯ͠ͳ͍ ࣾ಺ͷ,VCFSOFUFTͷӡ༻ϑϩʔʹWJTJU͕ͦͷ··͸৐Εͳ͍ සൟʹߋ৽͞ΕΔXFCαʔόʔ͸લఏʹ͍ͯ͠ͳ͍
  4. ©2018 Wantedly, Inc. Ք͙͓ۚ github.com/wantedly/wantedly ґଘ͢ΔαʔϏε ՝୊ ͨ͘͞Μ Өڹൣғ͕޿͗͢Δ 6TFSσʔλ͸7JTJUͷ΋ͷΛ1FPQMFͰ΋ྲྀ༻͍ͯ͠Δ

    7JTJU͕མͪΔͱ1FPQMF΋མͪΔ ͪΐͬͱ஗͘ͳΔ͚ͩͰച্ʹӨڹ ͨ͘͞Μ ࠷ॳظ͔Β͋ΔαʔϏεͳͷͰׂͱ੹຿͕େ͖͍
  5. ©2018 Wantedly, Inc. ҟͳΔ̎ͭͷΠϯϑϥΛ؅ཧ͢Δͷ͕ίετ "VUPTDBMF͍ͨ͠ *TUJP͍Ε͍ͨ 3#"$͍ͨ͠ ৽͍͜͠ͱΛ͍ͨ࣌͠ Πϯγσϯτ͕ىͬͨ࣌͜ 8PSLFSΛࢭΊ͍ͨʂ

    8FCΛεέʔϧ͍ͤͨ͞ʂ Ϟνϕ ΠϯϑϥͷҰຊԽ ՕॴͰಉ͜͡ͱΛҧ͏ํ๏Ͱʜ ঢ়گʹ߹Θͤͯਖ਼͍͠ํ๏Λબ୒ʜ
  6. ©2018 Wantedly, Inc. tag ͸ commit hash ͱ latest ͷΈ

    GitHub ͷ commit status Ͱ image ͕ ready ͔Θ͔Δ ΄΅೚ҙͷ commit ༻ͷ image ͕ଘࡏ push push hook build build ࣾ಺ͷ,VCFSOFUFTͷϑϩʔ શ෦Ϛωʔδυ
  7. ©2018 Wantedly, Inc. `kube prod deploy master` Ͱ deploy Ͱ͖Δ

    ಺෦Ͱ͸ kubectl set image ؀ڥ͝ͱͷࠩҟ͸؀ڥม਺ͷΈͰ؅ཧ set image check pull deploy ࣾ಺ͷ,VCFSOFUFTͷϑϩʔ શ෦Ϛωʔδυ
  8. ©2018 Wantedly, Inc. શ෦AWS ࣾ಺ͷ,VCFSOFUFTͷϑϩʔ ೉͍͠… cache ͳ͠Ͱਅ໘໨ʹ docker build

    ͢Δͱ1࣌ؒ FROM wantedly/wantedly:intermediate tag ͸ prod / qa / intermediate ࡞੒౰࣌͸ແݶʹ image Λஔ͚Δ registry ͕ͳ͔ͬͨ Docker run Ͱಈ͔͔ͨͬͨ͠ͷͰ .env ΋ image ͷͳ͔ build hook push hook intermediate
  9. ©2018 Wantedly, Inc. શ෦AWS ࣾ಺ͷ,VCFSOFUFTͷϑϩʔ ೉͍͠… Deploy ࣌ʹ build ઐ༻αʔόʔͰ

    build Deploy ͸ pull and restart Blue / green ssh deploy hook restart build push pull prod pull
  10. ©2018 Wantedly, Inc. CVJME 7JTJU #VJME%FQMPZϑϩʔࠩ෼ UBH ؀ڥม਺ 1FPQMF ઐ༻Πϯελϯε

    5SBWJT ؀ڥʹରԠ $PNNJUIBTIʹରԠ JNBHFͷத LTͷTFDSFUT EFQMPZ CMVFHSFFO SPMMJOH શ෦"84 ΄΅Ϛωʔδυ Πϯϑϥ 1FPQMFଆʹऩଋ͍ͤͨ͞