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
Wantedly Visit on Kubernetes
Search
Shimpei Otsubo
September 26, 2018
Programming
4
1.4k
Wantedly Visit on Kubernetes
Shimpei Otsubo
September 26, 2018
Tweet
Share
More Decks by Shimpei Otsubo
See All by Shimpei Otsubo
Copy Kubernetes Clusters Really Fast
potsbo
3
4.1k
Go と Wantedly の関係 / How Wantedly uses Go
potsbo
1
800
Deploy Flow at Wantedly
potsbo
2
840
Wrap every method with just one line
potsbo
1
4.4k
Zero yen Keyboard
potsbo
6
3.1k
Kube - The core tool at Wantedly
potsbo
1
7.3k
k8s - Kubernetes 8 Factors
potsbo
12
10k
コンテンツ作成に集中するためのプレゼンテーション Tips / Presentation with Confidence
potsbo
7
39k
ConfigMap vs Secret #k8sjp
potsbo
1
1.3k
Other Decks in Programming
See All in Programming
良いユニットテストを書こう
mototakatsu
11
3.6k
盆栽転じて家具となる / Bonsai and Furnitures
aereal
0
1.9k
テストコード書いてみませんか?
onopon
2
340
.NETでOBS Studio操作してみたけど…… / Operating OBS Studio by .NET
skasweb
0
120
Lookerは可視化だけじゃない。UIコンポーネントもあるんだ!
ymd65536
1
130
いりゃあせ、PHPカンファレンス名古屋2025 / Welcome to PHP Conference Nagoya 2025
ttskch
1
180
快速入門可觀測性
blueswen
0
500
DevinとCursorから学ぶAIエージェントメモリーの設計とMoatの考え方
itarutomy
0
150
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
9
2.4k
PHPで学ぶプログラミングの教訓 / Lessons in Programming Learned through PHP
nrslib
4
1.1k
20年もののレガシープロダクトに 0からPHPStanを入れるまで / phpcon2024
hirobe1999
0
1k
ESLintプラグインを使用してCDKのセオリーを適用する
yamanashi_ren01
2
240
Featured
See All Featured
The Cult of Friendly URLs
andyhume
78
6.1k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
870
Building Your Own Lightsaber
phodgson
104
6.2k
Building Applications with DynamoDB
mza
93
6.2k
Java REST API Framework Comparison - PWX 2021
mraible
28
8.3k
Six Lessons from altMBA
skipperchong
27
3.6k
Practical Orchestrator
shlominoach
186
10k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
30
2.1k
Agile that works and the tools we love
rasmusluckow
328
21k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Into the Great Unknown - MozCon
thekraken
34
1.6k
Transcript
©2018 Wantedly, Inc. Wantedly Visit on Kubernetes Wantedly ͷͯ͢ͷαʔϏεΛ Kubernetes
ΛҠߦͤͨ͞ཧ༝ͱۤ࿑ SRE Lounge #5 26.Sep.2018 - Shimpei Otsubo @potsbo
©2018 Wantedly, Inc. ͨΒ͘Λ໘ന͘ ༗໊اۀϕϯνϟʔɺελʔτΞοϓاۀɺؾʹ ͳΔΦϑΟεʹΛฉ͖ʹ͍͜͏ɻ ΩϥͬͱޫΔγΰτϓϩδΣΫτɺձࣾΛݟ͚ͭ ͯΤϯτϦʔ͠·͠ΐ͏ɻΓ߹͍ͷͭͳ͕Γ͕ ͔ͬͯ҆৺Ͱ͢ɻ ϓϩϑΟʔϧΛॆ࣮ͤ͞Δ͜ͱͰɺ࠾༻୲ऀ͔Β
ΦϑΟε๚ͷট͕དྷΔ͔͠Ε·ͤΜɻ
©2018 Wantedly, Inc. ड͚औ໊ͬͨશͯΛɺճͷࡱӨͰ ಉ࣌ʹಡΈࠐΈɻ ಡΈࠐΜ໊ͩਓೳ͕ଈ࣌σʔ λԽ͠ɺ࿈བྷாʹՃ͞Ε·͢ɻ ݡ໊͘ཧ
©2018 Wantedly, Inc. 4IJNQFJ0UTVCP!QPUTCP Infrastructure Team, Wantedly, Inc. 2018 New
Grads Kubernetes Dev Tools CI / CD AuthN / Z Productivity Dvorak
©2018 Wantedly, Inc.
©2018 Wantedly, Inc. ڞ௨σʔλج൫ ΠϯϑϥνʔϜ͕࠷͍ۙͬͯΔ͜ͱ αʔϏεϝογϡࢄτϨʔγϯά ΤϯδχΞͷੜ࢈ੑ 43&͚ͩͰͳ͍
©2018 Wantedly, Inc. ڞ௨σʔλج൫ ΠϯϑϥνʔϜ͕࠷͍ۙͬͯΔ͜ͱ αʔϏεϝογϡࢄτϨʔγϯά ΤϯδχΞͷੜ࢈ੑ 43&͚ͩͰͳ͍ ࣗͷڵຯ
©2018 Wantedly, Inc. ڧ͍ਓ ೖࣾि ࣗ ʮࣾͷੜ࢈ੑ্͕͛·͢ʂʂʯ ʮ͓લੜ࢈ੑͬͯԿ͔Θ͔ͬͯΜͷ͔ʁʯ
©2018 Wantedly, Inc. ྔ ୯Ґ࣌ؒ͋ͨΓʹҰਓͷΤϯδχΞ͕࡞ΕΔՁͷ ࣗͷճ
©2018 Wantedly, Inc. ࣭ ୯Ґ࣌ؒ͋ͨΓʹҰਓͷΤϯδχΞ͕࡞ΕΔՁͷ ྔ ͱ ڧ͍ਓͷճ
©2018 Wantedly, Inc. ड͚औ໊ͬͨશͯΛɺճͷࡱӨͰ ಉ࣌ʹಡΈࠐΈɻ ಡΈࠐΜ໊ͩਓೳ͕ଈ࣌σʔ λԽ͠ɺ࿈བྷாʹՃ͞Ε·͢ɻ ݡ໊͘ཧ ,VCFSOFUFT͕ͳ͚Ε8BOUFEMZ1FPQMFͳ͔ͬͨ ͦͦ࡞ΕΔͱ͍͏ൃʹͳΒͳ͔ͬͨ
©2018 Wantedly, Inc.
©2018 Wantedly, Inc. ͨΒ͘Λ໘ന͘ ༗໊اۀϕϯνϟʔɺελʔτΞοϓاۀɺؾʹ ͳΔΦϑΟεʹΛฉ͖ʹ͍͜͏ɻ ΩϥͬͱޫΔγΰτϓϩδΣΫτɺձࣾΛݟ͚ͭ ͯΤϯτϦʔ͠·͠ΐ͏ɻΓ߹͍ͷͭͳ͕Γ͕ ͔ͬͯ҆৺Ͱ͢ɻ ϓϩϑΟʔϧΛॆ࣮ͤ͞Δ͜ͱͰɺ࠾༻୲ऀ͔Β
ΦϑΟε๚ͷট͕དྷΔ͔͠Ε·ͤΜɻ 8BOUFEMZ7JTJU,VCFSOFUFTʹࡌͤΔͱ։ൃͷ্࣭͕͕Δ͔ʁ ͦͦ࡞ΕΔͱ͍͏ൃʹͳΒͳ͔ͬͨͷ͕࡞ΕΔ͔ʁ
©2018 Wantedly, Inc. ׂͱϞϊϦγοΫ ϚΠΫϩαʔϏε શ෦ Ұ෦ ͜Ε·Ͱ
©2018 Wantedly, Inc. ׂͱϞϊϦγοΫ ϚΠΫϩαʔϏε શ෦ શ෦ ͜Ε͔Β
©2018 Wantedly, Inc. ͯ͢ͷαʔϏε͕ ݸͷେখ༷ʑͳ microservice
©2018 Wantedly, Inc. ݸͷେখ༷ʑͳ microservice ΄΅ γϯϓϧͳ͕ͭ)FSPLVʹ͍ͨΓ Ҡߦ͍ͨͭ͠શ෦Ҡߦ͖ͬͨ͠ མͪͯࠔΔͭ ͯ͢ͷαʔϏε͕
©2018 Wantedly, Inc. on KubernetesԽ࠷ޙͷࡆ
©2018 Wantedly, Inc. Կނ͔ͬͨ͠ʁ ͦΕͰͬͨཧ༝ʁ ҠߦલޙͷϑϩʔͦΕͧΕ ସ࡞ۀ ·ͱΊ Ҡߦ࡞ۀ
©2018 Wantedly, Inc. Կނ͔ͬͨ͠ʁ
©2018 Wantedly, Inc. ن͕େ͖͗ͯ͢ఆ֎ ՝ Өڹൣғ͕͗͢Δ
©2018 Wantedly, Inc. Created github.com/wantedly/wantedly Commits Docker Image Repo ՝
Sep 6, 2011 147,687 517.76MB 4GB ن͕େ͖͗ͯ͢ఆ֎ %PDLFSCVJMEʹҎ্͔͔Δ͜ͱΛఆͯ͠ͳ͍ ࣾͷ,VCFSOFUFTͷӡ༻ϑϩʔʹWJTJU͕ͦͷ··Εͳ͍ සൟʹߋ৽͞ΕΔXFCαʔόʔલఏʹ͍ͯ͠ͳ͍
©2018 Wantedly, Inc. Ք͙͓ۚ github.com/wantedly/wantedly ґଘ͢ΔαʔϏε ՝ ͨ͘͞Μ Өڹൣғ͕͗͢Δ 6TFSσʔλ7JTJUͷͷΛ1FPQMFͰྲྀ༻͍ͯ͠Δ
7JTJU͕མͪΔͱ1FPQMFམͪΔ ͪΐͬͱ͘ͳΔ͚ͩͰച্ʹӨڹ ͨ͘͞Μ ࠷ॳظ͔Β͋ΔαʔϏεͳͷͰׂͱ͕େ͖͍
©2018 Wantedly, Inc. Ϟνϕʔγϣϯ ΠϯϑϥͷҰຊԽ 7JTJUΠϯϑϥͷෛ࠴Խ
©2018 Wantedly, Inc. ҟͳΔ̎ͭͷΠϯϑϥΛཧ͢Δͷ͕ίετ "VUPTDBMF͍ͨ͠ *TUJP͍Ε͍ͨ 3#"$͍ͨ͠ ৽͍͜͠ͱΛ͍ͨ࣌͠ Πϯγσϯτ͕ىͬͨ࣌͜ 8PSLFSΛࢭΊ͍ͨʂ
8FCΛεέʔϧ͍ͤͨ͞ʂ Ϟνϕ ΠϯϑϥͷҰຊԽ ՕॴͰಉ͜͡ͱΛҧ͏ํ๏Ͱʜ ঢ়گʹ߹Θͤͯਖ਼͍͠ํ๏Λબʜ
©2018 Wantedly, Inc. ݟΕΔਓ͕গͳ͘ͳ͖ͬͯͨ ͍ΖΜͳͷΛॳظ͔Β͍ͬͯΔ ͪΐͬͱ৽͍͜͠ͱΛΔ͚ͩͰҰۤ࿑ Ϟνϕ 7JTJUΠϯϑϥͷෛ࠴Խ ࣌ඪ४ͰͰ͖ͳ͔ͬͨ͜ͱΛϋοΫ͍ͯͨ͠ ࠓͰࣗͰؤுΒͳ͍͍ͯ͘͜ͱଟʑ͋Δ
มԽʹڧ͘ͳ͍ʜ %PDLFSҎલ͔ΒLTҎ্લ͔Β
©2018 Wantedly, Inc. Ϟνϕʔγϣϯ ΠϯϑϥͷҰຊԽ 7JTJUΠϯϑϥͷෛ࠴Խ ن͕େ͖͗ͯ͢ఆ֎ ՝ Өڹൣғ͕͗͢Δ
©2018 Wantedly, Inc. ଔઌഐͷνϟϨϯδʂ ΠϯϑϥνʔϜ৽ଔ͕ຖνϟϨϯδ ଔઌഐͷνϟϨϯδʂ ࣌ظঘૣ ࣌ظঘૣ ଔͷԶͷνϟϨϯδʂ ࠓͳΒߦ͚Δʂ
©2018 Wantedly, Inc. Kubernetes ҠߦԿઓ͖ͯͨ͠ େ͖ͳোน͕গͳ͘Ϟνϕ͋Δࠓ͔͠ͳ͍ʂ ͍·ͷLTʹYY͕ͳ͍ͷͰࠓஅ೦ʜ ͦΕ͕࣏ͬͨࠒʹผͷ͕ʜ
©2018 Wantedly, Inc. ҠߦલޙͷEFQMPZϑϩʔ
©2018 Wantedly, Inc. ࣾͷ,VCFSOFUFTͷϑϩʔ શ෦Ϛωʔδυ set image check pull deploy
push push hook build build
©2018 Wantedly, Inc. tag commit hash ͱ latest ͷΈ
GitHub ͷ commit status Ͱ image ͕ ready ͔Θ͔Δ ΄΅ҙͷ commit ༻ͷ image ͕ଘࡏ push push hook build build ࣾͷ,VCFSOFUFTͷϑϩʔ શ෦Ϛωʔδυ
©2018 Wantedly, Inc. `kube prod deploy master` Ͱ deploy Ͱ͖Δ
෦Ͱ kubectl set image ڥ͝ͱͷࠩҟڥมͷΈͰཧ set image check pull deploy ࣾͷ,VCFSOFUFTͷϑϩʔ શ෦Ϛωʔδυ
©2018 Wantedly, Inc. શ෦AWS build hook push hook intermediate ࣾͷ,VCFSOFUFTͷϑϩʔ
ssh deploy hook restart build push pull prod pull ͍͠…
©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
©2018 Wantedly, Inc. શ෦AWS ࣾͷ,VCFSOFUFTͷϑϩʔ ͍͠… Deploy ࣌ʹ build ઐ༻αʔόʔͰ
build Deploy pull and restart Blue / green ssh deploy hook restart build push pull prod pull
©2018 Wantedly, Inc. CVJME 7JTJU #VJME%FQMPZϑϩʔࠩ UBH ڥม 1FPQMF ઐ༻Πϯελϯε
5SBWJT ڥʹରԠ $PNNJUIBTIʹରԠ JNBHFͷத LTͷTFDSFUT EFQMPZ CMVFHSFFO SPMMJOH શ෦"84 ΄΅Ϛωʔδυ Πϯϑϥ 1FPQMFଆʹऩଋ͍ͤͨ͞
©2018 Wantedly, Inc. Ҡߦ࡞ۀ
©2018 Wantedly, Inc. NBTUFSQVTI͔ΒEFQMPZྃ·Ͱ ཁ݅ 5SBWJTͰCVJME͍ͨ͠
©2018 Wantedly, Inc. Ͱ͖ΔݶΓͷ͜ͱΛ build ҎલʹऴΘΒͤΔΑ͏ʹ ൿಗใΛҰೖΕͳ͍EPDLFSJNBHFʹมߋ $*ͰCVJME͢ΔͨΊʹ *OUFSNFEJBUFΛ৽ͯ͠શڥ౷ҰͷJNBHF ΄ͱΜͲͷ͕࣌ؒ
asset sync -> gem ʹ patch ͦͷଞॾʑ…
©2018 Wantedly, Inc. 1VTI͔Β10Ͱbuild ྃ ͰऴΘΒ͍͕ͤͨҰ୴ेͰ͋Δͱஅ Ͱͬͯ
©2018 Wantedly, Inc. ͰऴΘΒ͍͕ͤͨҰ୴ेͰ͋Δͱஅ ͬͱؤுΔํ๏ $JSDMF$*ʹҠߦ͢Δ 'SPOUFOEΛผϨϙδτϦʹ͢Δ ΫϥελͰCVJME͢Δ -BZFSDBDIF͕͑ͯૣ͍ͣ Ͱͬͯ
1VTI͔Β10Ͱbuild ྃ
©2018 Wantedly, Inc. %FQMPZ3PMMCBDLΛམͱͨ͘͠ͳ͍
©2018 Wantedly, Inc. 3PMMCBDLͷ͕མͪΔͷఘΊΔ #MVFHSFFOͱಉ͡CMVFHSFFO͡Όͳ͍ͱແཧ Ͳ͏ͤSPMMCBDL͢Δ͔ͷஅࣗମʹ͍ͬͯΔͷͰ͘͢͝େࣄͰͳ͍ʁ
©2018 Wantedly, Inc. %FQMPZ3PMMCBDLΛԿߦͬͯܭଌ #MVFHSFFOΛΊΔͨΊʹ ΞϓϦέʔγϣϯνʔϜͱΑ͘σΟεΧογϣϯΛͨ͠ ݁ہίϛϡχέʔγϣϯ͕େࣄ Կ͕Ͱ͖ͯԿ͕Ͱ͖ͳ͍ͷ͔Λ໌֬ʹ
©2018 Wantedly, Inc. ͋͞Ҡߦͩʂ
©2018 Wantedly, Inc. ͋͞Ҡߦͩʂͷલʹ
©2018 Wantedly, Inc. ։ൃݕূڥ͚ͩҠߦͨ͠ Ҡߦ࡞ۀࢼݧ ৽͍͠ΦϖϨʔγϣϯͷΛચ͍ग़͢
©2018 Wantedly, Inc. ͋͞Ҡߦͩʂ ͜ΜͲͦ͜
©2018 Wantedly, Inc. 1SPEΛϑϦʔζͯ྆͠ํʹEFQMPZ چ"-# ৽"-# JOUFSOBM DNS
©2018 Wantedly, Inc. چ"-# ৽"-# JOUFSOBM DNS Ұ෦τϥϑΟοΫΛOHJOY͔Βྲྀ͢ ༧Ί༻ҙ͓͍ͯͨ͠ύλʔϯʹҰॠͰมߋͰ͖ΔΑ͏ʹ͓͍ͯͨ͠ BCPSU͕༰қ
©2018 Wantedly, Inc. શτϥϑΟοΫΛLTʹྲྀ͢ چ"-# ৽"-# JOUFSOBM DNS
©2018 Wantedly, Inc. Ұ୴BCPSUͨ͠ چ"-# ৽"-# JOUFSOBM DNS ͜ͷ࣌গ͠ࣄނΛى͕ͨ͜͠ɺҰॠͰBCPSUͰ͖ΔQBUIΛ༻ҙ͓͍ͯͨ͠ͷྑ͔ͬͨ
©2018 Wantedly, Inc. Γ͠ چ"-# ৽"-# JOUFSOBM DNS
©2018 Wantedly, Inc. %/4Γସ͑ چ"-# ৽"-# JOUFSOBM DNS
©2018 Wantedly, Inc. چ"-# ৽"-# JOUFSOBM DNS ྃʂʂʂ
©2018 Wantedly, Inc. DNS ྃʂʂʂ ৽"-#
©2018 Wantedly, Inc. %/4Γସ͑ ৽ALB͕ड͚ͨϦΫΤετͷׂ߹ DNSସ
©2018 Wantedly, Inc. %/4Γସ͑ ৽ALB͕ड͚ͨϦΫΤετͷׂ߹ DNSସ
©2018 Wantedly, Inc. ίϚϯυ࣮ߦ͕ૣ͘ͳͬͨ %FQMPZ͕ૣ͘ͳͬͨ ݁Ռ DBෛՙ͕ݮͬͨ Autoscale͕Ͱ͖ΔΑ͏ʹͳͬͨ ϫʔετ Ұൠతʹఔ
CMVFHSFFOͰͳ͘ͳͬͨͨΊ
©2018 Wantedly, Inc. ϑϩʔ͕͋ΔͱҠߦ͍͢͠ ֶΜͩ͜ͱ ϑΥʔϧόοΫઌ৻ॏʹ Ϛωʔδυָ ࢼݧΛͯ͠ࣄނى͜Δ ఘΊΔ͜ͱେࣄ 1PTUNPSUFNେࣄ
ࣄނΛىͨ͜͠ຊਓཱͪΕΔ
©2018 Wantedly, Inc. We’re Hiring .JDSPTFSWJDFT.POEBZ HJUIVCDPNXBOUFEMZNJDSPTFSWJDFT@NPOEBZ