Shakr - Google Container Engine을 이용한 빠르고 안정적인 서비스 개발 및 배포

Shakr - Google Container Engine을 이용한 빠르고 안정적인 서비스 개발 및 배포

Shakr에서 기존 인프라스트럭쳐를 어떻게 Container Engine으로 이전했는지, 새로운 서비스를 빠르게 Container Engine에 배포할 수 있었는지를 소개합니다.

91b2bf7b681403e98e6846677d9ca029?s=128

Minku Lee

July 06, 2017
Tweet

Transcript

  1. Harder, better, faster, stronger with Google Container Engine ҳӖஶప੉ցূ૓ਸࢎਊೠࡅܰҊউ੿੸ੋࢲ࠺झѐߊ߂ߓನ CTO

    MINKU LEE
  2. v ⿏࠺٣য়ҟҊ Container icon by Dominic Plag from the Noun

    Project ֥ۄ਎੿ب۽рױೠ࠺٣য়ઁ੘ݧ૓࠺٣য়٣੗ੋ੉ೠоٙ
  3. Shakr Infrastructure ⿏֙ஶప੉ցӝ߈ইఃఫ୊۽੹ജ ⿏֙($1ࢎਊद੘ ⿏֙؀ࠗ࠙੄ஹೊ౴झషܻ૑੗ਗਸ($1۽੉੹ 
 $POUBJOFS&OHJOFद೷द੘ ⿏അ੤؀ࠗ࠙੄௿ۄ਋٘ஹೊ౴੘সਸ
 $POUBJOFS&OHJOFীࢲҳز઺

  4. Topics Kubernetes Container Engine Case Studies

  5. Kubernetes

  6. Why Container? ⿏زੌೞ٘ਝয7.ղীࢲࠁ׮ਬোೞѱܻࣗझܳ ҙܻೡࣻ੓਺ ⿏য٣ࢲա੤അоמೠগ೒ܻா੉࣌ҳزജ҃ ⿏7.؀࠺੸਷য়ߡ೻٘۽੸׼ೠѺܻࢿઁҕ١ Container icon by Dominic

    Plag from the Noun Project
  7. Kubernetes ⿏ஶప੉ցӝ߈গ೒ܻா੉࣌ਸߓನೞҊ ഛ੢ೞҊ  ҙܻ೧઱חदझమ ⿏ҳӖ੉ࢎਊೞחஶప੉ցҙܻदझమ੄
 ই੉٣য৬֢ೞ਋ܳ҅थೠ೐۽ં౟ ⿏৔ܻӝস੉ইצ-JOVY'PVOEBUJPOীࢲ਍৔ೞח
 $MPVE/BUJWF$PNQVUJOH'PVOEBUJPOীࢲ೐۽ ં౟ܳҙܻ

  8. Kubernetes ⿏ஶప੉ցӝ߈গ೒ܻா੉࣌झாે݂ ⿏ࢲ࠺झ٣झழߡܻ ⿏۽٘ߖ۠य ⿏ࢸ੿߂࠺޻੿ࠁҙܻ ⿏٣झ௼ҙܻ ⿏١١

  9. None
  10. ࠺तೠࣗ೐౟ਝয ⿏%PDLFS4XBSN ⿏"NB[PO&$4 ⿏.FTPTQIFSF "QBDIF.FTPT  ⿏)BTIJ$PSQ/PNBE

  11. ࠺तೠࣗ೐౟ਝয؀࠺ъ੼ ⿏ஶప੉ցझாે݂ࠗఠ۽٘ߖ۠य ࢸ੿ ٣झ௼ҙܻө૑
 ߹ب੄بҳহ੉೧Ѿоמ ⿏($1ղীࢲݻߣ੄௿ܼਵ۽औѱ௿۞झఠࢤࢿоמ ⿏ৈ۞௿ۄ਋٘ઁҕ੗৬߬যݫఎࢲߡܳഒ೤ೞৈ
 ௿۞झఠܳҳ୷ೡࣻ੓਺ $MVTUFS'FEFSBUJPO 

    ⿏4UBUFMFTTೠগ೒ܻா੉࣌ࡺ݅੉ইצ4UBUFGVMগ೒ܻா੉࣌بҳز ೡࣻ੓ח١ৈ۞दաܻয়ী؀ೠ؀਽
  12. Kubernetes ҳࢿਃࣗ ⿏1PE ⿏%FQMPZNFOU ⿏4FSWJDF ⿏*OHSFTT ⿏%BFNPO4FU ⿏4FDSFU ⿏$POGJH.BQ ⿏4UBUFGVM4FU

    ⿏3FQMJDB4FU ⿏$SPO+PC ⿏+PC ⿏1FSTJTUFOU7PMVNF ⿏1FSTJTUFOU7PMVNF$MBJN ⿏FUDj
  13. Kubernetes ҳࢿਃࣗ ⿏1PE ⿏%FQMPZNFOU ⿏4FSWJDF ⿏*OHSFTT ⿏%BFNPO4FU ⿏4FDSFU ⿏$POGJH.BQ ⿏4UBUFGVM4FU

    ⿏3FQMJDB4FU ⿏$SPO+PC ⿏+PC ⿏1FSTJTUFOU7PMVNF ⿏1FSTJTUFOU7PMVNF$MBJN ⿏FUDj
  14. Case Study: Shakr ӝઓੋ೐ۄܳ$POUBJOFS&OHJOFਵ۽੉੹ೞӝ

  15. ӝઓইఃఫ୊ 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. ೧ѾೞҊर঻؍੼ ⿏ਬোೞ૑ޅೠஹೊ౴੗ਗഝਊ
 ೠੋझఢझӒܛ੄$16ࢎਊܫ੉ੌٸҗࠗೞ࢚కੋ׮ܲੋझఢझӒܛ੉੉ܳഝਊೡࣻহਸө  ⿏ߓನ੺ର੄ߣѢ۽਑
 "QQ&OHJOF੉ա)FSPLVэ਷1BB4୊ۢಞܻೞѱߓನೡࣻחহਸө  ⿏ৈ۞ҳࢿਃࣗܳ߹ѐ۽ҙܻ೧ঠೣ
 ೾झ୓௼ ۽Ӓझ౟ܻ߁җэ਷ҳࢿਃࣗܳಞܻೞѱࢸ੿ೡࣻחহਸө

  17. Compute Engine ীࢲ Container Engine ਵ۽ ⿏$POUBJOFS&OHJOF௿۞झఠࢤࢿ ⿏%FQMPZNFOU4QFD੘ࢿ ⿏ߓನ߂܀݂সؘ੉౟ ⿏/PEF1PPM୶о߂࢏ઁ

    ⿏%BUBEPH"HFOUܳాೠݽפఠ݂ ⿏۽Ӓझ౟ܻ߁߂੷੢
  18. Container Engine ௿۞झఠ ࢤࢿ

  19. Google Container Engine Kubernetes as a Service

  20. Google Container Engine ⿏,VCFSOFUFTOPEF৬FUDEੋझఢझܳ(PPHMF੉ҙܻ ⿏੗زਵ۽(PPHMF$PNQVUF&OHJOFੋझఢझࢤࢿ߂ࢸ੿ ⿏੗زਵ۽ߑച߷ࢸ੿ ⿏੗زਵ۽۽٘ߖ۠यࢸ੿

  21. ௿۞झఠࢤࢿ ⿏ਬোೞ૑ޅೠஹೊ౴੗ਗഝਊ
 ೠੋझఢझӒܛ੄$16ࢎਊܫ੉ੌٸҗࠗೞ࢚కੋ׮ܲੋझఢझӒ ܛ੉੉ܳഝਊೡࣻহਸө  ⿏ߓನ੺ର੄ߣѢ۽਑
 "QQ&OHJOF੉ա)FSPLVэ਷1BB4୊ۢಞܻೞѱߓನೡࣻ੓ਸө  ⿏ৈ۞ҳࢿਃࣗܳ߹ѐ۽ҙܻ೧ঠೣ
 ۽٘ߖ۠ࢲ

    ೾झ୓௼ ۽Ӓझ౟ܻ߁җэ਷ҳࢿਃࣗܳಞܻೞѱࢸ੿ೡ ࣻחহਸө
  22. ௿۞झఠࢤࢿ $ 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
  23. $ 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
  24. Kubernetes Dashboard

  25. Deployment Spec ੘ࢿ

  26. Pod ↟ о੢੘਷ஹೊ౴ਬ׫ ↟ ೞա഑਷ৈ۞ѐ੄ஶప੉ց۽ҳࢿ ↟ 1PEউ੄ஶప੉ցח੷੢ҕрҗஶఫझ౟ܳҕਬ ↟ ൃߊࢿઙܐदݽؘٚ੉ఠਬप ↟

    ೙ਃद($4ա1FSTJTUFOU7PMVNFਸࢎਊೞৈؘ੉ఠܳࠁઓ
  27. Deployment ⿏ৈ۞ѐ੄1PEਸߓನೞҊҙܻೞחܻࣗझ ⿏1PE੄іࣻ SFQMJDB ܳ૑੿೧઱ݶ੿೧૓іࣻ݅ఀ
 ੗زਵ۽୶о߂࢏ઁ ⿏܀݂সؘ੉౟৬܀ߔҳഅ 3FQMJDB4FU

  28. yaml deployment.yml apiVersion: apps/v1beta1 kind: Deployment metadata: name: myapp-deployment

  29. yaml deployment.yml apiVersion: apps/v1beta1 kind: Deployment metadata: name: myapp-deployment spec:

    replicas: 3
  30. 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
  31. 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
  32. 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: {}
  33. ߓನ

  34. 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.
  35. 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
  36. 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: {}
  37. 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: {}
  38. 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: {}
  39. Deployment ܀݂সؘ੉౟ Bash kubectl apply -f path/to/deployment.yml deployment "myapp-deployment" updated

  40. Node Pool୶о߂࢏ઁ

  41. Node Pool୶о߂࢏ઁ ⿏ਬোೞ૑ޅೠஹೊ౴੗ਗഝਊ
 ೠੋझఢझӒܛ੄$16ࢎਊܫ੉ੌٸҗࠗೞ࢚కੋ׮ܲੋझఢझӒ ܛ੉੉ܳഝਊೡࣻহਸө  ⿏ߓನ੺ର੄ߣѢ۽਑
 "QQ&OHJOF੉ա)FSPLVэ਷1BB4୊ۢಞܻೞѱߓನೡࣻ੓ਸө  ⿏ৈ۞ҳࢿਃࣗܳ߹ѐ۽ҙܻ೧ঠೣ


    ۽٘ߖ۠ࢲ ೾झ୓௼ ۽Ӓझ౟ܻ߁җэ਷ҳࢿਃࣗܳಞܻೞѱࢸ੿ೡ ࣻחহਸө
  42. Node Pool୶о߂࢏ઁ $ gcloud container node-pools create my-new-nodepool \ --cluster

    my-awesome-cluster \ --machine-type n1-standard-16 \ --num-nodes 5 Bash
  43. Preemptible Node Pool

  44. Preemptible VM (PVM)

  45. Preemptible VM (PVM)

  46. 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
  47. PVM with nodeSelector apiVersion: v1 kind: Pod spec: nodeSelector: !cloud.google.com/gke-preemptible

    yaml
  48. PVM with nodeAffinity apiVersion: v1 kind: Pod spec: affinity: nodeAffinity:

    preferredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: cloud.google.com/gke-preemptible operator: DoesNotExist yaml BETA
  49. Datadog Agent ܳాೠݽפఠ݂

  50. None
  51. Datadog Agentࢸ஖ $ kubectl create -f dd-agent.yaml daemonset "dd-agent" created

    Bash
  52. ChatOps োز

  53. ۽Ӓझ౟ܻ߁߂੷੢

  54. ௿۞झఠࢸ੿ $ 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
  55. ۽Ӓী੉੹౟

  56. Stackdriver Logging ⿏$POUBJOFS&OHJOFਸॵ׮ݶਗ௿ܼࢸ੿оמ ⿏ఫझ౟+40/ನݘ૑ਗ ⿏पदр۽Ӓझ౟ܻ߁ ⿏ޖܐ౭যઁҕ ೐۽ં౟׼ೠ׳(# ੌਬ૑  ⿏"84ܻࣗझبݽפఠ݂оמ

    ⿏$MPVE4UPSBHF #JH2VFSZ 1VC4VCਵ۽۽ӒFYQPSUоמ
  57. Stackdriver Logging

  58. BigQuery Export

  59. ੉੹റ ⿏ ೠੋझఢझӒܛ੄$16ࢎਊܫ੉ੌٸҗࠗೞ࢚కੋ׮ܲੋझఢझӒܛ੉੉ܳഝਊೡࣻহਸө 
 ª੔ৈ੗ਗ୭ࣗച ⿏ "QQ&OHJOF੉ա)FSPLVэ਷1BB4୊ۢಞܻೞѱߓನೡࣻחহਸө 
 ªLVCFDUMழݔ٘ۄੋبҳ۽ए਍ߓನ੗زച ⿏

    ೾झ୓௼ ۽Ӓझ౟ܻ߁җэ਷ҳࢿਃࣗܳಞܻೞѱࢸ੿ೡࣻחহਸө 
 ª؀ࠗ࠙੄ੋ೐ۄҳࢿਃࣗܳऔѱࢸ੿оמ
  60. Case Study: StoriesAds ࢜۽਍ࢲ࠺झܳ$POUBJOFS&OHJOFী۠டೞӝ

  61. Make Instagram Stories Ads for your brand.

  62. 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
  63. 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 ൞ݎ۠டੌ
  64. 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 ೐۽షఋ੉ೝ ೐۽ં౟ࣇস ൞ݎ۠டੌ
  65. 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 ೐۽షఋ੉ೝ ೐۽ં౟ࣇস ൞ݎ۠டੌ ߔূ٘೐ۿ౟ূ٘ѐߊ $*ജ҃ࣇস
  66. 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 ೐۽షఋ੉ೝ ೐۽ં౟ࣇস ൞ݎ۠டੌ ߔূ٘೐ۿ౟ূ٘ѐߊ $*ജ҃ࣇস ೐۽؋࣌ജ҃ҳ୷
  67. Challenges ⿏ઁೠػੌ੿
 ࢜۽਍بҳٜܳ݅ӝਤ೧ӝഥ࠺ਊਸऔࢎܻ૑୹ೡࣻহח࢚ട ⿏੹ࣁ҅ࢎਊ੗ܳ؀࢚ਵ۽ೠࢲ࠺झ
 %BZࠗఠ੹ࣁ҅ࢎਊ੗ীѱ௝੸ೠࣘبܳઁҕ೧઱যঠೠ׮ ⿏৘ஏೞӝ൨ٚߑޙ੗ࣻ
 ੸ѱࢎਊೡٸח҃ઁ੸ਵ۽਍৔ೞҊ ࢎਊ੗оૐоೣীٮۄਬোೞѱഛ੢ೡࣻ੓যঠೠ׮

  68. Challenges Container Engine

  69. ইఃఫ୊ 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
  70. 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
  71. Container Builder ⿏$MPVE4PVSDF3FQPTJUPSZ (JU)VC #JUCVDLFU૑ਗ ⿏࠳ے஖աకӒоੌ੿ઑѤীݏਵݶ࠽٘प೯ ⿏۽Ӓपदрഛੋоמ ⿏ޖܐ౭যઁҕ ೐۽ં౟׼ೞܖ࠙࠽٘दрઁҕ 

    ⿏ৈ۞ஶప੉ց߽ܳ۳۽ҳزоמ ⿏ݒפ૑٘ࢲ࠺झ
  72. yaml cloudbuild.yaml steps: - name: 'gcr.io/keynote-demo-project/node:7.9.0' args: ['yarn'] id: 'install-packages'

  73. 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'
  74. 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']
  75. 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' ]
  76. 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
  77. 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
  78. 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
  79. 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
  80. 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>
  81. 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
  82. 0 6 / 0 7/ 20 1 7, 1 4

    *4 5 P ag e 1 of 1 https:/ /cloud.google.com/storage-options/
  83. Cloud Datastore ⿏#JH5BCMFীӝ߈ਸك/P42-ؘ੉ఠ߬੉झ ⿏ࢥ٬ TIBSEJOH җࠂઁ SFQMJDBUJPO ਸ੗زਵ۽ҙܻೞৈਬোೠഛ੢оמ ⿏ੋؙझ૑ਗ ੗زࢤࢿ߂ࣻزࢤࢿ

     ⿏ੋझఢझ׼җӘ੉ইצ੷੢۝җয়ಌۨ੉࣌׼җӘ ⿏ޖܐ౭যઁҕ ⿏/JBOUJD 1PL䟖NPO(Pѐߊࢎ ীࢲࢎਊ઺
  84. https:/ /cloudplatform.googleblog.com/2016/09/bringing-Pokemon-GO-to-life-on-Google-Cloud.html

  85. 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
  86. Service ⿏-BZFS5$16%1-PBE#BMBODJOH ⿏ౠ੿1PEٜਸ,VCFSOFUFT௿۞झఠղীࢲ
 যڌѱ੽Ӕ೧ঠೞח૑੿੄ ⿏,VCFSOFUFTղ੢4FSWJDF%JTDPWFSZ۽
 1PEղীࢲ4FSWJDF੽Ӕоמ

  87. 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
  88. 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
  89. 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
  90. Ingress ⿏-BZFS)551 4 -PBE#BMBODJOH ⿏ഐझ౟੉ܴ߂҃۽ীٮۄౠ੿ߔূ٘۽ਃ୒ۄ਋౴оמ ⿏5-45FSNJOBUJPO૑ਗ ⿏(,&ীࢲח$MPVE)551 4 -PBE#BMBODFSܳ੗زਵ۽ࢤࢿ ⿏ఋࢎ-#৬׮ܰѱQSFXBSNJOHࠛ೙ਃ

    ⿏ਗ௿ܼਵ۽$MPVE$%/ࢸ੿оמ BETA
  91. 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
  92. 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
  93. ইఃఫ୊ 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
  94. റӝ ⿏ಞܻೠ؀दࠁ٘৬LVCFDUM$-*بҳܳࢎਊೞৈݒ਋ࡅܲߓನоמ ⿏և਷ߧਤ੄दաܻয়ী؀਽оמೠ׮নೠܻࣗझઓ੤ ⿏(PPHMF$MPVE1MBUGPSNղ׮ܻܲࣗझ৬ো҅оਊ੉

  95. ਬ੄ೡ੼ ⿏೐۽؋࣌ജ҃ীӂ੢غחੌܻࠗࣗझоই૒("оইצ߬ఋ࢚క ⿏"84١ৈ۞௿ۄ਋٘ܳ৊যݣ౭௿ۄ਋٘௿۞झఠܳ਍৔ೞҊ੗ೡٸח
 ૒੽FUDE৬NBTUFS XPSLFS֢٘ܳࢸ੿೧ঠೣ ⿏.JDSPTPGU"[VSFח,VCFSOFUFT֎੉౭࠳૑ਗ ⿏$PSF04৬э਷স୓ী࠺ਊਸ૑ࠛೞҊ"84ա߬যݫఎীࢲݒפ૑٘۽਍৔оמ ⿏ӏݽоݒ਋੘਷ࢲ࠺झ੄҃਋
 ࢚઱ݫݽܻয়ߡ೻٘١ਸҊ۰೮ਸٸࠗ੸੺ೡࣻ੓਺

  96. We're Hiring! careers.shakr.com ࠺٣য়݃ா౴੄޷ېܳэ੉ٜ݅যоप࠙ਸ଺णפ׮

  97. Thank you! Any questions? MINKU LEE with Shakr dev team