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
Shakr - Google Container Engine을 이용한 빠르고 안정적인 서...
Search
Minku Lee
July 06, 2017
Technology
1
1k
Shakr - Google Container Engine을 이용한 빠르고 안정적인 서비스 개발 및 배포
Shakr에서 기존 인프라스트럭쳐를 어떻게 Container Engine으로 이전했는지, 새로운 서비스를 빠르게 Container Engine에 배포할 수 있었는지를 소개합니다.
Minku Lee
July 06, 2017
Tweet
Share
More Decks by Minku Lee
See All by Minku Lee
Google Cloud Summit Seoul - GKE @ Shakr
premist
0
610
GCP+GKE Deep Dive Part 1: Initial App Development
premist
0
490
GCP+GKE Deep Dive Part 2: Advanced Cluster Management
premist
0
240
Containers @ Google App Engine
premist
0
240
Container CI/CD with Google Cloud Platform
premist
0
400
쉐이커의 AWS 이용 사례
premist
0
190
Waffle @ Startup Asia
premist
1
220
Waffle @ Youth Venture Summit
premist
1
160
Other Decks in Technology
See All in Technology
ブラウザのレガシー・独自機能を愛でる-Firefoxの脆弱性4選- / Browser Crash Club #1
masatokinugawa
1
390
いつも初心者向けの記事に助けられているので得意分野では初心者向けの記事を書きます
toru_kubota
2
270
ウォンテッドリーにおける Platform Engineering
bgpat
0
190
AI AgentOps LT大会(2025/04/16) Algomatic伊藤発表資料
kosukeito
0
130
20250408 AI Agent workshop
sakana_ai
PRO
15
3.5k
LangChainとLangGiraphによるRAG・AIエージェント実践入門「10章 要件定義書生成Alエージェントの開発」輪読会スライド
takaakiinada
0
130
DuckDB MCPサーバーを使ってAWSコストを分析させてみた / AWS cost analysis with DuckDB MCP server
masahirokawahara
0
780
От ручной разметки к LLM: как мы создавали облако тегов в Lamoda. Анастасия Ангелова, Data Scientist, Lamoda Tech
lamodatech
0
390
入社後SREチームのミッションや課題の整理をした話
morix1500
1
250
ElixirがHW化され、最新CPU/GPU/NWを過去のものとする数万倍、高速+超省電力化されたWeb/動画配信/AIが動く日
piacerex
0
110
Webアプリを Lambdaで動かすまでに考えること / How to implement monolithic Lambda Web Application
_kensh
7
1.2k
Lightdashの利活用状況 ー導入から2年経った現在地_20250409
hirokiigeta
2
270
Featured
See All Featured
Navigating Team Friction
lara
184
15k
Side Projects
sachag
452
42k
What's in a price? How to price your products and services
michaelherold
245
12k
Stop Working from a Prison Cell
hatefulcrawdad
268
20k
Gamification - CAS2011
davidbonilla
81
5.2k
Fontdeck: Realign not Redesign
paulrobertlloyd
83
5.5k
Typedesign – Prime Four
hannesfritz
41
2.6k
Bash Introduction
62gerente
611
210k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.1k
Adopting Sorbet at Scale
ufuk
76
9.3k
Testing 201, or: Great Expectations
jmmastey
42
7.4k
Git: the NoSQL Database
bkeepers
PRO
430
65k
Transcript
Harder, better, faster, stronger with Google Container Engine ҳӖஶపցূਸࢎਊೠࡅܰҊউੋࢲ࠺झѐߊ߂ߓನ CTO
MINKU LEE
v ⿏࠺٣য়ҟҊ Container icon by Dominic Plag from the Noun
Project ֥ۄب۽рױೠ࠺٣য়ઁݧ࠺٣য়٣ੋೠоٙ
Shakr Infrastructure ⿏֙ஶపցӝ߈ইఃఫ۽ജ ⿏֙($1ࢎਊद ⿏֙ࠗ࠙ஹೊझషܻਗਸ($1۽ $POUBJOFS&OHJOFदद ⿏അࠗ࠙ۄ٘ஹೊসਸ $POUBJOFS&OHJOFীࢲҳز
Topics Kubernetes Container Engine Case Studies
Kubernetes
Why Container? ⿏زੌೞ٘ਝয7.ղীࢲࠁਬোೞѱܻࣗझܳ ҙܻೡࣻ ⿏য٣ࢲաഅоמೠগܻா࣌ҳزജ҃ ⿏7.࠺য়ߡ٘۽ೠѺܻࢿઁҕ١ Container icon by Dominic
Plag from the Noun Project
Kubernetes ⿏ஶపցӝ߈গܻா࣌ਸߓನೞҊ ഛೞҊ ҙܻ೧חदझమ ⿏ҳӖࢎਊೞחஶపցҙܻदझమ ই٣য৬֢ೞܳ҅थೠ۽ં ⿏ܻӝসইצ-JOVY'PVOEBUJPOীࢲೞח $MPVE/BUJWF$PNQVUJOH'PVOEBUJPOীࢲ۽ ંܳҙܻ
Kubernetes ⿏ஶపցӝ߈গܻா࣌झாે݂ ⿏ࢲ࠺झ٣झழߡܻ ⿏۽٘ߖ۠य ⿏ࢸ߂࠺ࠁҙܻ ⿏٣झҙܻ ⿏١١
None
࠺तೠࣗਝয ⿏%PDLFS4XBSN ⿏"NB[PO&$4 ⿏.FTPTQIFSF "QBDIF.FTPT ⿏)BTIJ$PSQ/PNBE
࠺तೠࣗਝয࠺ъ ⿏ஶపցझாે݂ࠗఠ۽٘ߖ۠य ࢸ ٣झҙܻө ߹ببҳহ೧Ѿоמ ⿏($1ղীࢲݻߣܼਵ۽औѱ۞झఠࢤࢿоמ ⿏ৈ۞ۄ٘ઁҕ৬߬যݫఎࢲߡܳഒೞৈ ۞झఠܳҳ୷ೡࣻ $MVTUFS'FEFSBUJPO
⿏4UBUFMFTTೠগܻா࣌ࡺ݅ইצ4UBUFGVMগܻா࣌بҳز ೡࣻח١ৈ۞दաܻয়ীೠ
Kubernetes ҳࢿਃࣗ ⿏1PE ⿏%FQMPZNFOU ⿏4FSWJDF ⿏*OHSFTT ⿏%BFNPO4FU ⿏4FDSFU ⿏$POGJH.BQ ⿏4UBUFGVM4FU
⿏3FQMJDB4FU ⿏$SPO+PC ⿏+PC ⿏1FSTJTUFOU7PMVNF ⿏1FSTJTUFOU7PMVNF$MBJN ⿏FUDj
Kubernetes ҳࢿਃࣗ ⿏1PE ⿏%FQMPZNFOU ⿏4FSWJDF ⿏*OHSFTT ⿏%BFNPO4FU ⿏4FDSFU ⿏$POGJH.BQ ⿏4UBUFGVM4FU
⿏3FQMJDB4FU ⿏$SPO+PC ⿏+PC ⿏1FSTJTUFOU7PMVNF ⿏1FSTJTUFOU7PMVNF$MBJN ⿏FUDj
Case Study: Shakr ӝઓੋۄܳ$POUBJOFS&OHJOFਵ۽ೞӝ
ӝઓইఃఫ Redis Task Queue Fastly CDN Original Media Files Cloud
Storage Processed Media Files Cloud Storage Storage User Uploads Cloud Storage Rendered Segments Cloud Storage CDN Interconnect Upload Processing Worker Compute Engine Multiple Instances Video Processing Worker Compute Engine Multiple Instances Image Processing Worker Compute Engine Multiple Instances Video Rendering Worker Compute Engine Multiple Instances Video Design Processing Worker Compute Engine Multiple Instances Compute Papertrail Logging Datadog Monitoring
೧ѾೞҊर؍ ⿏ਬোೞޅೠஹೊਗഝਊ ೠੋझఢझӒܛ$16ࢎਊܫੌٸҗࠗೞ࢚కੋܲੋझఢझӒܛܳഝਊೡࣻহਸө ⿏ߓನରߣѢ۽ "QQ&OHJOFա)FSPLVэ1BB4ۢಞܻೞѱߓನೡࣻחহਸө ⿏ৈ۞ҳࢿਃࣗܳ߹ѐ۽ҙܻ೧ঠೣ झ ۽Ӓझܻ߁җэҳࢿਃࣗܳಞܻೞѱࢸೡࣻחহਸө
Compute Engine ীࢲ Container Engine ਵ۽ ⿏$POUBJOFS&OHJOF۞झఠࢤࢿ ⿏%FQMPZNFOU4QFDࢿ ⿏ߓನ߂܀݂সؘ ⿏/PEF1PPM୶о߂ઁ
⿏%BUBEPH"HFOUܳాೠݽפఠ݂ ⿏۽Ӓझܻ߁߂
Container Engine ۞झఠ ࢤࢿ
Google Container Engine Kubernetes as a Service
Google Container Engine ⿏,VCFSOFUFTOPEF৬FUDEੋझఢझܳ(PPHMFҙܻ ⿏زਵ۽(PPHMF$PNQVUF&OHJOFੋझఢझࢤࢿ߂ࢸ ⿏زਵ۽ߑച߷ࢸ ⿏زਵ۽۽٘ߖ۠यࢸ
۞झఠࢤࢿ ⿏ਬোೞޅೠஹೊਗഝਊ ೠੋझఢझӒܛ$16ࢎਊܫੌٸҗࠗೞ࢚కੋܲੋझఢझӒ ܛܳഝਊೡࣻহਸө ⿏ߓನରߣѢ۽ "QQ&OHJOFա)FSPLVэ1BB4ۢಞܻೞѱߓನೡࣻਸө ⿏ৈ۞ҳࢿਃࣗܳ߹ѐ۽ҙܻ೧ঠೣ ۽٘ߖ۠ࢲ
झ ۽Ӓझܻ߁җэҳࢿਃࣗܳಞܻೞѱࢸೡ ࣻחহਸө
۞झఠࢤࢿ $ gcloud container clusters create my-awesome-cluster \ --zone asia-northeast1-a
\ --enable-cloud-logging --enable-cloud-monitoring \ --machine-type n1-standard-4 \ —-num-nodes 3 Bash
$ gcloud container clusters get-credentials \ my-awesome-cluster --zone asia-northeast1-a Fetching
cluster endpoint and auth data. kubeconfig entry generated for my-awesome-cluster. $ kubectl proxy Starting to serve on 127.0.0.1:8001 Bash Kubernetes Dashboard
Kubernetes Dashboard
Deployment Spec ࢿ
Pod ↟ оஹೊਬ ↟ ೞաৈ۞ѐஶపց۽ҳࢿ ↟ 1PEউஶపցחҕрҗஶఫझܳҕਬ ↟ ൃߊࢿઙܐदݽؘٚఠਬप ↟
ਃद($4ա1FSTJTUFOU7PMVNFਸࢎਊೞৈؘఠܳࠁઓ
Deployment ⿏ৈ۞ѐ1PEਸߓನೞҊҙܻೞחܻࣗझ ⿏1PEіࣻ SFQMJDB ܳ೧ݶ೧іࣻ݅ఀ زਵ۽୶о߂ઁ ⿏܀݂সؘ৬܀ߔҳഅ 3FQMJDB4FU
yaml deployment.yml apiVersion: apps/v1beta1 kind: Deployment metadata: name: myapp-deployment
yaml deployment.yml apiVersion: apps/v1beta1 kind: Deployment metadata: name: myapp-deployment spec:
replicas: 3
yaml deployment.yml apiVersion: apps/v1beta1 kind: Deployment metadata: name: myapp-deployment spec:
replicas: 3 template: metadata: labels: app: myapp spec: containers: - name: myapp image: gcr.io/my-project/myapp:3.0.0 resources: requests: cpu: 200m memory: 100Mi limits: cpu: "4" memory: 8Gi
yaml deployment.yml apiVersion: apps/v1beta1 kind: Deployment metadata: name: myapp-deployment spec:
replicas: 3 template: metadata: labels: app: myapp spec: containers: - name: myapp image: gcr.io/my-project/myapp:3.0.0 resources: requests: cpu: 200m memory: 100Mi limits: cpu: "4" memory: 8Gi livenessProbe: httpGet: path: / port: 80 readinessProbe: httpGet: path: / port: 80 initialDelaySeconds: 5 periodSeconds: 3
yaml deployment.yml apiVersion: apps/v1beta1 kind: Deployment metadata: name: myapp-deployment spec:
replicas: 3 template: metadata: labels: app: myapp spec: containers: - name: myapp image: gcr.io/my-project/myapp:3.0.0 resources: requests: cpu: 200m memory: 100Mi limits: cpu: "4" memory: 8Gi livenessProbe: httpGet: path: / port: 80 readinessProbe: httpGet: path: / port: 80 initialDelaySeconds: 5 periodSeconds: 3 env: - name: RACK_ENV value: production - name: PORT value: 80 volumeMounts: - name: tmp mountPath: /tmp volumes: - name: tmp emptyDir: {}
ߓನ
Deployment ߓನೞӝ Bash # Get credentials $ gcloud container clusters
get-credentials my-awesome-cluster Fetching cluster endpoint and auth data. kubeconfig entry generated for my-awesome-cluster.
Deployment ߓನೞӝ Bash # Get credentials $ gcloud container clusters
get-credentials my-awesome-cluster Fetching cluster endpoint and auth data. kubeconfig entry generated for my-awesome-cluster. # Deploy! $ kubectl apply -f path/to/deployment.yml deployment "myapp-deployment" created
yaml deployment.yml apiVersion: apps/v1beta1 kind: Deployment metadata: name: myapp-deployment spec:
replicas: 3 template: metadata: labels: app: myapp spec: containers: - name: myapp image: gcr.io/my-project/myapp:3.0.0 resources: requests: cpu: 200m memory: 100Mi limits: cpu: "4" memory: 8Gi livenessProbe: httpGet: path: / port: 80 readinessProbe: httpGet: path: / port: 80 initialDelaySeconds: 5 periodSeconds: 3 env: - name: RACK_ENV value: production - name: PORT value: 80 volumeMounts: - name: tmp mountPath: /tmp volumes: - name: tmp emptyDir: {}
yaml deployment.yml apiVersion: apps/v1beta1 kind: Deployment metadata: name: myapp-deployment spec:
replicas: 30 template: metadata: labels: app: myapp spec: containers: - name: myapp image: gcr.io/my-project/myapp:3.0.0 resources: requests: cpu: 200m memory: 100Mi limits: cpu: "4" memory: 8Gi livenessProbe: httpGet: path: / port: 80 readinessProbe: httpGet: path: / port: 80 initialDelaySeconds: 5 periodSeconds: 3 env: - name: RACK_ENV value: production - name: PORT value: 80 volumeMounts: - name: tmp mountPath: /tmp volumes: - name: tmp emptyDir: {}
yaml deployment.yml apiVersion: apps/v1beta1 kind: Deployment metadata: name: myapp-deployment spec:
replicas: 30 template: metadata: labels: app: myapp spec: containers: - name: myapp image: gcr.io/my-project/myapp:3.1.0 resources: requests: cpu: 200m memory: 100Mi limits: cpu: "4" memory: 8Gi livenessProbe: httpGet: path: / port: 80 readinessProbe: httpGet: path: / port: 80 initialDelaySeconds: 5 periodSeconds: 3 env: - name: RACK_ENV value: production - name: PORT value: 80 volumeMounts: - name: tmp mountPath: /tmp volumes: - name: tmp emptyDir: {}
Deployment ܀݂সؘ Bash kubectl apply -f path/to/deployment.yml deployment "myapp-deployment" updated
Node Pool୶о߂ઁ
Node Pool୶о߂ઁ ⿏ਬোೞޅೠஹೊਗഝਊ ೠੋझఢझӒܛ$16ࢎਊܫੌٸҗࠗೞ࢚కੋܲੋझఢझӒ ܛܳഝਊೡࣻহਸө ⿏ߓನରߣѢ۽ "QQ&OHJOFա)FSPLVэ1BB4ۢಞܻೞѱߓನೡࣻਸө ⿏ৈ۞ҳࢿਃࣗܳ߹ѐ۽ҙܻ೧ঠೣ
۽٘ߖ۠ࢲ झ ۽Ӓझܻ߁җэҳࢿਃࣗܳಞܻೞѱࢸೡ ࣻחহਸө
Node Pool୶о߂ઁ $ gcloud container node-pools create my-new-nodepool \ --cluster
my-awesome-cluster \ --machine-type n1-standard-16 \ --num-nodes 5 Bash
Preemptible Node Pool
Preemptible VM (PVM)
Preemptible VM (PVM)
Preemptible Node Pool $ gcloud beta container node-pools create my-new-nodepool
\ --cluster my-awesome-cluster \ --machine-type n1-standard-16 \ --num-nodes 5 \ --preemptible Bash BETA
PVM with nodeSelector apiVersion: v1 kind: Pod spec: nodeSelector: !cloud.google.com/gke-preemptible
yaml
PVM with nodeAffinity apiVersion: v1 kind: Pod spec: affinity: nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: cloud.google.com/gke-preemptible operator: DoesNotExist yaml BETA
Datadog Agent ܳాೠݽפఠ݂
None
Datadog Agentࢸ $ kubectl create -f dd-agent.yaml daemonset "dd-agent" created
Bash
ChatOps োز
۽Ӓझܻ߁߂
۞झఠࢸ $ gcloud container clusters create my-awesome-cluster \ --zone asia-northeast1-a
\ --enable-cloud-logging --enable-cloud-monitoring \ --machine-type n1-standard-4 \ —-num-nodes 3 Bash
۽Ӓী
Stackdriver Logging ⿏$POUBJOFS&OHJOFਸॵݶਗܼࢸоמ ⿏ఫझ+40/ನݘਗ ⿏पदр۽Ӓझܻ߁ ⿏ޖܐ౭যઁҕ ۽ંೠ׳(# ੌਬ ⿏"84ܻࣗझبݽפఠ݂оמ
⿏$MPVE4UPSBHF #JH2VFSZ 1VC4VCਵ۽۽ӒFYQPSUоמ
Stackdriver Logging
BigQuery Export
റ ⿏ ೠੋझఢझӒܛ$16ࢎਊܫੌٸҗࠗೞ࢚కੋܲੋझఢझӒܛܳഝਊೡࣻহਸө ªৈਗ୭ࣗച ⿏ "QQ&OHJOFա)FSPLVэ1BB4ۢಞܻೞѱߓನೡࣻחহਸө ªLVCFDUMழݔ٘ۄੋبҳ۽एߓನزച ⿏
झ ۽Ӓझܻ߁җэҳࢿਃࣗܳಞܻೞѱࢸೡࣻחহਸө ªࠗ࠙ੋۄҳࢿਃࣗܳऔѱࢸоמ
Case Study: StoriesAds ࢜۽ࢲ࠺झܳ$POUBJOFS&OHJOFী۠டೞӝ
Make Instagram Stories Ads for your brand.
Schedule April 2017 2 9 16 23 30 3 10
17 24 4 11 18 25 5 12 19 26 6 13 20 27 7 14 21 28 8 15 22 29
Schedule April 2017 2 9 16 23 30 3 10
17 24 4 11 18 25 5 12 19 26 6 13 20 27 7 14 21 28 8 15 22 29 ൞ݎ۠டੌ
Schedule April 2017 2 9 16 23 30 3 10
17 24 4 11 18 25 5 12 19 26 6 13 20 27 7 14 21 28 8 15 22 29 ۽షఋೝ ۽ંࣇস ൞ݎ۠டੌ
Schedule April 2017 2 9 16 23 30 3 10
17 24 4 11 18 25 5 12 19 26 6 13 20 27 7 14 21 28 8 15 22 29 ۽షఋೝ ۽ંࣇস ൞ݎ۠டੌ ߔূ٘ۿূ٘ѐߊ $*ജ҃ࣇস
Schedule April 2017 2 9 16 23 30 3 10
17 24 4 11 18 25 5 12 19 26 6 13 20 27 7 14 21 28 8 15 22 29 ۽షఋೝ ۽ંࣇস ൞ݎ۠டੌ ߔূ٘ۿূ٘ѐߊ $*ജ҃ࣇস ۽؋࣌ജ҃ҳ୷
Challenges ⿏ઁೠػੌ ࢜۽بҳٜܳ݅ӝਤ೧ӝഥ࠺ਊਸऔࢎܻೡࣻহח࢚ട ⿏ࣁ҅ࢎਊ࢚ܳਵ۽ೠࢲ࠺झ %BZࠗఠࣁ҅ࢎਊীѱೠࣘبܳઁҕ೧যঠೠ ⿏ஏೞӝ൨ٚߑޙࣻ ѱࢎਊೡٸח҃ઁਵ۽ೞҊ ࢎਊоૐоೣীٮۄਬোೞѱഛೡࣻযঠೠ
Challenges Container Engine
ইఃఫ Container Engine Redis Task Queue Stackdriver Logging Cloud CDN
Container Builder Docker image builds Frontend k8s Deployment Multiple Pods Backend k8s Deployment Multiple Pods Worker k8s Deployment Multiple Pods Datadog Monitoring Cloud Datastore Frontend k8s Service Backend k8s Service StoriesAds k8s Ingress GitHub Source Repository Travis CI Continuous Integration Cloud Load Balancing
Container Builder Container Engine Redis Task Queue Stackdriver Logging Cloud
CDN Container Builder Docker image builds Frontend k8s Deployment Multiple Pods Backend k8s Deployment Multiple Pods Worker k8s Deployment Multiple Pods Datadog Monitoring Cloud Datastore Frontend k8s Service Backend k8s Service StoriesAds k8s Ingress GitHub Source Repository Travis CI Continuous Integration Cloud Load Balancing
Container Builder ⿏$MPVE4PVSDF3FQPTJUPSZ (JU)VC #JUCVDLFUਗ ⿏࠳ےաకӒоੌઑѤীݏਵݶ࠽٘प೯ ⿏۽Ӓपदрഛੋоמ ⿏ޖܐ౭যઁҕ ۽ંೞܖ࠙࠽٘दрઁҕ
⿏ৈ۞ஶపց߽ܳ۳۽ҳزоמ ⿏ݒפ٘ࢲ࠺झ
yaml cloudbuild.yaml steps: - name: 'gcr.io/keynote-demo-project/node:7.9.0' args: ['yarn'] id: 'install-packages'
yaml cloudbuild.yaml steps: - name: 'gcr.io/keynote-demo-project/node:7.9.0' args: ['yarn'] id: 'install-packages'
- name: 'gcr.io/keynote-demo-project/node:7.9.0' args: ['yarn', 'run', 'build'] env: - 'BACKEND=staging' - 'COMMIT_SHA=$COMMIT_SHA' waitFor: ['install-packages'] id: 'staging' - name: 'gcr.io/keynote-demo-project/node:7.9.0' args: ['yarn', 'run', 'build'] env: - 'BACKEND=production' - 'COMMIT_SHA=$COMMIT_SHA' waitFor: ['install-packages'] id: 'production'
yaml cloudbuild.yaml steps: - name: 'gcr.io/keynote-demo-project/node:7.9.0' args: ['yarn'] id: 'install-packages'
- name: 'gcr.io/keynote-demo-project/node:7.9.0' args: ['yarn', 'run', 'build'] env: - 'BACKEND=staging' - 'COMMIT_SHA=$COMMIT_SHA' waitFor: ['install-packages'] id: 'staging' - name: 'gcr.io/keynote-demo-project/node:7.9.0' args: ['yarn', 'run', 'build'] env: - 'BACKEND=production' - 'COMMIT_SHA=$COMMIT_SHA' waitFor: ['install-packages'] id: 'production' - name: 'gcr.io/cloud-builders/docker' args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/frontend:staging-$COMMIT_SHA', '--build-arg', 'backend=staging', '.' ] waitFor: ['staging'] - name: 'gcr.io/cloud-builders/docker' args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/frontend:production-$COMMIT_SHA', '--build-arg', 'backend=production', '.' ] waitFor: ['production']
yaml cloudbuild.yaml steps: - name: 'gcr.io/keynote-demo-project/node:7.9.0' args: ['yarn'] id: 'install-packages'
- name: 'gcr.io/keynote-demo-project/node:7.9.0' args: ['yarn', 'run', 'build'] env: - 'BACKEND=staging' - 'COMMIT_SHA=$COMMIT_SHA' waitFor: ['install-packages'] id: 'staging' - name: 'gcr.io/keynote-demo-project/node:7.9.0' args: ['yarn', 'run', 'build'] env: - 'BACKEND=production' - 'COMMIT_SHA=$COMMIT_SHA' waitFor: ['install-packages'] id: 'production' - name: 'gcr.io/cloud-builders/docker' args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/frontend:staging-$COMMIT_SHA', '--build-arg', 'backend=staging', '.' ] waitFor: ['staging'] - name: 'gcr.io/cloud-builders/docker' args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/frontend:production-$COMMIT_SHA', '--build-arg', 'backend=production', '.' ] waitFor: ['production'] images: [ 'gcr.io/$PROJECT_ID/frontend:staging-$COMMIT_SHA', 'gcr.io/$PROJECT_ID/frontend:production-$COMMIT_SHA' ]
Deployment Container Engine Redis Task Queue Stackdriver Logging Cloud CDN
Container Builder Docker image builds Frontend k8s Deployment Multiple Pods Backend k8s Deployment Multiple Pods Worker k8s Deployment Multiple Pods Datadog Monitoring Cloud Datastore Frontend k8s Service Backend k8s Service StoriesAds k8s Ingress GitHub Source Repository Travis CI Continuous Integration Cloud Load Balancing
yaml deployment-frontend.yaml apiVersion: apps/v1beta1 kind: Deployment metadata: name: frontend-deployment spec:
replicas: 2 template: metadata: labels: app: frontend spec: containers: - name: frontend image: gcr.io/project/frontend:staging-v01 resources: requests: memory: 100Mi ports: - containerPort: 80
yaml deployment-api.yaml apiVersion: apps/v1beta1 kind: Deployment metadata: name: api-deployment spec:
replicas: 3 template: metadata: labels: app: api spec: containers: - name: api image: gcr.io/project/api:v01 resources: requests: memory: 100Mi ports: - containerPort: 80 env: - name: RAILS_ENV value: production - name: RAILS_LOG_TO_STDOUT value: "true" - name: CONFIG_KEY valueFrom: configMapKeyRef: name: my-configs key: CONFIG_KEY - name: SECRET_KEY valueFrom: secretKeyRef: name: my-secrets key: SECRET_KEY
yaml deployment-api.yaml apiVersion: apps/v1beta1 kind: Deployment metadata: name: api-deployment spec:
replicas: 3 template: metadata: labels: app: api spec: containers: - name: api image: gcr.io/project/api:v01 resources: requests: memory: 100Mi ports: - containerPort: 80 env: - name: RAILS_ENV value: production - name: RAILS_LOG_TO_STDOUT value: "true" - name: CONFIG_KEY valueFrom: configMapKeyRef: name: my-configs key: CONFIG_KEY - name: SECRET_KEY valueFrom: secretKeyRef: name: my-secrets key: SECRET_KEY
secret.yaml apiVersion: v1 kind: Secret metadata: name: my-secrets type: Opaque
data: SECRET_KEY: <base64_string> config_map.yaml apiVersion: v1 kind: ConfigMap metadata: name: my-configs type: Opaque data: CONFIG_KEY: <base64_string>
Container Engine Redis Task Queue Stackdriver Logging Cloud CDN Container
Builder Docker image builds Frontend k8s Deployment Multiple Pods Backend k8s Deployment Multiple Pods Worker k8s Deployment Multiple Pods Datadog Monitoring Cloud Datastore Frontend k8s Service Backend k8s Service StoriesAds k8s Ingress GitHub Source Repository Travis CI Continuous Integration Cloud Load Balancing Cloud Datastore
0 6 / 0 7/ 20 1 7, 1 4
*4 5 P ag e 1 of 1 https:/ /cloud.google.com/storage-options/
Cloud Datastore ⿏#JH5BCMFীӝ߈ਸك/P42-ؘఠ߬झ ⿏ࢥ٬ TIBSEJOH җࠂઁ SFQMJDBUJPO ਸزਵ۽ҙܻೞৈਬোೠഛоמ ⿏ੋؙझਗ زࢤࢿ߂ࣻزࢤࢿ
⿏ੋझఢझҗӘইצҗয়ಌۨ࣌җӘ ⿏ޖܐ౭যઁҕ ⿏/JBOUJD 1PL䟖NPO(Pѐߊࢎ ীࢲࢎਊ
https:/ /cloudplatform.googleblog.com/2016/09/bringing-Pokemon-GO-to-life-on-Google-Cloud.html
Service Container Engine Redis Task Queue Stackdriver Logging Cloud CDN
Container Builder Docker image builds Frontend k8s Deployment Multiple Pods Backend k8s Deployment Multiple Pods Worker k8s Deployment Multiple Pods Datadog Monitoring Cloud Datastore Frontend k8s Service Backend k8s Service StoriesAds k8s Ingress GitHub Source Repository Travis CI Continuous Integration Cloud Load Balancing
Service ⿏-BZFS5$16%1-PBE#BMBODJOH ⿏ౠ1PEٜਸ,VCFSOFUFT۞झఠղীࢲ যڌѱӔ೧ঠೞח ⿏,VCFSOFUFTղ4FSWJDF%JTDPWFSZ۽ 1PEղীࢲ4FSWJDFӔоמ
Service Discovery $ kubectl exec -ti debug-pod -- bash root@debug-pod:/#
curl -I http://api-service HTTP/1.1 200 OK X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block X-Content-Type-Options: nosniff Content-Type: text/html X-Request-Id: 7b194765-ixz8-1qke-9572-0fa67509e500 X-Runtime: 0.001207 Bash
service-frontend.yaml apiVersion: v1 kind: Service metadata: name: frontend-service labels: app:
frontend spec: ports: - port: 80 protocol: TCP name: http selector: app: frontend type: NodePort service-api.yaml apiVersion: v1 kind: Service metadata: name: api-service labels: app: api spec: ports: - port: 80 protocol: TCP name: http selector: app: api type: NodePort
Ingress Container Engine Redis Task Queue Stackdriver Logging Cloud CDN
Container Builder Docker image builds Frontend k8s Deployment Multiple Pods Backend k8s Deployment Multiple Pods Worker k8s Deployment Multiple Pods Datadog Monitoring Cloud Datastore Frontend k8s Service Backend k8s Service StoriesAds k8s Ingress GitHub Source Repository Travis CI Continuous Integration Cloud Load Balancing
Ingress ⿏-BZFS)551 4 -PBE#BMBODJOH ⿏ഐझܴ߂҃۽ীٮۄౠߔূ٘۽ਃۄоמ ⿏5-45FSNJOBUJPOਗ ⿏(,&ীࢲח$MPVE)551 4 -PBE#BMBODFSܳزਵ۽ࢤࢿ ⿏ఋࢎ-#৬ܰѱQSFXBSNJOHࠛਃ
⿏ਗܼਵ۽$MPVE$%/ࢸоמ BETA
yaml ingress.yml apiVersion: extensions/v1beta1 kind: Ingress metadata: name: storiesads-com-ingress annotations:
kubernetes.io/ingress.global-static-ip-name: "storiesads-com" spec: tls: - secretName: tls-certificate rules: - http: paths: - path: /api/* backend: serviceName: api-service servicePort: 80 - path: /* backend: serviceName: frontend-service servicePort: 80
Cloud Load Balancing & CDN Container Engine Redis Task Queue
Stackdriver Logging Cloud CDN Container Builder Docker image builds Frontend k8s Deployment Multiple Pods Backend k8s Deployment Multiple Pods Worker k8s Deployment Multiple Pods Datadog Monitoring Cloud Datastore Frontend k8s Service Backend k8s Service StoriesAds k8s Ingress GitHub Source Repository Travis CI Continuous Integration Cloud Load Balancing
ইఃఫ Container Engine Redis Task Queue Stackdriver Logging Cloud CDN
Container Builder Docker image builds Frontend k8s Deployment Multiple Pods Backend k8s Deployment Multiple Pods Worker k8s Deployment Multiple Pods Datadog Monitoring Cloud Datastore Frontend k8s Service Backend k8s Service StoriesAds k8s Ingress GitHub Source Repository Travis CI Continuous Integration Cloud Load Balancing
റӝ ⿏ಞܻೠदࠁ٘৬LVCFDUM$-*بҳܳࢎਊೞৈݒࡅܲߓನоמ ⿏ևߧਤदաܻয়ীоמೠনೠܻࣗझઓ ⿏(PPHMF$MPVE1MBUGPSNղܻܲࣗझ৬ো҅оਊ
ਬೡ ⿏۽؋࣌ജ҃ীӂغחੌܻࠗࣗझоই("оইצ߬ఋ࢚క ⿏"84١ৈ۞ۄ٘ܳযݣ౭ۄ٘۞झఠܳೞҊೡٸח FUDE৬NBTUFS XPSLFS֢٘ܳࢸ೧ঠೣ ⿏.JDSPTPGU"[VSFח,VCFSOFUFT֎౭࠳ਗ ⿏$PSF04৬эসী࠺ਊਸࠛೞҊ"84ա߬যݫఎীࢲݒפ٘۽оמ ⿏ӏݽоݒࢲ࠺झ҃ ࢚ݫݽܻয়ߡ٘١ਸҊ۰೮ਸٸࠗೡࣻ
We're Hiring! careers.shakr.com ࠺٣য়݃ாېܳэٜ݅যоप࠙ਸणפ
Thank you! Any questions? MINKU LEE with Shakr dev team