Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Shakr - Google Container Engine을 이용한 빠르고 안정적인 서비스 개발 및 배포
Minku Lee
July 06, 2017
Technology
1
860
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
360
GCP+GKE Deep Dive Part 1: Initial App Development
premist
0
380
GCP+GKE Deep Dive Part 2: Advanced Cluster Management
premist
0
200
Containers @ Google App Engine
premist
0
170
Container CI/CD with Google Cloud Platform
premist
0
300
쉐이커의 AWS 이용 사례
premist
0
120
Waffle @ Startup Asia
premist
1
160
Waffle @ Youth Venture Summit
premist
1
96
Other Decks in Technology
See All in Technology
01_ユーザーリサーチ実施の進め方
kouzoukaikaku
0
770
ECテックカンファレンス2023 EC事業部のモバイル開発2023
tatsumi0000
0
340
MLOps Workshopでの学びと弥生の研究開発基盤 / takeaways from MLOps workshop and YAYOI's research and development infrastructure
yayoi_dd
0
160
CUEとKubernetesカスタムオペレータを用いた新しいネットワークコントローラをつくってみた
hrk091
1
300
スクラムマスターの悩みどころを赤裸々に告白します
nagata03
0
170
Deep dive in Reserved Instance ~脳死推奨量購入からの脱却~
kzkmaeda
0
550
FlexScan HD2452Wの 後継を探して
tring
0
6.6k
re:Inventで発表があったIoT事例の紹介と考察
kizawa2020
0
200
クックパッドがRubyKaigiに20名以上の社員で参加するわけ
midorikawa
0
240
Raspberry Pi Camera 3 介紹
piepie_tw
PRO
0
170
2年で10→70人へ! スタートアップの 情報セキュリティ課題と施策
miekobayashi
1
690
MarvelClient Upgrade 64bit クライアントへの自動アップグレード設定
mitsuru_katoh
0
190
Featured
See All Featured
The Invisible Side of Design
smashingmag
292
48k
Imperfection Machines: The Place of Print at Facebook
scottboms
254
12k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
44
14k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
182
15k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
22
1.7k
Code Review Best Practice
trishagee
50
11k
Making the Leap to Tech Lead
cromwellryan
117
7.7k
Gamification - CAS2011
davidbonilla
75
4.1k
The Language of Interfaces
destraynor
149
21k
The Pragmatic Product Professional
lauravandoore
21
3.5k
Producing Creativity
orderedlist
PRO
335
38k
Designing with Data
zakiwarfel
91
4.2k
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
[email protected]
:/#
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