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
580
GCP+GKE Deep Dive Part 1: Initial App Development
premist
0
470
GCP+GKE Deep Dive Part 2: Advanced Cluster Management
premist
0
230
Containers @ Google App Engine
premist
0
220
Container CI/CD with Google Cloud Platform
premist
0
380
쉐이커의 AWS 이용 사례
premist
0
180
Waffle @ Startup Asia
premist
1
210
Waffle @ Youth Venture Summit
premist
1
150
Other Decks in Technology
See All in Technology
DevFest 2024 Incheon / Songdo - Compose UI 조합 심화
wisemuji
0
160
生成AIをより賢く エンジニアのための RAG入門 - Oracle AI Jam Session #20
kutsushitaneko
4
290
[Oracle TechNight#85] Oracle Autonomous Databaseを使ったAI活用入門
oracle4engineer
PRO
1
110
最近のSfM手法まとめ
kwchrk
3
320
PHP ユーザのための OpenTelemetry 入門 / phpcon2024-opentelemetry
shin1x1
3
1.4k
Wantedly での Datadog 活用事例
bgpat
2
690
サイバー攻撃を想定したセキュリティガイドライン 策定とASM及びCNAPPの活用方法
syoshie
3
1.4k
クレカ・銀行連携機能における “状態”との向き合い方 / SmartBank Engineer LT Event
smartbank
2
100
[トレノケ雲の会 mod.13] 3回目のre:Inventで気づいたこと -CloudOperationsを添えて-
shintaro_fukatsu
0
110
APIとはなにか
mikanichinose
0
110
私なりのAIのご紹介 [2024年版]
qt_luigi
1
120
あの日俺達が夢見たサーバレスアーキテクチャ/the-serverless-architecture-we-dreamed-of
tomoki10
0
500
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
53
13k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
How GitHub (no longer) Works
holman
311
140k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
810
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
A Modern Web Designer's Workflow
chriscoyier
693
190k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
KATA
mclloyd
29
14k
Typedesign – Prime Four
hannesfritz
40
2.4k
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