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

AWS EKSでClusterAutoscalerを使うときはNodeGroupの分け方に気をつけろ!

Morix
July 19, 2023

AWS EKSでClusterAutoscalerを使うときはNodeGroupの分け方に気をつけろ!

AWS EKSでClusterAutoscalerを使うときはNodeGroupをうまくわけないと
Nodeを増やすときにうまくバランシングしてくれないときがあります。
その仕組と対策を解説しています。

Morix

July 19, 2023
Tweet

More Decks by Morix

Other Decks in Technology

Transcript

  1. 2 ⾃⼰紹介 • 名前 • ⻄野 翔太 • 所属 •

    楽天グループ株式会社 • ラクマ開発課 SREチーム • Twitter • @morix1500
  2. 10 うまくいかないパターン あるアプリケーションのPodのTopologySpreadConstraintsをZone分散してるとき、 aとcゾーンにPodを配置してる場合は、次はdゾーンにPodを配置したい。けど空きがないのでNodeを増やす 必要がある。 CA NodeGroup1 Node1 AZ: a

    c5.large Node2 AZ: c c5a.large NodeGroup2 Node3 AZ: d c5.large Node4 AZ: c c5a.large NodeGroup1: AZ=a InstanceType: c5.large NodeGroup2: AZ=c InstanceType: c5a.large Pod Pod Pod もうPod置けません︕ dに ⾏きたい
  3. 11 うまくいかないパターン この場合CAは、NodeGroup1はaゾーン、NodeGroup2はcゾーンとみなすので dゾーンのNodeGroupは存在しないものと⾒てスケールアウトをしない。 CA NodeGroup1 Node1 AZ: a c5.large

    Node2 AZ: c c5a.large NodeGroup2 Node3 AZ: d c5.large Node4 AZ: c c5a.large NodeGroup1: AZ=a NodeGroup2: AZ=c dないじゃん︕うーん、むり︕ Pod Pod Pod そんなー
  4. 13 NodeGroupを増やしすぎるとスケールアウトの速度に影響が出る可能性がある Reducing the number of Node Groups Minimizing the

    number of node groups is one way to ensure that the Cluster Autoscaler will continue to perform well on large clusters. This may be challenging for some organizations who structure their node groups per team or per application. While this is fully supported by the Kubernetes API, this is considered to be a Cluster Autoscaler anti-pattern with repercussions for scalability. There are many reasons to use multiple node groups (e.g. Spot or GPUs), but in many cases there are alternative designs that achieve the same effect while using a small number of groups. ノードグループの数を減らす ノードグループの数を最⼩限に抑えることは、⼤規模なクラスタでもCluster Autoscalerのパフォーマンスを維 持できるようにする1つの⽅法です。これは、チームごとまたはアプリケーションごとにノードグループを構成 する組織によっては難しいかもしれません。これはKubernetes APIによって完全にサポートされていますが、 スケーラビリティに影響を与えるCluster Autoscalerのアンチパターンと考えられています。複数のノードグ ループ(SpotやGPUなど)を使⽤する理由はたくさんありますが、多くの場合、少数のグループを使⽤しなが ら同じ効果を達成する代替設計があります。 引⽤元: https://aws.github.io/aws-eks-best-practices/cluster-autoscaling/#reducing-the-number-of-node-groups
  5. 18 うまくバランシングしてくれないケース NodeGroup1の数を増やす選択をした場合、似ているNodeGroupを探すがInstanceTypeが同⼀なNodeGroupは 存在しないため、NodeGroup1で4台起動してしまう。 CA NodeGroup1 Node1 AZ: a c5.large

    Node2 AZ: c c5a.large NodeGroup2 Node3 AZ: d c5.large Node4 AZ: c c5a.large NodeGroup1: InstanceType: c5.large NodeGroup2: InstanceType: c5a.large NodeGroup1と⼀致するラベルを 持つNodeGroupはいない︕