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

Google Container Engine を始めてみよう

Google Container Engine を始めてみよう

Google Cloud Platform と Google Container Engine のご紹介。

GoogleCloudPlatformJapan

February 10, 2016
Tweet

More Decks by GoogleCloudPlatformJapan

Other Decks in Technology

Transcript

  1. Container Engine を始めてみよう
    Google Cloud Platform Sales Engineer
    Kiyoshi Fukuda

    View Slide

  2. Google Cloud Platform 2
    基盤およびオペレーション
    データサービス
    アプリケーション
    サービス
    実行環境

    View Slide

  3. Building what’s next 3
    Complete Range of Compute

    View Slide

  4. Building what’s next 4
    Google App Engine
    インフラではなくコードにフォーカス
    好きな言語で開発
    クリックするだけでデプロイ可能
    自動的にスケールアウト
    セキュリティスキャナにより脆弱性を発見
    Google Cloud Platform 4
    Data Services
    Foundation - Infrastructure & Operations
    Application Runtime Services

    View Slide

  5. Building what’s next 5
    Google Compute Engine
    Googleインフラの上に構築された仮想マシン
    柔軟なプラットフォームの構築
    Best Of Bleed
    GCE プリエンプティブルVMを使うと通常のVM価
    格の30%で利用可能
    ライブマイグレーション
    Data Services
    Foundation - Infrastructure & Operations
    Application Runtime Services
    Google Cloud Platform 5

    View Slide

  6. Building what’s next 6
    Google Container Engine
    コンテナによる革命が起こりつつある
    開発者にとって:
    開発環境、テスト環境の構築が容易
    マイクロサービスを構築するのが容易
    1コマンドで容易にクラスタをアップデート可能
    運用管理者にとって :
    Kubernetes が管理してくれる
    アプリケーションのデプロイが容易
    ポータビリティ
    Data Services
    Foundation - Infrastructure & Operations
    Application Runtime Services
    Google Cloud Platform 6

    View Slide

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

    View Slide

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

    View Slide

  9. VM vs Container

    View Slide

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

    View Slide

  11. View Slide

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

    View Slide

  13. View Slide

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

    View Slide

  15. CNCF(Cloud Native Computing Foundation)の発足

    View Slide

  16. 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
    ノード

    View Slide

  17. 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
    ポッド : デプロイ単位
    コンテナ
    コンテナ
    ポッド

    View Slide

  18. 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
    多数のポッドを識別するには?

    View Slide

  19. 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
    ラベル: オブジェクトを識別

    View Slide

  20. 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
    ラベル: オブジェクトを識別

    View Slide

  21. 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
    レプリケーションコントローラ
    : ポッドの実行状態を管理

    View Slide

  22. 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
    レプリケーションコントローラ
    : ポッドの実行状態を管理

    View Slide

  23. 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
    レプリケーションコントローラ
    : ポッドの実行状態を管理

    View Slide

  24. 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にアクセスするの?

    View Slide

  25. Kubernetesのクラスタを構築する

    View Slide

  26. Container Engine
    Google Cloud Platform

    View Slide

  27. Container Engine
    Google Cloud Platform

    View Slide

  28. View Slide

  29. View Slide

  30. ハンズオン
    資料: https://goo.gl/ua5fQw

    View Slide

  31. View Slide