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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
React Native에 현대적인 빌드 도구 더하기: Rollipop 구현기
leegeunhyeok
0
180
クラウドエージェントは、 何がそんなに便利なのか / what makes cloud agents so useful
rkaga
5
670
自作Discord音声botをLambda MicroVMsに移行した話 / Migrating My Discord Voice Bot to Lambda MicroVMs
akihisaikeda
1
240
[DroidKnights 2026] Workflow AX: From Auto-Documented Policies to E2E Testing
raeminkang
0
260
PyConTW 2026 - AI Coding 不只是工具升級, 區域醫院醫療資訊系統協作開發與資訊團隊轉型實踐
cclai999
0
220
Kotlinの15年とServer-Side Kotlin
n_takehata
1
190
Zero-Tap Sign-In対応、結局何をすればいいの?
mitohato14
0
1.2k
AI Augmentation Techniques with Liberty
ivargrimstad
0
250
パスワード再設定メールのURLについて知っておこう
uyuki234
0
200
Snowflake Openflow Connector利用の勘所 / 20261024developersio2026tokyo-snowflake-openflow
kasacchiful
PRO
0
270
Apple Intelligenceとオンデバイス時代の到来
yahir0
0
190
baseline으로 마이그레이션, 리팩토링 안전하게 맡기기
fornewid
1
800
Featured
See All Featured
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8.2k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3.3k
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
890
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
650
The Invisible Side of Design
smashingmag
301
52k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
Intergalactic Javascript Robots from Outer Space
tanoku
273
28k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
5
880
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
590
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Ͱಈ͍͍ͯΔΞϓϦΛ ·ͣҠߦͯ͠Έͯӡ༻ͯ͠ΈΔͷ͕ϕλʔ ·ͱΊ
͓ΘΓ