Upgrade to Pro — share decks privately, control downloads, hide ads and more …

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

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

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

Minku Lee

July 06, 2017
Tweet

More Decks by Minku Lee

Other Decks in Technology

Transcript

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

    View full-size slide

  2. v
    ⿏࠺٣য়ҟҊ
    Container icon by Dominic Plag from the Noun Project
    ֥ۄ਎੿ب۽рױೠ࠺٣য়ઁ੘ݧ૓࠺٣য়٣੗ੋ੉ೠоٙ

    View full-size slide

  3. Shakr Infrastructure
    ⿏֙ஶప੉ցӝ߈ইఃఫ୊۽੹ജ
    ⿏֙($1ࢎਊद੘
    ⿏֙؀ࠗ࠙੄ஹೊ౴झషܻ૑੗ਗਸ($1۽੉੹ 

    $POUBJOFS&OHJOFद೷द੘
    ⿏അ੤؀ࠗ࠙੄௿ۄ਋٘ஹೊ౴੘সਸ

    $POUBJOFS&OHJOFীࢲҳز઺

    View full-size slide

  4. Topics
    Kubernetes Container Engine Case Studies

    View full-size slide

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

    View full-size slide

  6. Kubernetes
    ⿏ஶప੉ցӝ߈গ೒ܻா੉࣌ਸߓನೞҊ ഛ੢ೞҊ
    ҙܻ೧઱חदझమ
    ⿏ҳӖ੉ࢎਊೞחஶప੉ցҙܻदझమ੄

    ই੉٣য৬֢ೞ਋ܳ҅थೠ೐۽ં౟
    ⿏৔ܻӝস੉ইצ-JOVY'PVOEBUJPOীࢲ਍৔ೞח

    $MPVE/BUJWF$PNQVUJOH'PVOEBUJPOীࢲ೐۽
    ં౟ܳҙܻ

    View full-size slide

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

    View full-size slide

  8. ࠺तೠࣗ೐౟ਝয
    ⿏%PDLFS4XBSN
    ⿏"NB[PO&$4
    ⿏.FTPTQIFSF "QBDIF.FTPT

    ⿏)BTIJ$PSQ/PNBE

    View full-size slide

  9. ࠺तೠࣗ೐౟ਝয؀࠺ъ੼
    ⿏ஶప੉ցझாે݂ࠗఠ۽٘ߖ۠य ࢸ੿ ٣झ௼ҙܻө૑

    ߹ب੄بҳহ੉೧Ѿоמ
    ⿏($1ղীࢲݻߣ੄௿ܼਵ۽औѱ௿۞झఠࢤࢿоמ
    ⿏ৈ۞௿ۄ਋٘ઁҕ੗৬߬যݫఎࢲߡܳഒ೤ೞৈ

    ௿۞झఠܳҳ୷ೡࣻ੓਺ $MVTUFS'FEFSBUJPO

    ⿏4UBUFMFTTೠগ೒ܻா੉࣌ࡺ݅੉ইצ4UBUFGVMগ೒ܻா੉࣌بҳز
    ೡࣻ੓ח١ৈ۞दաܻয়ী؀ೠ؀਽

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  12. Case Study: Shakr
    ӝઓੋ೐ۄܳ$POUBJOFS&OHJOFਵ۽੉੹ೞӝ

    View full-size slide

  13. ӝઓইఃఫ୊
    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

    View full-size slide

  14. ೧ѾೞҊर঻؍੼
    ⿏ਬোೞ૑ޅೠஹೊ౴੗ਗഝਊ

    ೠੋझఢझӒܛ੄$16ࢎਊܫ੉ੌٸҗࠗೞ࢚కੋ׮ܲੋझఢझӒܛ੉੉ܳഝਊೡࣻহਸө
    ⿏ߓನ੺ର੄ߣѢ۽਑

    "QQ&OHJOF੉ա)FSPLVэ਷1BB4୊ۢಞܻೞѱߓನೡࣻחহਸө
    ⿏ৈ۞ҳࢿਃࣗܳ߹ѐ۽ҙܻ೧ঠೣ

    ೾झ୓௼ ۽Ӓझ౟ܻ߁җэ਷ҳࢿਃࣗܳಞܻೞѱࢸ੿ೡࣻחহਸө

    View full-size slide

  15. Compute Engine ীࢲ
    Container Engine ਵ۽
    ⿏$POUBJOFS&OHJOF௿۞झఠࢤࢿ
    ⿏%FQMPZNFOU4QFD੘ࢿ
    ⿏ߓನ߂܀݂সؘ੉౟
    ⿏/PEF1PPM୶о߂࢏ઁ
    ⿏%BUBEPH"HFOUܳాೠݽפఠ݂
    ⿏۽Ӓझ౟ܻ߁߂੷੢

    View full-size slide

  16. Container Engine ௿۞झఠ ࢤࢿ

    View full-size slide

  17. Google Container Engine
    Kubernetes as a Service

    View full-size slide

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

    View full-size slide

  19. ௿۞झఠࢤࢿ
    ⿏ਬোೞ૑ޅೠஹೊ౴੗ਗഝਊ

    ೠੋझఢझӒܛ੄$16ࢎਊܫ੉ੌٸҗࠗೞ࢚కੋ׮ܲੋझఢझӒ
    ܛ੉੉ܳഝਊೡࣻহਸө
    ⿏ߓನ੺ର੄ߣѢ۽਑

    "QQ&OHJOF੉ա)FSPLVэ਷1BB4୊ۢಞܻೞѱߓನೡࣻ੓ਸө
    ⿏ৈ۞ҳࢿਃࣗܳ߹ѐ۽ҙܻ೧ঠೣ

    ۽٘ߖ۠ࢲ ೾झ୓௼ ۽Ӓझ౟ܻ߁җэ਷ҳࢿਃࣗܳಞܻೞѱࢸ੿ೡ
    ࣻחহਸө

    View full-size slide

  20. ௿۞झఠࢤࢿ
    $ 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

    View full-size slide

  21. $ 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

    View full-size slide

  22. Kubernetes Dashboard

    View full-size slide

  23. Deployment Spec ੘ࢿ

    View full-size slide

  24. Pod
    ↟ о੢੘਷ஹೊ౴ਬ׫
    ↟ ೞա഑਷ৈ۞ѐ੄ஶప੉ց۽ҳࢿ
    ↟ 1PEউ੄ஶప੉ցח੷੢ҕрҗஶఫझ౟ܳҕਬ
    ↟ ൃߊࢿઙܐदݽؘٚ੉ఠਬप
    ↟ ೙ਃद($4ա1FSTJTUFOU7PMVNFਸࢎਊೞৈؘ੉ఠܳࠁઓ

    View full-size slide

  25. Deployment
    ⿏ৈ۞ѐ੄1PEਸߓನೞҊҙܻೞחܻࣗझ
    ⿏1PE੄іࣻ SFQMJDB
    ܳ૑੿೧઱ݶ੿೧૓іࣻ݅ఀ

    ੗زਵ۽୶о߂࢏ઁ
    ⿏܀݂সؘ੉౟৬܀ߔҳഅ 3FQMJDB4FU

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  28. 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

    View full-size slide

  29. 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

    View full-size slide

  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
    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: {}

    View full-size slide

  31. 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.

    View full-size slide

  32. 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

    View full-size slide

  33. 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: {}

    View full-size slide

  34. 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: {}

    View full-size slide

  35. 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: {}

    View full-size slide

  36. Deployment ܀݂সؘ੉౟
    Bash
    kubectl apply -f path/to/deployment.yml
    deployment "myapp-deployment" updated

    View full-size slide

  37. Node Pool୶о߂࢏ઁ

    View full-size slide

  38. Node Pool୶о߂࢏ઁ
    ⿏ਬোೞ૑ޅೠஹೊ౴੗ਗഝਊ

    ೠੋझఢझӒܛ੄$16ࢎਊܫ੉ੌٸҗࠗೞ࢚కੋ׮ܲੋझఢझӒ
    ܛ੉੉ܳഝਊೡࣻহਸө
    ⿏ߓನ੺ର੄ߣѢ۽਑

    "QQ&OHJOF੉ա)FSPLVэ਷1BB4୊ۢಞܻೞѱߓನೡࣻ੓ਸө
    ⿏ৈ۞ҳࢿਃࣗܳ߹ѐ۽ҙܻ೧ঠೣ

    ۽٘ߖ۠ࢲ ೾झ୓௼ ۽Ӓझ౟ܻ߁җэ਷ҳࢿਃࣗܳಞܻೞѱࢸ੿ೡ
    ࣻחহਸө

    View full-size slide

  39. Node Pool୶о߂࢏ઁ
    $ gcloud container node-pools create my-new-nodepool \
    --cluster my-awesome-cluster \
    --machine-type n1-standard-16 \
    --num-nodes 5
    Bash

    View full-size slide

  40. Preemptible Node Pool

    View full-size slide

  41. Preemptible VM (PVM)

    View full-size slide

  42. Preemptible VM (PVM)

    View full-size slide

  43. 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

    View full-size slide

  44. PVM with nodeSelector
    apiVersion: v1
    kind: Pod
    spec:
    nodeSelector:
    !cloud.google.com/gke-preemptible
    yaml

    View full-size slide

  45. PVM with nodeAffinity
    apiVersion: v1
    kind: Pod
    spec:
    affinity:
    nodeAffinity:
    preferredDuringSchedulingIgnoredDuringExecution:
    nodeSelectorTerms:
    - matchExpressions:
    - key: cloud.google.com/gke-preemptible
    operator: DoesNotExist
    yaml
    BETA

    View full-size slide

  46. Datadog Agent
    ܳాೠݽפఠ݂

    View full-size slide

  47. Datadog Agentࢸ஖
    $ kubectl create -f dd-agent.yaml
    daemonset "dd-agent" created
    Bash

    View full-size slide

  48. ChatOps োز

    View full-size slide

  49. ۽Ӓझ౟ܻ߁߂੷੢

    View full-size slide

  50. ௿۞झఠࢸ੿
    $ 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

    View full-size slide

  51. ۽Ӓী੉੹౟

    View full-size slide

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

    ⿏"84ܻࣗझبݽפఠ݂оמ
    ⿏$MPVE4UPSBHF #JH2VFSZ 1VC4VCਵ۽۽ӒFYQPSUоמ

    View full-size slide

  53. Stackdriver Logging

    View full-size slide

  54. BigQuery Export

    View full-size slide

  55. ੉੹റ
    ⿏ ೠੋझఢझӒܛ੄$16ࢎਊܫ੉ੌٸҗࠗೞ࢚కੋ׮ܲੋझఢझӒܛ੉੉ܳഝਊೡࣻহਸө 

    ª੔ৈ੗ਗ୭ࣗച
    ⿏ "QQ&OHJOF੉ա)FSPLVэ਷1BB4୊ۢಞܻೞѱߓನೡࣻחহਸө 

    ªLVCFDUMழݔ٘ۄੋبҳ۽ए਍ߓನ੗زച
    ⿏ ೾झ୓௼ ۽Ӓझ౟ܻ߁җэ਷ҳࢿਃࣗܳಞܻೞѱࢸ੿ೡࣻחহਸө 

    ª؀ࠗ࠙੄ੋ೐ۄҳࢿਃࣗܳऔѱࢸ੿оמ

    View full-size slide

  56. Case Study: StoriesAds
    ࢜۽਍ࢲ࠺झܳ$POUBJOFS&OHJOFী۠டೞӝ

    View full-size slide

  57. Make Instagram Stories Ads for your brand.

    View full-size slide

  58. 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

    View full-size slide

  59. 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 ൞ݎ۠டੌ

    View full-size slide

  60. 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
    ೐۽షఋ੉ೝ
    ೐۽ં౟ࣇস
    ൞ݎ۠டੌ

    View full-size slide

  61. 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
    ೐۽షఋ੉ೝ
    ೐۽ં౟ࣇস
    ൞ݎ۠டੌ
    ߔূ٘೐ۿ౟ূ٘ѐߊ
    $*ജ҃ࣇস

    View full-size slide

  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
    ೐۽షఋ੉ೝ
    ೐۽ં౟ࣇস
    ൞ݎ۠டੌ
    ߔূ٘೐ۿ౟ূ٘ѐߊ
    $*ജ҃ࣇস
    ೐۽؋࣌ജ҃ҳ୷

    View full-size slide

  63. Challenges
    ⿏ઁೠػੌ੿

    ࢜۽਍بҳٜܳ݅ӝਤ೧ӝഥ࠺ਊਸऔࢎܻ૑୹ೡࣻহח࢚ട
    ⿏੹ࣁ҅ࢎਊ੗ܳ؀࢚ਵ۽ೠࢲ࠺झ

    %BZࠗఠ੹ࣁ҅ࢎਊ੗ীѱ௝੸ೠࣘبܳઁҕ೧઱যঠೠ׮
    ⿏৘ஏೞӝ൨ٚߑޙ੗ࣻ

    ੸ѱࢎਊೡٸח҃ઁ੸ਵ۽਍৔ೞҊ ࢎਊ੗оૐоೣীٮۄਬোೞѱഛ੢ೡࣻ੓যঠೠ׮

    View full-size slide

  64. Challenges
    Container Engine

    View full-size slide

  65. ইఃఫ୊
    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

    View full-size slide

  66. 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

    View full-size slide

  67. Container Builder
    ⿏$MPVE4PVSDF3FQPTJUPSZ (JU)VC #JUCVDLFU૑ਗ
    ⿏࠳ے஖աకӒоੌ੿ઑѤীݏਵݶ࠽٘प೯
    ⿏۽Ӓपदрഛੋоמ
    ⿏ޖܐ౭যઁҕ ೐۽ં౟׼ೞܖ࠙࠽٘दрઁҕ

    ⿏ৈ۞ஶప੉ց߽ܳ۳۽ҳزоמ
    ⿏ݒפ૑٘ࢲ࠺झ

    View full-size slide

  68. yaml
    cloudbuild.yaml
    steps:
    - name: 'gcr.io/keynote-demo-project/node:7.9.0'
    args: ['yarn']
    id: 'install-packages'

    View full-size slide

  69. 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'

    View full-size slide

  70. 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']

    View full-size slide

  71. 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'
    ]

    View full-size slide

  72. 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

    View full-size slide

  73. 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

    View full-size slide

  74. 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

    View full-size slide

  75. 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

    View full-size slide

  76. secret.yaml
    apiVersion: v1
    kind: Secret
    metadata:
    name: my-secrets
    type: Opaque
    data:
    SECRET_KEY:
    config_map.yaml
    apiVersion: v1
    kind: ConfigMap
    metadata:
    name: my-configs
    type: Opaque
    data:
    CONFIG_KEY:

    View full-size slide

  77. 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

    View full-size slide

  78. 0 6 /
    0 7/
    20 1
    7, 1
    4 *4 5
    P ag e 1 of 1
    https:/
    /cloud.google.com/storage-options/

    View full-size slide

  79. Cloud Datastore
    ⿏#JH5BCMFীӝ߈ਸك/P42-ؘ੉ఠ߬੉झ
    ⿏ࢥ٬ TIBSEJOH
    җࠂઁ SFQMJDBUJPO
    ਸ੗زਵ۽ҙܻೞৈਬোೠഛ੢оמ
    ⿏ੋؙझ૑ਗ ੗زࢤࢿ߂ࣻزࢤࢿ

    ⿏ੋझఢझ׼җӘ੉ইצ੷੢۝җয়ಌۨ੉࣌׼җӘ
    ⿏ޖܐ౭যઁҕ
    ⿏/JBOUJD 1PL䟖NPO(Pѐߊࢎ
    ীࢲࢎਊ઺

    View full-size slide

  80. https:/
    /cloudplatform.googleblog.com/2016/09/bringing-Pokemon-GO-to-life-on-Google-Cloud.html

    View full-size slide

  81. 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

    View full-size slide

  82. Service
    ⿏-BZFS5$16%1-PBE#BMBODJOH
    ⿏ౠ੿1PEٜਸ,VCFSOFUFT௿۞झఠղীࢲ

    যڌѱ੽Ӕ೧ঠೞח૑੿੄
    ⿏,VCFSOFUFTղ੢4FSWJDF%JTDPWFSZ۽

    1PEղীࢲ4FSWJDF੽Ӕоמ

    View full-size slide

  83. 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

    View full-size slide

  84. 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

    View full-size slide

  85. 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

    View full-size slide

  86. Ingress
    ⿏-BZFS)551 4
    -PBE#BMBODJOH
    ⿏ഐझ౟੉ܴ߂҃۽ীٮۄౠ੿ߔূ٘۽ਃ୒ۄ਋౴оמ
    ⿏5-45FSNJOBUJPO૑ਗ
    ⿏(,&ীࢲח$MPVE)551 4
    -PBE#BMBODFSܳ੗زਵ۽ࢤࢿ
    ⿏ఋࢎ-#৬׮ܰѱQSFXBSNJOHࠛ೙ਃ
    ⿏ਗ௿ܼਵ۽$MPVE$%/ࢸ੿оמ
    BETA

    View full-size slide

  87. 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

    View full-size slide

  88. 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

    View full-size slide

  89. ইఃఫ୊
    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

    View full-size slide

  90. റӝ
    ⿏ಞܻೠ؀दࠁ٘৬LVCFDUM$-*بҳܳࢎਊೞৈݒ਋ࡅܲߓನоמ
    ⿏և਷ߧਤ੄दաܻয়ী؀਽оמೠ׮নೠܻࣗझઓ੤
    ⿏(PPHMF$MPVE1MBUGPSNղ׮ܻܲࣗझ৬ো҅оਊ੉

    View full-size slide

  91. ਬ੄ೡ੼
    ⿏೐۽؋࣌ജ҃ীӂ੢غחੌܻࠗࣗझоই૒("оইצ߬ఋ࢚క
    ⿏"84١ৈ۞௿ۄ਋٘ܳ৊যݣ౭௿ۄ਋٘௿۞झఠܳ਍৔ೞҊ੗ೡٸח

    ૒੽FUDE৬NBTUFS XPSLFS֢٘ܳࢸ੿೧ঠೣ
    ⿏.JDSPTPGU"[VSFח,VCFSOFUFT֎੉౭࠳૑ਗ
    ⿏$PSF04৬э਷স୓ী࠺ਊਸ૑ࠛೞҊ"84ա߬যݫఎীࢲݒפ૑٘۽਍৔оמ
    ⿏ӏݽоݒ਋੘਷ࢲ࠺झ੄҃਋

    ࢚઱ݫݽܻয়ߡ೻٘١ਸҊ۰೮ਸٸࠗ੸੺ೡࣻ੓਺

    View full-size slide

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

    View full-size slide

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

    View full-size slide