containers around re:invent 2018...2018/12/12 · • new launch: aws cloud map • new launch: aws...
TRANSCRIPT
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Containers around re:Invent 2018
アマゾン ウェブ サービス ジャパン株式会社
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Agenda
• New Launch: AWS Cloud Map
• New Launch: AWS App Mesh
• Amazon ECS 関連アップデート
• Amazon EKS 関連アップデート
• Amazon ECR 関連アップデート
• その他のアップデート
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
主なコンテナ関連サービス(re:Invent前)
レジストリコンテナイメージのリポジトリ
マネジメント(コントロールプレーン)デプロイ, スケジューリング, スケーリング, コンテナアプリケーションの管理
ホスティング(データプレーン)コンテナの実行環境
Amazon Elastic
Container Service
Amazon Elastic
Container Registry
Amazon Elastic
Container Service
for Kubernetes
AWS Fargate Amazon EC2
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
クラウド時代のサービスディスカバリを実現するマネージドサービス
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
依存リソースへの一貫したアクセス
Client Service
x.x.x.x:808
0
Host: x.x.x.x
Port: 8080
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
依存リソースへの一貫したアクセス
Client Service
x.x.x.x:808
0
Host: y.y.y.y
Port: 8080
❌
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
依存リソースへの一貫したアクセス
Client Service
x.x.x.x:808
0
❌• 解決策
• ロードバランサを利用したサーバサイドディスカバリ、• ヘルスチェック
• DNS を利用したディスカバリ、クライアントサイドバランシング、• ヘルスチェック
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
依存リソースへの一貫したアクセス
これらの手段がサポートしないリソースのディスカバリ機構はお客さまごとに実装してもらう必要がある
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
アクセスの一貫性を保てていない例
• dev-myservice.mydomain.local
• stg-myservice.mydomain. local
• prod-myservice.mydomain.local
• etc., etc.
↑ アプリケーションから見た依存サービスの論理名がデプロイメントス
テージごとに影響を受けて一貫性を保てていない例
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
任意の“論理名” によるディスカバリ
特定の属性からのディスカバリ
正常状態なリソースディスカバリ
高可用なリージョナルAPI とグローバル DNS
クラウドリソースの動的な「地図」を管理する
Introducing AWS Cloud Map
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Cloud Map: Key Features
• 全てのクラウドリソースのためのレジストリ
• 高速かつセキュアな名前解決
• 属性情報を利用したディスカバリ
• Amazon Route 53 ヘルスチェックを利用した対向システムの状態異常への対応
• AWS プラットフォームやオープンソースソリューションとのインテグレーション
AWS Cloud Map
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Cloud Map: Benefits
• 5秒未満での高速な変更の伝播• 認証認可が可能なサービスディスカバリ• 平均2msの低レイテンシなディスカバリ
• 全コンテナサービスに共通のサービスディスカバリを提供• 属性ベースのディスカバリ• 論理名や親和性のある名前によるサービスディスカバリ
• ELB の CNAME と A レコードをサポート• 最大8アドレスまでを名前解決の結果として返すことが可能• IP ベースのリソースに対しては DNS クエリによるディスカバリも可能
• IP ベースのリソースに対する Amazon Route 53 ヘルスチェック
• AWS プラットフォームやオープンソースソリューションとのインテグレーション
高速かつセキュア
シンプルなサービスディスカバリ
名前解決
管理容易性
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Cloud Map: Ecosystem
AWS Integrations
• Amazon Elastic Container
Services (ECS)
• AWS Fargate
• Amazon Elastic Container
Services for Kubernetes
(EKS)
Open Source Integrations
• Kubernetes (ExternalDNS)
• Istio (Pilot) – Tetrate.io
• Consul.io – HashiCorp
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Cloud Map へのサービス登録
1. aws servicediscovery create-http-namespac
--name mydata.aws
2. aws servicediscovery create-service
--name mydynamodb
--namespace-id %namespace_id%
3. aws servicediscovery register-instanc
--service-id %service_id
--instance-id instance-1
--attributes
ARN=arn:aws:dynamodb:us-west-2:
123456789012:table/users,
STAGE=beta,
VERSION=1.0,
READ_ONLY=false
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
属性ベースのサービスディスカバリ
1. aws servicediscovery discover-instances
--namespace-name mydata.aws
--service-name mydynamodb
--query-parameters VERSION=1.0,STAGE=test
-->{ARN=arn:aws:dynamodb:us-west-2:
123456789012:table/users,
STAGE=test, VERSION=1.0,
READ_ONLY=false}
2. aws servicediscovery discover-instances
--namespace-name mydata.aws
--service-name mydynamodb
--query-parameters VERSION=3.0
-->{} Version: 1.0
Stage: prod
Version: 1.0
Active: yes
Stage: test
Version: 1.0
Active: yes
Stage: test
Version: 2.0
Active: yes
Stage: Prod
Stage: prod
Version: 2.0
Active: no
Version: 2.0Active: yes
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Cloud Map: Regions Supported
US East
• N. Virginia
• Ohio
US West
• N. California
• Oregon
Canada
• Central
Asia Pacific
• Mumbai
• Seoul
• Singapore
• Sydney
• Tokyo
Europe
• Frankfurt
• Ireland
• London
• Paris
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Cloud Map: 価格
価格の例• 10 サービス、平均して月間 75 EC2 インスタンス
サービスレジストリ料金• EC2 インスタンス: 75 x $0.10 = $7.50 / 月
• DynamoDB テーブル: 10 x $0.10 = $1.00 / 月
ディスカバリ API 呼び出し• 75 x $1.00 x 175,000 / 1,000,000 = $13.12 /
月
合計• $7.50 + $1.00 + $13.12 = $21.62 / 月
シンプルかつ予測しやすい価格モデル
• 登録リソース: 1つにつき $0.10 / 月
• ディスカバリ API コール: $1.00 / 100万回
※ ECS 連携による登録リソースについての Cloud Map
料金は無料 (ディスカバリ API コールと関連する DNS
についての料金は発生)
※ DNS を有効にしたネームスペースの作成・利用と DNS
クエリ、ヘルスチェックには Amazon Route 53 の価格モ
デルが適用される
参照: https://aws.amazon.com/route53/pricing/
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
マネージドサービスメッシュ
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Microservices
• 自律的なチームによる開発・運用
• 一つのことを上手にこなす
• Polyglot(-able)
• 独立してスケール
• API による外部サービスと連携
• コンテナとの親和性webserver
.package
ショッピングカート
注文
在庫
出荷
ショッピング
カート
注文
在庫
出荷
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Microservices - 課題 -
• 複雑に連携するシステムからどのようにして問題の発生箇所を見つけるか?
• 問題の発生したサービスが他のサービスに影響を与えないようにするには?
• 各サービスが正しく他のサービスと通信できるように設定するには?
• サービス間の通信を可視化するには?
• Etc., etc.,
プログラミング言語や通信プロトコル、サービスの違いに関係なく
これらを一貫した方法で実現するには?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Option1 - 実装する -
Microservice
Container
アプリケーションコード
モニタリングライブラリ
ロギングライブラリ
トレーシングライブラリ
デプロイ環境別カスタム実装
リトライ & タイムアウト実装
サービスディスカバリ実装
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Option2 - プロキシへのオフロード -
Agent / ProxyMicroservice
Container
アプリケーションコード
モニタリングライブラリ
ロギングライブラリ
トレーシングライブラリ
デプロイ環境別カスタム実装
リトライ & タイムアウト実装
サービスディスカバリ実装
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS App Mesh uses the Envoy Proxy
• Lyft 社で 2016 年に誕生
• 現在は CNCF 管理プロジェクト、先日 “Graduated” に
• 安定して動作し、多くの大規模プロダクション利用事例• Airbnb, Booking.com, eBay, Netflix, Pinterest, Square, Uber, Yelp
App Mesh による容易な連携:
• Amazon CloudWatch
• AWS X-Ray
• Envoy と連携可能なサードパーティのモニタリング・トレーシングツール群
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
How it works
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
App Mesh によるアプリケーション表現
Mesh-[myapp]
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Virtual Node
Virtual Node
Backend
Service Discovery
Listeners
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Create route
Mesh-[myapp]
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Virtual router
Service Name
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Virtual routes
Route B
Route Name B1 Route Name B2
Virtual router :
B
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
App Mesh によるサービス連携例
Mesh-[myapp]
Virtual
router
Service B’
Service B
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Availability
現在は Public Preview のステータスで、以下のリージョンで利用可能
• N. Virginia
• Ohio
• Oregon
• Ireland
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Examples and Roadmap available on GitHub
https://github.com/awslabs/aws-app-mesh-examples
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon ECS, AWS Fargate がリソースのタグ付けに対応
• Amazon ECSとAWS Fargateの各種リソースにタグ付け可能に。コストの把握やリソースの用途把握が容易になった
サービス、タスク定義、タスク、クラスタ、コンテナインスタンスなどがタグ付けの対象となる
タグ付けには新形式のARNとリソースIDが必要。新形式のARN/
リソースIDはオプトインすることで有効化できる。https://aws.amazon.com/jp/blogs/compute/migrating-your-
amazon-ecs-deployment-to-the-new-arn-and-resource-id-
format-2/
• クラスター/コンテナインスタンス/サービス/タスク/タスク定義それぞれにタグ付けが可能
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon ECS でタスクから安全に秘密情報を利用可能に
• タスク定義にSystems Manager Parameter Store
に格納されたパラメーターのフルARNもしくは名前をセットすることで起動時にパラメーターが環境変数としてコンテナ内に展開される
Secrets Managerに格納されたパラメーターも参照可能
• これまではタスク定義にパラメーターそのものを環境変数として記述するか、コンテナの起動時にS3やDynamoDBから取得してくるなどのワークアラウンドが必要だった
• 現時点ではEC2モードのタスクのみサポート
Parameter Store
Container 1 Container 2
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
ECS での Blue/Green デプロイメント powered by CodeDeploy, incl. Fargate
• ロードバランサと連携したトラフィックのフリップ
• 新たにプロビジョンされた Green タスク群にトラフィックを向ける
• Blue タスク群への高速なロールバック
• 手動キャンセル
• Lambda フック処理の失敗
• CloudWatch アラーム連携
• コンソールや API でのデプロイメントステータスや履歴の確認
• Amazon SNS による通知や CloudWatch Events との連携
• "CodeDeploy-ECS"デプロイアクションを CodePipeline から利用可能
• "aws ecs deploy"コマンドによるデプロイの実行も可能
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CodeDeploy Amazon ECS Blue/Green デプロイメント
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
EKS の ALB サポート
• AWS ALB Ingress Controller を利用して、ALB 経由による Kubernetes クラスタのホストまたはパスベースによるルーティングが可能に
• Kubernetes クラスタは ALB の設定、管理を実施
• ALB の豊富なレイヤ7ルーティング機能により、Kubernetes クラスタへの「スマートルータ」またはエントリポイントとして機能
• アノテーションを利用してALB Ingress Typeを選択kubernetes.io/ingress.class: alb
alb.ingress.kubernetes.io/scheme: internet-facing
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
EKSが Kubernetes をversion 1.11をサポートしAPIによるEKSクラスターのアップデートが可能に
• EKSでKubernetes version 1.11を利用可能に• マネージメントコンソール、APIを利用してEKSクラスターをアップデートすることが可能
• worker nodeのアップデートはユーザ自身で実施する必要がある
• EKS APIとして以下が追加• UpdateClusterVersion
• ListUpdates
• DescribeUpdates
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
CodePipeline がソースとして ECR を利用可能
• AWS CodePipeline が Amazon ECRをソースプロバイダとして利用できるようになった
• アプリケーションソースコードまたはベースイメージのいずれかが変更されると、CodePipeline はリリースを開始し、新しいアプリケーションイメージを構築可能に
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
ECR の新しいコンソール
Amazon ECR のコンソールが独立して新しくなった
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Marketplace for Containers
• ECS コンソール、AWS マーケットプレイスから ISV のコンテナプロダクトの検索と購入が可能
• ECS, EKS, Fargate に対応
• 様々なカテゴリのプロダクトがすでに公開
HPC、セキュリティ、開発者ツール、SaaS プロダクト
• 無料、BYOL、月額タイプや使った分だけ課金などのタイプがある
• コンテナマーケットプレイスのプロダクトについての請求は毎月の AWS
からの請求に合算
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
re:Cap
• AWS Cloud Map
• AWS App Mesh
• Amazon ECS
• タグ付け、秘密情報、Blue/Green デプロイ (incl. Fargate)
• Amazon EKS
• ALB サポート、Kubernetes ver 1.11サポート、UpdateAPI
• Amazon ECR
• CodePipeline のパイプラインソースとしてサポート, 新しい Console
• AWS Marketplace for Containers
Thank you!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.