Slide 1

Slide 1 text

© 2022, Amazon Web Services, Inc. or its affiliates. © 2022, Amazon Web Services, Inc. or its affiliates. AWS コンテナサービスアップデート JAWS UG コンテナ⽀部 #21 Masatoshi Hayashi Specialist Solutions Architect, Containers AWS Japan

Slide 2

Slide 2 text

© 2022, Amazon Web Services, Inc. or its affiliates. ⾃⼰紹介 林 政利, @literalice Specialist Solutions Architect, Containers / AWS Japan 好きな AWS のサービス Amazon Elastic Kubernetes Service (Amazon EKS) AWS Certificate Manager SIer フリーランス Java/Ruby 開発者 Kubernetes インフラ設計 (Web 企業) Containers SA, Support Engineer (クラウド製品ベンダー) AWS Japan Containers SA

Slide 3

Slide 3 text

© 2022, Amazon Web Services, Inc. or its affiliates. 3

Slide 4

Slide 4 text

© 2022, Amazon Web Services, Inc. or its affiliates. アジェンダ • Amazon Elastic Container Service (Amazon ECS) • Amazon Elastic Kubernetes Service (Amazon EKS) / Kubernetes • Amazon Elastic Container Registry (Amazon ECR) • AWS App Runner 4

Slide 5

Slide 5 text

© 2022, Amazon Web Services, Inc. or its affiliates. © 2022, Amazon Web Services, Inc. or its affiliates. 5 Amazon ECS

Slide 6

Slide 6 text

© 2022, Amazon Web Services, Inc. or its affiliates. AWS Fargate でアプリケーションのより⾼速なスケーリングが可能に • ECSサービス § 毎分最⼤500タスク § 昨年⽐16倍 • Fargate キャパシティのレート § 1秒あたり20タスク § EKS、RunTask などに影響 • 段階的な改善の結果 6 https://aws.amazon.com/jp/blogs/news/under-the-hood-amazon-elastic-container-service-and- aws-fargate-increase-task-launch-rates/ 2022/4/13 AWS Fargate ECS タスク

Slide 7

Slide 7 text

© 2022, Amazon Web Services, Inc. or its affiliates. AWS Fargate でアプリケーションのより⾼速なスケーリングが可能に 7 Fargate のキャパシティレートは ECS Service, RunTask, AWS Batch, EKS に影響

Slide 8

Slide 8 text

© 2022, Amazon Web Services, Inc. or its affiliates. Amazon ECS on Fargate で AWS Graviton2 が利⽤可能に • 最⼤40%のコストパフォーマンス向上 • armのイメージ構築をする必要あり • AWS CodeBuild 、 buildx、 M1 Mac 8 2021/11/23 https://aws.amazon.com/jp/about-aws/whats- new/2021/11/aws-fargate-amazon-ecs-aws- graviton2-processors/

Slide 9

Slide 9 text

© 2022, Amazon Web Services, Inc. or its affiliates. Amazon ECS Anywhere (外部インスタンス) • 2021/10/8 GPU ベースのワークロードを サポート § https://aws.amazon.com/jp/about-aws/whats- new/2021/10/amazon-ecs-anywhere-gpu/ • 2022/1/24 ECS Exec サポート § https://aws.amazon.com/jp/about-aws/whats- new/2022/01/amazon-ecs-exec-linux-2- container-workloads/ • 2022/3/14 Windows サポート § https://aws.amazon.com/jp/about-aws/whats- new/2022/03/amazon-ecs-on-premises- orchestration-windows/ 9

Slide 10

Slide 10 text

© 2022, Amazon Web Services, Inc. or its affiliates. Windows サポート • 2021/10/28 Fargate 起動タイプ § https://aws.amazon.com/jp/about-aws/whats-new/2021/10/aws-fargate- amazon-ecs-windows-containers/ • 2021/11/22 ECS Exec サポート § https://aws.amazon.com/jp/about-aws/whats-new/2021/11/amazon-ecs- windows-supports-ecs-exec/ 10

Slide 11

Slide 11 text

© 2022, Amazon Web Services, Inc. or its affiliates. © 2022, Amazon Web Services, Inc. or its affiliates. 11 Amazon EKS / Kubernetes

Slide 12

Slide 12 text

© 2022, Amazon Web Services, Inc. or its affiliates. AWS が オープンソースで開発して いるKubernetesの クラスターオートスケーラー 12 Karpenter GA Just-in-time Nodes for Any Kubernetes Cluster Pending pods Karpenter X 2021/11/29

Slide 13

Slide 13 text

© 2022, Amazon Web Services, Inc. or its affiliates. Kubernetes Cluster Autoscaler 13 Node Group 1 4vCPUs 16 GB Spot Pending pods Node Group 2 8vCPUs 32 GB Spot Cluster Autoscaler Expander 新規ノード 10 sec Node Group 3 8vCPUs 32 GB On Demand • 事前にノードグループを 定義 • Podが起動できるノード グループを選択して スケールアウト • Podの要件毎に ノードグループを⽤意 • Expander により 選択ロジックを調整 ...

Slide 14

Slide 14 text

© 2022, Amazon Web Services, Inc. or its affiliates. Karpenter 14 Pending pods Karpenter • Pending している Pod の 仕様をみて、動的にイン スタンスを起動 • リソース • Topology, Affinity • Persistent Volume • GPU • EC2 Fleet APIを使⽤ • 事前に Pod の仕様を予測 して静的にノードグルー プを⽤意する必要がない Default: 全インスタンスタイプ (metal 除く) or instanceTypes: [m5.large, m5.2xlarge, …] 10 sec 新規ノード

Slide 15

Slide 15 text

© 2022, Amazon Web Services, Inc. or its affiliates. スケーリングの⾼速化 15 Application Scheduler/HPA Pending Pods CA ASG EC2 API EC2 Fleet (Instance) Karpenter EC2 fleet (instant) を直接利⽤ Node を 直接登録、 Pod に Node を直接アサイン https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instant-fleet.html

Slide 16

Slide 16 text

© 2022, Amazon Web Services, Inc. or its affiliates. ユースケース: 緩いマルチテナント環境 16 • 同じ組織内の複数チームでクラスターを 共有するような例 • 様々なワークロードが様々な条件で コンピューティングリソースを要求する • キャパシティーの使⽤率を⾼め クラスターを効率的に利⽤したい

Slide 17

Slide 17 text

© 2022, Amazon Web Services, Inc. or its affiliates. ユースケース: 機械学習ワークロード 17 • 迅速に実験を繰り返し、その度に アクセラレーターを備えた多くの インスタンスを⽴ち上げる • キャパシティーの準備が遅くなる とその分、イノベーションの速度 が落ちる • スケールインが遅いとコストに ⼤きく影響

Slide 18

Slide 18 text

© 2022, Amazon Web Services, Inc. or its affiliates. Amazon EKS の IPv6 サポート 18 2022/1/6 https://aws.amazon.com/jp/about-aws/whats-new/2022/01/amazon-eks-ipv6/ • EKS で IPv6 のクラスターを作成可能に • Pod / Service は IPv6 のみ • IPv6 は VPC の IPv6 CIDR から VPC CNI Plugin に よって割り当てられる • IP枯渇のリスクがない • 外部からの通信はAWS Loadbalancer Controller により実現 • ALB / NLBのデュアルスタックモードでIPv4 の接続をIPv6のPodに転送 • in-tree の Service Controller は IPv6 未対応

Slide 19

Slide 19 text

© 2022, Amazon Web Services, Inc. or its affiliates. Amazon EKS on Fargate 監視関連 19 • 2021/11/10 Amazon EKS on AWS Fargate が Fluent Bit Kubernetes Filter のサポートを 開始 § https://aws.amazon.com/jp/about-aws/whats- new/2021/11/amazon-eks-aws-fargate-supports- fluent-bit-kubernetes-filter/ • 2022/2/17 Amazon CloudWatch Container Insights が EKS on Fargate をサポート (AWS Distro for OpenTelemetry を利⽤) § https://aws.amazon.com/jp/about-aws/whats- new/2022/02/amazon-cloudwatch-eks-fargate- distro-opentelemetry/

Slide 20

Slide 20 text

© 2022, Amazon Web Services, Inc. or its affiliates. Kubernetes protection in Amazon GuardDuty 20 GuardDuty で機能を有効化するだけで利⽤可能 EKS 監査ログは ネイティブな連携でキャプチャ 検知対象の脅威例 現在、以下を初めとした27項⽬ • 特権コンテナ起動 • kube-system 内 Pod で exec • 既知の不正IP からSecretsを取得 • ⼿動で脅威リストに登録したIPからSecretsを取得 • TorからKubernetes APIにアクセス • ホストの/etcとかをマウントしたPodを起動 • default サービスアカウントにadminアクセス付与 • etc. https://docs.aws.amazon.com/guardduty/latest/ug/guardduty _finding-types-kubernetes.html 2022/1/26 Amazon EKS の監査ログを利⽤してアクティビティの脅威を検出する

Slide 21

Slide 21 text

© 2022, Amazon Web Services, Inc. or its affiliates. Amazon EKS & Bottlerocket 21 • コンテナをホスティングするために特別に設計された、 フリーでオープンソースの Linux ベースのOS • セキュリティとメンテナンス性が第⼀級の設計原則 • ECS / EKS 双⽅でネイティブサポート • 2021/10/28 マネージド型ノードグループでネイティブサポート § https://aws.amazon.com/jp/about-aws/whats-new/2021/10/aws-fargate- amazon-ecs-windows-containers/ • 2022/4/15 NVIDIA GPU サポート § https://aws.amazon.com/jp/blogs/news/bottlerocket-support-for-nvidia- gpus/

Slide 22

Slide 22 text

© 2022, Amazon Web Services, Inc. or its affiliates. © 2022, Amazon Web Services, Inc. or its affiliates. 22 Amazon ECR

Slide 23

Slide 23 text

© 2022, Amazon Web Services, Inc. or its affiliates. Amazon ECR Enhanced Scanning 23 • OS とプログラミングライブラリ両⽅の 脆弱性を検出 • basic scanning では、OS パッケージ の脆弱性のみ • C#、Golang、Java、Javascript、PHP、 Python、Ruby、Rust • push 時のスキャン / 継続的なスキャン • 新しい脆弱性が発⾒されると、⾃動的 に再スキャン • 東京リージョンで利⽤可能 (⼤阪リージョンは未サポート) 2021/11/29 Amazon Inspector との統合でイメージの継続的、かつ⾼度な脆弱性の検出を実現 https://aws.amazon.com/about-aws/whats-new/2021/11/amazon- inspector-continual-vulnerability-management/ イメージのビルド レジストリ (Amazon ECR) オーケストレータ Amazon Inspector 脆弱性スキャン イメージ利⽤

Slide 24

Slide 24 text

© 2022, Amazon Web Services, Inc. or its affiliates. Amazon ECR Enhanced Scanning 24 ECR または Inspector の画⾯で脆弱性を確認

Slide 25

Slide 25 text

© 2022, Amazon Web Services, Inc. or its affiliates. Amazon ECR Pull Through Cache Repository 25 • パブリックレジストリのイメージを ECR Private でキャッシュ可能に Ø ECR の⾼い可⽤性、ダウンロード速度を利⽤可能 Ø AWS PrivateLink を⽤いて、プライベートネットワークを実現 Ø KMS 暗号化、クロスリージョンレプリケーション • リモートレジストリと⾃動同期 Ø 最⼤ 24 時間に 1 回まで • 現在は、ECR Public と Quay.io をサポート • すべての商⽤リージョンで利⽤可能 2021/11/29

Slide 26

Slide 26 text

© 2022, Amazon Web Services, Inc. or its affiliates. © 2022, Amazon Web Services, Inc. or its affiliates. 26 AWS App Runner

Slide 27

Slide 27 text

© 2022, Amazon Web Services, Inc. or its affiliates. AWS App Runner 27 Source code repository Build container with existing tooling Push container image to ECR Development Teams Build application with App Runner Deploy application or Secure Service URL Clients HTTP Requests Web アプリケーション⽤のフルマネージドサービス

Slide 28

Slide 28 text

© 2022, Amazon Web Services, Inc. or its affiliates. AWS App Runner の VPC サポート 28 • 以前は、App Runner で稼働する コンテナから お客様の VPC にプライベート接続できなかった • DynamoDB や S3 などの利⽤が前提 • VPCサポートにより、コンテナから VPC に接続 できるように • Aurora、ElastiCashe など、様々なサービス に接続可能 ネットワーク (VPC) App Runner コンテナインスタンス S3 DynamoDB Private subnet Customer VPC Aurora 2022/2/9