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
780
Deploy Flow at Wantedly
potsbo
2
810
Wrap every method with just one line
potsbo
1
4.3k
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
38k
ConfigMap vs Secret #k8sjp
potsbo
1
1.3k
Other Decks in Programming
See All in Programming
どうして僕の作ったクラスが手続き型と言われなきゃいけないんですか
akikogoto
1
120
NSOutlineView何もわからん:( 前編 / I Don't Understand About NSOutlineView :( Pt. 1
usagimaru
0
340
聞き手から登壇者へ: RubyKaigi2024 LTでの初挑戦が 教えてくれた、可能性の星
mikik0
1
130
CSC509 Lecture 13
javiergs
PRO
0
110
Better Code Design in PHP
afilina
PRO
0
130
みんなでプロポーザルを書いてみた
yuriko1211
0
280
TypeScript Graph でコードレビューの心理的障壁を乗り越える
ysk8hori
2
1.2k
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.3k
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
480
Arm移行タイムアタック
qnighy
0
340
CSC509 Lecture 12
javiergs
PRO
0
160
タクシーアプリ『GO』のリアルタイムデータ分析基盤における機械学習サービスの活用
mot_techtalk
4
1.5k
Featured
See All Featured
Designing Experiences People Love
moore
138
23k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Code Reviewing Like a Champion
maltzj
520
39k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
Building Adaptive Systems
keathley
38
2.3k
Building Applications with DynamoDB
mza
90
6.1k
What's in a price? How to price your products and services
michaelherold
243
12k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
130
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