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
970
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
500
GCP+GKE Deep Dive Part 1: Initial App Development
premist
0
440
GCP+GKE Deep Dive Part 2: Advanced Cluster Management
premist
0
230
Containers @ Google App Engine
premist
0
190
Container CI/CD with Google Cloud Platform
premist
0
340
쉐이커의 AWS 이용 사례
premist
0
150
Waffle @ Startup Asia
premist
1
190
Waffle @ Youth Venture Summit
premist
1
130
Other Decks in Technology
See All in Technology
[新卒向け研修資料] テスト文字列に「うんこ」と入れるな(2024年版)
infiniteloop_inc
2
11k
AOAI をきっかけに 社内の Azure 管理を見直した話
recruitengineers
PRO
1
260
「スニダン」開発組織の構造に込めた意図 ~組織作りはパッションや政治ではない!~
rinchsan
3
540
Janus
bkuhlmann
1
490
Python と Snowflake はズッ友だょ!~ Snowflake の Python 関連機能をふりかえる ~
__allllllllez__
1
110
オーナーシップを持つ領域を明確にする
konifar
13
3.1k
Azure Container Apps + Bicep 〜 こんな感じで運用しています
kaz29
2
450
web-application-security
matsuihidetoshi
0
140
レガシーをぶっ壊せ。AEONで始めるDevRelの話 / Qiita Night 2024-2-22
aeonpeople
3
1.3k
元インフラエンジニアに成る / Human Resources to Human Relations
bobtani
4
900
反実仮想機械学習とは何か
usaito
PRO
11
4.1k
Tellus の衛星データを見てみよう #mf_fukuoka
kongmingstrap
0
170
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
14
1.6k
Creatively Recalculating Your Daily Design Routine
revolveconf
210
11k
WebSockets: Embracing the real-time Web
robhawkes
59
7k
Build your cross-platform service in a week with App Engine
jlugia
225
17k
The Language of Interfaces
destraynor
151
23k
Into the Great Unknown - MozCon
thekraken
10
990
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
60
14k
Embracing the Ebb and Flow
colly
80
4.1k
Code Review Best Practice
trishagee
55
15k
Designing for humans not robots
tammielis
248
25k
A better future with KSS
kneath
231
16k
The Straight Up "How To Draw Better" Workshop
denniskardys
227
130k
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