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
Road to k8s
Search
Daiki Hirakata
April 05, 2018
Technology
0
240
Road to k8s
2018/4/5に表参道.rbでLTしたときの資料です。
Daiki Hirakata
April 05, 2018
Tweet
Share
More Decks by Daiki Hirakata
See All by Daiki Hirakata
Firestoreコスト圧縮の旅
bigplants
0
29
Rails on Docker
bigplants
2
530
Next Level Git
bigplants
0
600
AWSを使っているならOpsWorksでDevOpsしよう!
bigplants
1
1.6k
Other Decks in Technology
See All in Technology
SREが投資するAIOps ~ペアーズにおけるLLM for Developerへの取り組み~
takumiogawa
1
180
Oracle Cloud Infrastructureデータベース・クラウド:各バージョンのサポート期間
oracle4engineer
PRO
28
12k
TypeScriptの次なる大進化なるか!? 条件型を返り値とする関数の型推論
uhyo
2
1.6k
マルチプロダクトな開発組織で 「開発生産性」に向き合うために試みたこと / Improving Multi-Product Dev Productivity
sugamasao
1
300
EventHub Startup CTO of the year 2024 ピッチ資料
eventhub
0
110
テストコード品質を高めるためにMutation Testingライブラリ・Strykerを実戦導入してみた話
ysknsid25
7
2.6k
Why does continuous profiling matter to developers? #appdevelopercon
salaboy
0
190
信頼性に挑む中で拡張できる・得られる1人のスキルセットとは?
ken5scal
2
530
AWS Lambdaと歩んだ“サーバーレス”と今後 #lambda_10years
yoshidashingo
1
170
OCI Network Firewall 概要
oracle4engineer
PRO
0
4.1k
スクラムチームを立ち上げる〜チーム開発で得られたもの・得られなかったもの〜
ohnoeight
2
350
BLADE: An Attempt to Automate Penetration Testing Using Autonomous AI Agents
bbrbbq
0
300
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
What's in a price? How to price your products and services
michaelherold
243
12k
Ruby is Unlike a Banana
tanoku
97
11k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Building Applications with DynamoDB
mza
90
6.1k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
Transcript
Road to k8s @bigplants Apr 5th 2018 @Omotesando.rb
Who am I ? • Daiki Hirakata (36) • Software
Engineer • Main Programing Languages: PHP, Ruby • Primary interests: DevOps, Docker, Kubernetes, Microservice Architecture, GCP @bigplants
ͪΐͬͱ͚ͩએ
ઈࢍ։ൃऀืूதʂ • ϓϩμΫτ໊: ALL-IN • اۀ׆ಈͰඞཁͳશͯͷ πʔϧ͕ೖ͍ͬͯΔ • Rails, Angular,
AWS • גࣜձࣾϏδωεόϯΫ άϧʔϓ
ࠓɺRailsͷdockerҠߦͷ Λ͠·͢ɻ
Agenda • ݱঢ়ͷ՝ • Dockerɺk8sͷ • ࠓޙͷϩʔυϚοϓ
ݱঢ়ͷ՝ͦͷ̍
͜ΕԿͷࣈͰ͠ΐ͏ʁ 3/6
ਖ਼ղɺ ฐࣾͰ̍͜͜ʙ̎ϲ݄ʹ vagrantͷ։ൃڥ͕յΕͨ ਓͷ
ݱঢ়ͷ՝ͦͷ̎
σϓϩΠɺεέʔϧΞτ ͕༰қͰͳ͍
ݱঢ়ͷDevOpsपΓͷཧ • ChefͰϓϩϏδϣχϯά • CapistranoͰRailsΞϓϦΛσϓϩΠ • ShellscriptͰϑϩϯτΤϯυͷAngularΛσϓ ϩΠ
DevOpsͷ՝ • ֤ఔ͕அ͞Ε͍ͯͯγʔϜϨεʹσϓϩΠ Ͱ͖ͳ͍(ख͕૿͑Δ) • Αͬͯzero-downtimeͷσϓϩΠ͕Ͱ͖ͳ͍ • σϓϩΠ͔͔࣌ؒΔ(30min - 3h)
• ChefͰႈੑͷ୲อ͕༰қͰͳ͍
ͦ͏ͩʂίϯςφ͓͏ʂ
ίϯςφͷϝϦοτ • σϓϩΠ͕ߴɻίϯςφΠϝʔδΛ෮ݩ͢ Δ͚ͩɻ • ͳͷͰ։ൃڥ͕յΕͨͱͯ͠࡞Γ͢ͷ ͕͍ɻ • σϓϩΠ͕ίϯςφΛஔ͖͑ΔҙຯʹͳΔ ͷͰႈੑͷ୲อ͕͍͢͠ɻ
յΕ͍͍ͨͬͯ͡Όͳ͍͔ ίϯςφͩͷ
ίϯςφ ΦʔέετϨʔγϣϯɺ k8s (Kubernetes)Ͱʂ
k8sͷϝϦοτ • ίϯςφͷӡ༻ࣗಈԽͷΈ͕͍ͬͯΔ • Φʔτεέʔϧ (ίϯςφɺϊʔυ) • ࣗಈϦΧόϦ • σϓϩΠํ๏ͷબࢶ͕͋Δ
ϩʔϦϯάΞοϓσʔτɺΧφϦΞϦϦʔε • ίϛϡχςΟ͕׆ൃ • Ϋϥυϕϯμʹґଘ͠ͳ͍ • ڠࢍاۀɺஂମ͕ࢁ <- CNCF Λࢀর
Docker, k8sͷ • ඞཁͳίϯςφ • docker-composeͱk8s • Dockerfile
ඞཁͳίϯςφ • App1(rails) • Worker(rails) • App2(Node.js) • App3(Node.js) •
App4(Node.js) • Nginx • Redis • MySQL • Elasticsearch
docker-composeͱk8s • ։ൃڥͱެ։ڥΛͲͬͪk8sͰΓൈ͘ ͷਏ͍ɻ • ։ൃڥ docker-compose • ެ։ڥ k8s
Ͱ͍͘
Dockerfile • ։ൃڥͱެ։ڥͰDockerfileҰॹʹͰ͖ ͳ͍ɻ • ཧ༝ɺެ։ڥ༻ͷdocker imageσϦόϦ Մೳ(ιʔείʔυؚΊ͕ͯ͢ύοΫ͞Εͨঢ় ଶ)Ͱͳ͚Ε͍͚ͳ͍ɻ •
͕ɺ։ൃڥͦΕͩͱ͍উख͕ѱ͗͢Δɻ
։ൃڥͷDockerfile • ࣮ߦ͢Δඞཁͷ͋Δπʔϧͯ͢Πϯετʔ ϧ ruby, bundle, elasticsearch, nodeͳͲ • ىಈ࣌ʹඞཁͳ࡞ۀEntrypointͰ࣮ߦ
։ൃڥͷDockerfileͷҰ෦ൈਮ
ެ։ڥͷDockerfile • ඞཁͳπʔϧ ruby, bundler, node • ඞཁͳ͍πʔϧ elasticsearch •
ιʔείʔυΛؚΊΔ
ެ։ڥͷDockerfileͷҰ෦ൈਮ
͞Βʹ͔͜͜Β
Docker Multi-stage build • ҰͭͷDockerfileʹෳͷFROM۟ΛೖΕΒΕΔ • npm, bower, bundlerඞཁͳ࠷ऴతʹు͖ग़͞Εͨ ϑΝΠϧ͚ͩΛ֤εςʔδ͔Βίϐʔ͢Δࣄ͕Ͱ͖Δ
• bundler, node(ͦΕͧΕͷґଘͨ͠native lib)image ͔Β֎ͤΔ • ͜ΕͰimage͕ܰྔԽͰ͖Δ
ࠓޙͷϩʔυϚοϓ • ։ൃ༻ίϯςφ४උ • ެ։༻ίϯςφ४උ <- ΠϚίί • GKEʹσϓϩΠ •
CI/CDύΠϓϥΠϯͷඋ • ୭Ͱ͓खܰʹk8sΫϥελʹڥߏங&σϓϩΠͰ͖Δ Α͏ʹ͢Δ
·ͨਐḿڞ༗͠·͢
ࠓͷ·ͱΊ • ։ൃڥͱެ։ڥͰDockerfileΘ͚Δ ͠ • ։ൃڥͷίϯςφ։ൃ͍͢͠Α͏ʹ͢ Δ • ެ։ڥͷίϯςφඞཁͳͷ͚ͩʹ͢Δ