Top Banner
Google Cloud Anthos Day Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳
37

Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

May 25, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

Google Cloud

Anthos Day

Deep-dive into Anthos on GCPGoogle Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

Page 2: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

About me

篠原 一徳

アプリケーション プラットフォーム スペシャリスト

専門分野: Anthos, k8s, Serverless, CI / CD

Twitter: @kazshinohara

猫とカメラと旅が好き

Page 3: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

01Anthos Overview

Page 4: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

Anthos とは?

OSS をベースにした、アプリケーションのモダナイゼーションのためのプラットフォーム

Anthos を導入することで Google Kubernetes Engine(a.k.a GKE)を GCP に加え、オンプレミス、他社クラウドでも利用出来る他、

サービスメッシュ、サーバーレスなどモダナイゼーションに有用な

機能が提供される

Page 5: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

サービス・新機能をタイムリーに市場投入 ...

- 高速なリリース サイクル

- 追加・変更に強い

ビジネス規模の拡大に併せて …

- 容易に拡張

- 高可用性の維持・向上

Agility

Flexibility

Scalability

1

2

3

Durability4

モダナイゼーションの目的とは?

Page 6: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

モノリスなアプリケー

ションをより小さな

サービスに分割

マイクロサービス化

コンテナを利用し、

アプリをインフラから分

インフラ管理を

極力少なくし、

開発に集中

作業ステップや

人為ミスを削減

リリースをより

簡単に、早く

マネージドサービスを最

大限活用し Toil を抱えない

マイクロサービス化インフラとアプリの疎

結合化サーバーレス 自動化

マネージドサービス活用

モダナイゼーションに向けた技術観点でのアプローチ

Page 7: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

Anthos のコアコンポーネント

Anthos GKE on VMware Anthos GKE Anthos GKE

on ***コンテナ管理

ポリシー管理 Anthos Config Management

サービス メッシュ Anthos Service Mesh

GKE Hubクラスタ管理

Cloud Run for Anthosサーバーレス

Google Cloud Platform (GCP) オンプレミス 他社クラウド

Page 8: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

Anthos が提供する価値

1. App Modernization

モダンなアプリケーションに最適化されたプラットフォーム

2. Operation Consistency

ハイブリッド・マルチクラウド環境における

オペレーションの一貫性

Page 9: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

App Modernization

Anthos GKE on VMware Anthos GKE Anthos GKE

on ***コンテナ管理

ポリシー管理 Anthos Config Management

サービス メッシュ Anthos Service Mesh

GKE Hubクラスタ管理

Cloud Run for Anthosサーバーレス

Google Cloud Platform (GCP) オンプレミス 他社クラウド

Page 10: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

Operation Consistency

Anthos GKE on VMware Anthos GKE Anthos GKE

on ***コンテナ管理

ポリシー管理 Anthos Config Management

サービス メッシュ Anthos Service Mesh

GKE Hubクラスタ管理

Cloud Run for Anthosサーバーレス

Google Cloud Platform (GCP) オンプレミス 他社クラウド

Page 11: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

Anthos のライセンスモデル

Anthos Hybridオンプレミス、GCP 双方で

Anthos の機能が利用可能な

ライセンス

Anthos on GCPGCP 上でのみ Anthos の機能が利用可能な

ライセンス

Page 12: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

Anthos on GCP で提供される機能

昨年 4 月にアナウンスされた GKE Advanced の一部機能が Anthos にマージ

● Cloud Run for Anthos (f.k.a Cloud Run on GKE)● Anthos Service Mesh (a.k.a ASM)● Anthos Config Management (a.k.a ACM)● GKE Hub● Binary Authorization

2020.1.30 時点の情報

Page 13: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

02Anthos on GCPApp Modernization

Page 14: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

Anthos Service Mesh (ASM)

Google が提供するフルマネージドの サービスメッシュ

Istio 互換の API, コントロール

プレーンを Google が管理

Stackdriver とネイティブな連携

セキュリティ

可観測性

トラフィックコント

ロール

Page 15: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

Istio のアーキテクチャ

一般的に Istio のコントロール プレーンは

データプレーンと同じ Kubernetes のクラスタ上で動作する

主なコンポーネント

● Pilot○ トラフィック コントロール

● Citadel○ mTLS 用の CA

● Mixer○ メトリクス収集

● Envoy ○ サイドカープロキシ

CitadelPilot Mixer

Service A Service B

Envoy Envoy

Config toEnvoys

Telemetry

TLS certs to Envoys

Control Plane

Data Plane

Single Kubernetes Cluster

mTLS

HTTP, gRPC, TCP

Page 16: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

ASM のアーキテクチャ

Traffic Director

Service A Service B

Envoy Envoy

Config toEnvoys (xDSv2 APIs)

TLS certs to Envoys

Telemetry

Mesh CA

HTTP, gRPC, TCP

mTLS

Managed backends

OSS 版 Istio や Istio on GKE と違い、

コントロール プレーンがユーザー クラスタから

分離され、Google 管理となる

● Istio Pilot >> Traffic Director

● Istio Citadel >> Mesh CA

● Istio Mixer >> Managed backends

BetaAlpha Beta

Anthos GKE Single Cluster

Data Plane

Control Plane managed by Google

Page 17: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

ASM - 可観測性

一貫したメトリクス収集

サービス間の依存関係を可視化

SLO を使ったサービスレベル監視

Page 18: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

ASM - トラフィック コントロール

Traffic split 機能によりCanary リリース やBlue / Green デプロイメントを実現

Timeout, Retry, Fault Injection, Circuit Breaker を使ったアプリケーションのレジリエンシーの向上

service_b v2

service_b v1

service_b v1

Canary

5%

apiVersion: networking.istio.io/v1alpha3

kind: VirtualService

metadata:

name: service_b

spec:

hosts:

- service_b

http:

- route:

- destination:

host: service_b

subset: v1

weight: 95

- destination:

host: service_b

subset: v2

weight: 5

Service A95%

Page 19: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

ASM - セキュリティ

mTLS証明書ベースのサービス認証・認可

API の URL Path レベルのユーザー アクセス制御

Page 20: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

DemoAnthos Service Mesh Telemetry

Page 21: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

Cloud Run for Anthos

OSS の Knative をベースにした

サーバーレス コンテナ サービス

Kubernetes と比較して、

よりシンプルにコンテナを利用可能に

Page 22: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

Cloud Run の特徴

高速なデプロイ

ステートレスなコンテナ

高速に 0 to N スケール

数秒でデプロイ

サーバーレス・ネイティブ

管理するサーバーはなし

コードに集中

言語やライブラリの制約なし

高いポータビリティ

どこでも同じ 開発エクスペリエンス

フルマネージでも Anthos GKE のクラスタ上でも

Knative API の一貫性

ロックインの排除

Page 23: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

Cloud Run でコンテナをシンプルに使う

Kubernetes

コードを書く

$ docker build

$ docker push

$ kubectl apply -f deployment.yml

$ kubectl apply -f service.yaml

$ kubectl apply -f hautoscal.yaml

他にも監視・ロギングの設定とか...

Cloud Run

コードを書く

$ docker build

$ docker push

$ gcloud run deploy..

Page 24: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

Cloud Run のリソースモデル

Revision A-1

Revision A-2

Revision A-3

Revision B-1

Revision B-2

ContainerInstanceContainer

InstanceContainerInstance

Requests

Service A

Service B

ServiceCloud Run の主リソース

Service 毎に Endpoint を提供

Revisionデプロイするごとに生成される

コンテナ イメージとデプロイ時に指定される環境変数

やパラメーターから構成される。

Container Instance実際にリクエストを受けるコンテナ、requests 数に応じ

て自動的にスケール

Anthos GKE Cluster

Page 25: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

Fully managed vs for Anthos

Cloud Run Cloud Run for Anthos

課金 Pay per use Anthos license

変更可能なマシンスペック

Memory Memory, CPU, GPU, networking

URLs and SSL Automatic HTTPS URL Manual SSL Certificate

サービスへのアクセス制御

Invoker IAM role External or Internal

VPC へのアクセス No Yes

Page 26: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

ユースケース

external

● Web site

● API endpoint

● Mobile backend

● Webhook

internal

● Between Microservices

● Asynchronous tasks

Page 27: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

03Anthos on GCPOperation Consistency

Page 28: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

Anthos Config ManagementNamespace や Quota、RoleBinding 等 の設定を

ハイブリッドな Kubernetes 環境に自動的に展開

● 設定をオンプレやクラウドのクラスタ間で同期

● コンプライアンス ポリシーを継続的に適用

● セキュリティ/監査を Policy as code で

Page 29: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

Anthos Config Management の仕組み

Gitrepository

k8s クラスタ運用者セキュリティ担当者

① 新しいポリシー(コード )を コミット

Anthos GKE on GCP Anthos GKE on VMware

各クラスタには Config Management Operator がインストールされる

② 各クラスタは対象の Git リポジトリを定期的に確認しており、コードに変更があった場合は、当該変更をクラスタに自動的に反映する

Page 30: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

GitOps with Anthos

Kubernetes を中心にした開発では主に以下 3 つのコードを適切に

管理する必要がある

● アプリケーションのコード

● k8s の ワークロードのマニフェスト

○ e.g. deployment, service● k8s の クラスタ自体のマニフェスト

○ e.g. namespace, rolebinding, quota

Page 31: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

コードの管理

3 つのコードをどこの Git リポジトリで管理するか?

やり方は複数あるが、全て別の Git レポジトリで管理すると

以下のようなメリットがある

● アプリケーションとインフラのコードを綺麗に分離

● Git の log に複数の関心事が混ざらない

● リポジトリへのアクセス管理がシンプルに

Page 32: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

GitOps with Anthos の例

ACM

namespace

quota

rolebinding

deployment

service

k8s cluster manifest

k8s workloadmanifest

App code

Infra Engineer

Sync

Developer Cloud Build Container Registry

ChangeCommit

ChangeCommit

Sync

Triggerbuild

image

Anthos GKE

Page 33: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

DemoGitOps with Anthos

Page 34: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

04まとめ

Page 35: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

まとめ

Anthos はアプリケーションのモダナイゼーションのためのプラットフォーム

Hybrid と on GCP、2 つのライセンスモデル

GKE(k8s)を中核に OSS をベースにしたサービスメッシュやサーバーレスなど

モダナイゼーションに有用な機能を提供

1

2

3

Page 36: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

Onboarding をより簡単に

より多くの人に使って頂けるように

マルチクラウド対応

より多くのユースケースをカバー

2020 年 の Anthos

Page 37: Deep-dive into Anthos on GCP Google Cloud Anthos …...Deep-dive into Anthos on GCP Google Cloud Japan, アプリケーション プラットフォーム スペシャリスト, 篠原一徳

Thank you