Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Deploying a Containerized Application On GKE
Search
hayashiki
December 23, 2017
Programming
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Deploying a Containerized Application On GKE
hayashiki
December 23, 2017
More Decks by hayashiki
See All by hayashiki
FirestoreのN:N関連の設計の話
hayashiki
0
620
Okayama-2018winter-gae-public.pdf
hayashiki
2
790
Other Decks in Programming
See All in Programming
ActionController meets Protocol Buffers
sorah
1
770
AI Augmentation Techniques with Liberty
ivargrimstad
0
250
Apple Intelligenceとオンデバイス時代の到来
yahir0
0
190
作って学ぶSpring BootのAuto Configuration / JJUG Night Seminar 2026-10-19
rshindo
0
220
個人開発者よ、Honoを使え(おじさんver)
tanahiro2010
2
300
Materialが消えた日 〜真っ白なFlutterキャンバスにRenderObjectで絵を描く〜
umigishiaoi
0
130
SODA - FACT BOOK(JP)
sodainc
1
40k
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Kaigi on Rails 2026, Tokyo, Japan
marcoroth
2
380
動画プレイヤーはなぜカクつくのか 〜Flutterのレンダリングとネイティブの境界を解剖する〜
naruogram
0
320
PyConTW 2026 - AI Coding 不只是工具升級, 區域醫院醫療資訊系統協作開發與資訊團隊轉型實踐
cclai999
0
220
クラウドゲーミングのパフォーマンス最適化に挑む / Cloud Gaming Performance Tuning
vivion
0
320
オーケストレーション記述言語 Katari
yukikurage
0
220
Featured
See All Featured
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
660
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.6k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
620
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.4k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.9k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.5k
Skip the Path - Find Your Career Trail
mkilby
1
280
Navigating Team Friction
lara
192
16k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
1k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
340
Transcript
Deploying a Containerized Application on Google Kubernetes Engine Masayuki Hayasida
Software Developer at Framgia.Inc 2017/12/23
self-introduction Software Engineer Framgia.Inc ɾ࠷ۙԬࢁҾͬӽ͖ͯͨ͠ ɾϑϧϦϞʔτϫʔΧʔ ɾ͖ͳٕज़ - Frontend(react,
redux, angular) - Infrastructure(GCP, AWS, Azure, VPS…) - GAS, Slack, Serverless… ୲ྖҬ͜ͷΜ
today’s topic ɾWhat’s kubernetes ɾWhat’s GKE ɾHow to provide an
application on GKE ɾOthers
Kubernetes
What’s Kubernetes ? Kubernetes is an open-source system for automating
deployment, scaling, and management of containerized applications. ɾAutomatic binpacking ɾHorizontal scaling ɾAutomated rollouts and rollbacks ɾStorage orchestration ɾSelf-healing ɾService discovery and load balancing ɾSecret and configuration management ɾBatch execution
Α͏͢Δʹɺɺ ίϯςφΫϥελϚωʔδϟͰ͢ ɾίϯςφͷΦʔτεέʔϧ ɾϦιʔεεέδϡʔϧ ɾϩʔυόϥϯγϯά ɾetc…
How can I use Kubernetes ? ɾGCP (Compute Engine, Kubernetes
Engine) ɾAWS (AmazonEC2, AmazonEKS new! ) ɾAzure(Azure Container Service) ɾIBM Blue Mix ɾetc… ϚωʔδυͰͳͯ͘ɺselfhost͢Δ͜ͱՄೳɻ ͯͬͱΓ͘͡ΊΔʹύϒϦοΫΫϥυΛͬͨํָ͕ʹߏஙͰ͖Δ
Kubernetes Architecture
Kubernetes Architecture
Pod / Deployment
Pod / Deployment PodɿίϯςφΛάϧʔϐϯάԽͨ֓͠೦ Deployment: PodΛ্ཱͪ͛ͷఆ͚ٛͮΛͨ͠ͷ - template: Podఆٛ -
replicas: Podͷಉ࣌ىಈΛఆٛ and keep PodͷϨϓϦΧ্ݶNodeͷεϖοΫʹґଘ͢Δ - image: docker image file ӈͷྫͰɺnginxͷPodΛport:80Ͱ3ͭͨͪ͋͛ͯʔ
kubernetesͷૢ࡞ɺkubectl
Service
Service - ओʹ෦తͳωοτϫʔΫཧΛߦ͏ - τϥϑΟοΫͷडΛ୲͏ΞΫηείϯτϩʔϥ ಉҰͷPodʹදIPΛ͚ͭͯ;ΓΘ͚Δ ͖͞΄ͲͷnginxPodͷϨϓϦΧ3ͭ ͍͍ײ͡ʹ;ΓΘ͚ͯʔ
Ingress
Ingress - άϩʔόϧͷϩʔυόϥϯαΛఆٛ - HOSTTLSઃఆΛ͢Δ - ΞΫηεϧʔϧͷઃఆ͕Մೳ όʔνϟϧϗετURLʹΑΔ αʔϏεͷ;ΓΘ͚ ར༻ྫɿ
- ෳ։ൃػͰαϒυϝΠϯຖʹ ΞΫηεϧʔϧΛ࡞ - ຊ൪ػ / ։ൃػΞΫηεΛৼΓ͚
Kubernetes
Kubernetes on GKE
Kubernetes on GKE
GKE is … ɾΫϥελͷૢ࡞GCP-SDKͷgcloudͰૢ࡞
None
࣮ྫɿࣗࣾαʔϏε
GCP Architecture
Main Application
Main Application
Nginx /healthz Ͱ Ϩεϙϯε200Λ͔͑ͯ͋͛͠Δ
Rolling Update ஈ֊తʹPodΛ͍Ε͔͑ͯ͘ΕΔɻ μϯλΠϜθϩํࣜ
Puma / Sidekiq
Secrets / ConfigMap ɾconfϑΝΠϧ dockerʹ;͘Ίͣɺ volumeΛϚϯτͯ͠͏
- db:migrateassets-precompileͷrakeλεΫશൠJobͰߦ͏ - db-migrationΛ͢ΔPodΛͨͪ͋͛ - rakeλεΫΛ࣮ࢪɺͦͯ͠Λͨͯ͠ࢮΜͰ͍͘ Job
Job Script
ఆظతʹ࣮ߦ͢ΔJobɺϐϯϙΠϯτͷ࣌ؒଳʹ࣮ߦ͍ͨ͠߹CronJobΛ͏ ਂͷrakeλεΫʢఆظతͳΫϦʔχϯάॲཧʣΛCronJobͰ࣮ߦ͍ͯ͠Δ CronJob
- VolumeϑΝΠϧΛComputeEngineͷDisk͔ΒऔಘͰ͖Δ - Pod͔ΒಡΈࠐΉͱ͖readonly ͳͷͰɺผdiskΛऔಘ͠ɺPodΛ࠶࡞͢Δͱ͔͍͏ΊΜͲ ͍͘͜͞ͱΛ͠ͳ͚ΕͳΒͳ͍ R/W͠ͳ͕ΒӬଓԽ͍ͨ͠ʹ͋Γ GCEPersitentDisk / assets:precompile
ͨͩ͠ʂʂʂʂ υΩϡϝϯτൈਮ
Ͳ͏͢Δʁʁ
https://github.com/kubernetes/examples/blob/master/staging/volumes/nfs/README.md NFS NFSαʔόΛؒʹ͞ΉͱෳϙουͰR/WͰϘϦϡʔϜར༻͕Մೳ
Build / Deploy
Build / Deploy
Private Registory
Container Registry / Cloud Container Builder - KMSʹΑΔɺconfig/database.ymlͷෳ߹ -
KMSʹΑΔɺconfig/secrets.ymlͷෳ߹ - migration - docker build and push GCR - kubectl set image - slack notifications
Container Registry / Cloud Container Builder
Container Registry / Cloud Container Builder
Logging / Monitoring
Logging / Monitoring
- ඪ४ग़ྗͨ͠ͷશͯɺStackdriverग़ྗ͞ΕΔ - Stackdriver͔ΒStackdriverMonitoringͷ࿈ܞ - ϩάͷܗࣜJSON͕Α͍ - StackdriverͷϩάσʔλҎԼͷGCPαʔϏε࿈ܞՄೳ - Cloud
Pub/Sub - Cloud Storage - BigQuery Logging(Stackdriver)
Stackdriver -> PubSub-> ElasticStack - PubSubͰlogstashͷpiplineʹϩάΛྲྀ͜͠Έɺ Elasticserchʹͱͯ͠ɺkibanaͰՄࢹԽʂ - ओʹোௐࠪ༻్
Stackdriver -> BigQuery -> DataStudio
Monitoring (Prometheus * Grafana) - Pod୯ҐͰੑೳࢹ͕Ͱ͖Δɻଟ࠼ͳMetrics - OpenMetricsͱͯ͠ͷσϑΝΫτʹͳΓͦ͏ - ԼͷΩϟϓνϟͷΑ͏ʹɺͳʹΑΓGrafanaΧοίΠΠΑͯ͘
ςϯγϣϯ͕͕͋ΔɻͪΖΜAlertઃఆͰSlack௨Մೳ
ͬͯͳ͍͕ɺҰԠػೳΛONʹ͍ͯ͠Δ Monitoring (Stackdriver)
ɾSpinnecker, Istio, gRPCͳͲར༻͠ ϚΠΫϩαʔϏεԽΛ͢͢ΊΔ ࠓޙΓ͍ͨ͜ͱ
ɾ·ͱΊKubernetesΛͯͬͱΓ͘ ͡ΊΔͷʹGKE࠷ద ɾҰఆٛϑΝΠϧΛ࡞Ε ผϓϩδΣΫτͰԣஅతʹ͑Δ ɾେྔͷτϥϑΟοΫ͕͋ΔطଘαʔϏεͰ ͷҠߦ৻ॏʹ ɾGAEHerokuͰಈ͍͍ͯΔΞϓϦΛ ·ͣҠߦͯ͠Έͯӡ༻ͯ͠ΈΔͷ͕ϕλʔ ·ͱΊ
͓ΘΓ