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
エンジニアとして関わる要件と仕様(公開用)
murabayashi
0
280
Make Impossible States Impossibleを 意識してReactのPropsを設計しよう
ikumatadokoro
0
170
ヤプリ新卒SREの オンボーディング
masaki12
0
130
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
330
CSC509 Lecture 12
javiergs
PRO
0
160
CSC509 Lecture 11
javiergs
PRO
0
180
Duckdb-Wasmでローカルダッシュボードを作ってみた
nkforwork
0
120
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
100
WebフロントエンドにおけるGraphQL(あるいはバックエンドのAPI)との向き合い方 / #241106_plk_frontend
izumin5210
4
1.4k
『ドメイン駆動設計をはじめよう』のモデリングアプローチ
masuda220
PRO
8
540
Creating a Free Video Ad Network on the Edge
mizoguchicoji
0
120
Less waste, more joy, and a lot more green: How Quarkus makes Java better
hollycummins
0
100
Featured
See All Featured
Producing Creativity
orderedlist
PRO
341
39k
KATA
mclloyd
29
14k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
How to Ace a Technical Interview
jacobian
276
23k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
44
2.2k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Making the Leap to Tech Lead
cromwellryan
133
8.9k
How to train your dragon (web standard)
notwaldorf
88
5.7k
The Language of Interfaces
destraynor
154
24k
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