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
4k
Go と Wantedly の関係 / How Wantedly uses Go
potsbo
1
790
Deploy Flow at Wantedly
potsbo
2
830
Wrap every method with just one line
potsbo
1
4.4k
Zero yen Keyboard
potsbo
6
3k
Kube - The core tool at Wantedly
potsbo
1
7.2k
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
20年もののレガシープロダクトに 0からPHPStanを入れるまで / phpcon2024
hirobe1999
0
270
SymfonyCon Vienna 2025: Twig, still relevant in 2025?
fabpot
3
1.2k
快速入門可觀測性
blueswen
0
340
useSyncExternalStoreを使いまくる
ssssota
6
1k
선언형 UI에서의 상태관리
l2hyunwoo
0
150
今年のアップデートで振り返るCDKセキュリティのシフトレフト/2024-cdk-security-shift-left
tomoki10
0
200
暇に任せてProxmoxコンソール 作ってみました
karugamo
1
720
バグを見つけた?それAppleに直してもらおう!
uetyo
0
180
htmxって知っていますか?次世代のHTML
hiro_ghap1
0
330
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
690
testcontainers のススメ
sgash708
1
120
Mermaid x AST x 生成AI = コードとドキュメントの完全同期への道
shibuyamizuho
0
160
Featured
See All Featured
Unsuck your backbone
ammeep
669
57k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
Embracing the Ebb and Flow
colly
84
4.5k
Adopting Sorbet at Scale
ufuk
73
9.1k
Speed Design
sergeychernyshev
25
670
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
2
290
It's Worth the Effort
3n
183
28k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Practical Orchestrator
shlominoach
186
10k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.6k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
810
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