Slide 1

Slide 1 text

gcp ja night #31 Welcome!

Slide 2

Slide 2 text

Agenda Kubernetes/GKE Overview GKEで半年運用してみた Beer & 中華 GCPで新規サービスを開発した話 広告配信システムにおけるGCEでのAutoscalerと CloudLoggingの活用 オンライン広告配信システムのデータ解析チームとCloud DatalabとBigQuery 終了 7:15 7:45 8:15 8:45 9:15 9:45 10:15

Slide 3

Slide 3 text

Google Container Engine 概要

Slide 4

Slide 4 text

Confidential & Proprietary Google Cloud Platform 4 Ian Lewis Developer Advocate - Google Cloud Platform Tokyo, Japan google.com/+IanLewis-hoge @IanMLewis

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

Googleは過去15年間にわたり、地 球上で最も高速でパワフルそして 高品質なクラウドインフラストラク チャを構築してきました

Slide 7

Slide 7 text

世界を駆け巡るGoogle バックボーンネットワーク

Slide 8

Slide 8 text

Building what’s next 8 33カ国 70箇所のエッジロケーション クラウドプロバイダーの中で最大 Google-Grade Networking

Slide 9

Slide 9 text

2012 2015 MapReduce Spanner 2003 2006 2010 2011 GFS Borg Colossus Dremel Bigtable Chubby 2004

Slide 10

Slide 10 text

管理 モバイル 開発ツール コンピュート ネットワーク ビッグデー タ ストレージ

Slide 11

Slide 11 text

Copyright 2015 Google Inc Googleでは10年間に渡り、すべてのサービスをコンテナ で動かしてきた 毎週20億以上のコンテナを立ち上げている Images by Connie Zhou

Slide 12

Slide 12 text

コンテナ イメージ 依存性 アプリケーション コード コンテナはアプリケーションコードとその依存性を一つの ユニットとしてまとめる これにより、アプリケーションとインフラを疎結合にするこ とができる • 伝統的なIT環境において、インフラエンジニアはアプリケーションの実 行環境を正しく整えることが重要 • コンテナはアプリケーションとその依存性がまとまっているので、例え ば、開発環境、テスト環境、本番環境をまたいだデプロイが容易になる • オンプレミス、プライベートクラウド、パブリッククラウド等ことなる実行 環境間の移動が容易になる コンテナとは?

Slide 13

Slide 13 text

軽量 仮想マシンに比べて 軽量でシンプル。数十ミリ秒 で起動 ポータブル 様々な実行環境に対応し、 デプロイメントが容易 効率性 リソース使用量が少なく、コ ンピュートリソースを細分化 して効率的に利用可能 なぜコンテナなのか?

Slide 14

Slide 14 text

Confidential & Proprietary Google Cloud Platform 14 http://research.google.com/pubs/pub43438.html

Slide 15

Slide 15 text

http://research.google.com/pubs/pub43438.html

Slide 16

Slide 16 text

Image by Connie Zhou

Slide 17

Slide 17 text

job hello_world = { runtime = { cell = 'ic' } // Cell (cluster) to run in binary = '.../hello_world_webserver' // Program to run args = { port = '%port%' } // Command line parameters requirements = { // Resource requirements ram = 100M disk = 100M cpu = 0.1 } replicas = 5 // Number of tasks } 10000 Developer View

Slide 18

Slide 18 text

Developer View

Slide 19

Slide 19 text

web browsers BorgMaster link shard UI shard BorgMaster link shard UI shard BorgMaster link shard UI shard BorgMaster link shard UI shard Scheduler borgcfg web browsers scheduler Borglet Borglet Borglet Borglet Config file BorgMaster link shard UI shard persistent store (Paxos) Binary Developer View What just happened?

Slide 20

Slide 20 text

Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Image by Connie Zhou Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world! Hello world!

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

Copyright 2015 Google Inc コンテナ管理の課題 Node Node Cluster Node ??? ● 複数のノードに対するコンテナの デプロイは? ● ノード障害が発生した場合は? ● コンテナ障害が発生した場合は? ● アプリケーションのアップグレードはどうやって管理する?

Slide 23

Slide 23 text

Kubernetes κυβερνήτης: Greek for “pilot” or “helmsman of a ship” the open source cluster manager from Google

Slide 24

Slide 24 text

CNCF(Cloud Native Computing Foundation)の発足

Slide 25

Slide 25 text

Container Engine Google Cloud Platform

Slide 26

Slide 26 text

Kubernetes Master/Scheduler クラスタ : 実行環境 Machine Host Machine Host Machine Host Machine Host Machine Host Machine Host Machine Host Container Agent Container Agent Container Agent Container Agent Container Agent Container Agent Container Agent ノード

Slide 27

Slide 27 text

Log Roller Web Server Machine Host Machine Host Machine Host Machine Host Machine Host Machine Host Machine Host Container Agent Container Agent Container Agent Container Agent Container Agent Container Agent Container Agent Kubernetes Master/Scheduler ポッド : デプロイ単位 コンテナ コンテナ ポッド

Slide 28

Slide 28 text

FE FE FE FE FE FE BE BE BE BE BE BE BE BE BE Machine Host Machine Host Machine Host Machine Host Machine Host Machine Host Machine Host Container Agent Container Agent Container Agent Container Agent Container Agent Container Agent Container Agent Kubernetes - Master/Scheduler 多数のポッドを識別するには?

Slide 29

Slide 29 text

labels: role: frontend FE FE FE FE FE FE BE BE BE BE BE BE BE BE BE Machine Host Machine Host Machine Host Machine Host Machine Host Machine Host Machine Host Container Agent Container Agent Container Agent Container Agent Container Agent Container Agent Container Agent Kubernetes - Master/Scheduler ラベル: オブジェクトを識別

Slide 30

Slide 30 text

labels: role: frontend stage: production Machine Host Machine Host Machine Host Machine Host Machine Host Machine Host Machine Host Container Agent Container Agent Container Agent Container Agent Container Agent Container Agent Container Agent Kubernetes - Master/Scheduler FE FE FE FE FE FE BE BE BE BE BE BE BE BE BE ラベル: オブジェクトを識別

Slide 31

Slide 31 text

FE FE FE FE replicas: 4 template: ... labels: role: frontend stage: production Machine Host Machine Host Machine Host Machine Host Machine Host Machine Host Machine Host Container Agent Container Agent Container Agent Container Agent Container Agent Container Agent Container Agent Kubernetes - Master/Scheduler レプリケーションコントローラ : ポッドの実行状態を管理

Slide 32

Slide 32 text

FE replicas: 1 template: ... labels: role: frontend stage: production Machine Host Machine Host Machine Host Machine Host Machine Host Machine Host Machine Host Container Agent Container Agent Container Agent Container Agent Container Agent Container Agent Container Agent Kubernetes - Master/Scheduler レプリケーションコントローラ : ポッドの実行状態を管理

Slide 33

Slide 33 text

FE FE FE replicas: 3 template: ... labels: role: frontend stage: production Machine Host Machine Host Machine Host Machine Host Machine Host Machine Host Machine Host Container Agent Container Agent Container Agent Container Agent Container Agent Container Agent Container Agent Kubernetes - Master/Scheduler レプリケーションコントローラ : ポッドの実行状態を管理

Slide 34

Slide 34 text

id: backend-service port: 9000 labels: role: backend stage: production Backend Service BE BE BE BE Machine Host Machine Host Machine Host Machine Host Machine Host Machine Host Container Agent Container Agent Container Agent Container Agent Container Agent Container Agent サービス: エンドポイントを抽象化 FE port: 9000 Load-Balancing ポッドは自動配置される! でも、FEはどうやってBEにアクセスするの?

Slide 35

Slide 35 text

デモ

Slide 36

Slide 36 text

Redis Master Master Service Redis Slave Redis Slave Slave Service PHP Frontend PHP Frontend PHP Frontend Frontend Service Public IP

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

Thank you! ありがとうございました #gcpja twitter.com/IanMLewis