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

Cost Optimization using KEDA/Graviton

Avatar for kenicazu kenicazu
May 09, 2026
5

Cost Optimization using KEDA/Graviton

Avatar for kenicazu

kenicazu

May 09, 2026

Transcript

  1. © 2024, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 2025/1/15 Kenichi Azuma Introduction to KEDA (Kubernetes Event-driven Autoscaling) and Cost Optimization using KEDA/Graviton 1 17:05〜
  2. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. KEDAの概要について 2
  3. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Podのスケーリングについて 3 © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved. Kuberenetes におけるオートスケーリングの種類 1. Horizontal Pod Autoscaling (HPA) 2. Vertical Pod Autoscaling (VPA) 3. Cluster Autoscaler (CAS) or Karpenter 6 • Pod のオートスケーリング Metrics store HPA VPA Pending pods CAS X • Node のオートスケーリング or • Podのスケーリングをする際のk8s標準APIリソースはHPA
  4. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. KEDA - Kubernetes-based Event-Driven Autoscaling - • HPA より柔軟に Pod や Job のスケールが可能な軽量 OSS コン ポーネント • 内部的には HPA と連携することで上書きや重複なくシンプルに 機能提供 • 多数の外部メトリクスをサポート • ゼロスケール対応 • HPAではゼロスケールはAlpha版(1.16〜) • 詳細はこちら • カスタムリソースのマニフェストを記載することで設定が可能 4 https://keda.sh
  5. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. KEDA アーキテクチャ • Agent • Deployment を 0→1 / 1→ 0 にする • KEDA Operator により実現 • Metrics • KEDA ⾃⾝が Metrics Server としてふ るまう • KEDA がサポートする様々なメトリクス を HPA に公開可能 • keda-operator-metrics-apiserver に より実現 • Admission Webhook • マニフェストの構成ミスを防ぐ 5
  6. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. サポートするスケーラ 2.17(2025/6/15時点でLatest)では74のスケーラが利⽤可能 代表的なメトリクスは以下の通り ベーシック • CPU, memory, Cron AWS • CloudWatch • DynamoDB / DynamoDB Streams • Kinesis Streams • SQS Monitoring Tools • Prometheus • Datadog • NewRelic 6
  7. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. KEDAのセットアップについて 7
  8. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. EKS で KEDA のセットアップを⾏う⽅法 • Helm でのセットアップ(標準) • https://keda.sh/docs/2.17/deploy/ • EKS Blueprints • https://github.com/kedacore/charts/blob/main/keda/README.md • Terraform(ref), CDK(ref). ※内部的にはHelmでセットアップ 8 $ helm repo add kedacore https://kedacore.github.io/charts $ helm repo update $ helm install keda kedacore/keda --namespace keda --create-namespace module "eks_blueprints_kubernetes_addons" { source = "github.com/aws-ia/terraform-aws-eks-blueprints//modules/kubernetes-addons" eks_cluster_id = <EKS-CLUSTER-ID> # EKS Addons enable_keda = true
  9. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. ユースケース例 9
  10. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 外部メトリクスベースのスケール • 任意の外部メトリクスを⽤いてスケール • 例えばALB の CloudWatch メトリクス RequestCount をベースに KEDA でPod をスケール 10 Ingress Application Load Balancer Amazon CloudWatch AWS Load Balancer Controller
  11. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. CloudWatchにおけるメトリクス 11
  12. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. SQS キュー⻑ベースのゼロスケール • SQS 内のメッセージ数をベースに Pod をスケール • キューイング処理におけるコンシューマPodのスケールに有効 12 Amazon SQS
  13. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. SQS ApproximateNumberOfMessagesVisible 13
  14. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Podのスケジュールスケーリング(時間指定のスケーリング) • ユースケース • 特定の時間になれば Pod 数を指定数までスケールさせたい • HPAとバッティングしないようにしたい • KEDAのTriggerに cron と CPU 等複数のスケーラー設定が可能 14
  15. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. Podのスケジュールスケーリング(時間指定のスケーリング) 15
  16. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. 17 https://keda.sh/docs/2.17/reference/faq/ KEDA の ScaledObject と HPA を組み合わせて利⽤しない • KEDA が内部で作成した HPA と競合するリスクがある • 代替として、KEDA の CPU、メモリスケーラーを利⽤する 注意事項
  17. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. デモ • 1st Demo • KEDA/EKS AutoMode を⽤いて Prometheus のカスタムメトリクスでスケーリング • 2nd Demo • Graviton インスタンスを⽤いた性能・コスト⾯の⽐較 • 3rd Demo • Spot インスタンスを利⽤した設定のイメージ 19
  18. © 2026, Amazon Web Services, Inc. or its affiliates. All

    rights reserved. KEDA ScaledObjectの設定 21