こんにちは、クラウド事業部の山路です。少し前にAmazon EKS Managed node groupの新しい更新戦略がリリースされていることに気づいたので、今回はこちらの調査と検証を行いました。
Amazon EKS managed node groupの更新戦略の比較
2025年1月末のアップデートにより、Amazon EKS managed node groupの更新戦略に Minimal
が追加されました。
従来の Default
戦略では、更新フェーズの初期段階で新規バージョンのNodeを作成し、その後に旧バージョンのNodeを削除する工程を繰り返します。新しい Minimal
戦略では新規バージョンNodeを作成するのが旧バージョンNodeの削除後に変わります。 Minimal
戦略では更新プロセス中にNode数が増加することがなく、 Default
戦略と比べて起動するNode数がより少なくなります。
Minimal
戦略が適するユースケースとしては、以下のような例が案内されています。
- 需要の高いインスタンスタイプを利用している場合: AWSでは需要の高いインスタンスタイプが一時的に利用できない場合があります。
Default
戦略は最初にDesired SizeまでNode数を増加させるので、この時にインスタンスを確保できない可能性があります。 - GPUインスタンスを利用する場合: GPUインスタンスは利用時に申請が必要であり、利用可能な上限数が決まっています。
Default
戦略では起動数上限を超過した時にインスタンスを作成できません。 - Reserved Instances (RI) を利用する場合: RIはあらかじめ申請したインスタンス数を超える場合、通常料金が適用されます。
Default
戦略の場合、余分なコストが発生する可能性があります。
ただしAWSドキュメントでは、更新時の可用性の観点から、ほとんどのユースケースでは従来の Default
戦略が適する、と案内しています。
参考までに、2つの戦略の更新時の流れを図にしてみました。
2つの更新戦略の違いを検証してみる
ここからは実際に更新作業を行い、どのように更新されるかを見ていきます。
作業開始前にEKSクラスターを作成しておきます。今回はEKSバージョンの 1.30
から 1.31
の更新を Default
戦略、 1.31
から1.32
への更新を Minimal
戦略で行います。なお今回はAWSマネジメントコンソールから更新作業を行いました。
# 検証前 ~ $ kubectl version Client Version: v1.32.0-eks-5ca49cb Kustomize Version: v5.5.0 Server Version: v1.30.11-eks-bcf3d70 WARNING: version difference between client (1.32) and server (1.30) exceeds the supported minor version skew of +/-1 ~ $ kubectl get nodes NAME STATUS ROLES AGE VERSION ip-192-168-122-16.ap-northeast-1.compute.internal Ready <none> 71m v1.30.9-eks-5d632ec 192.168.122.16 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-184-202.ap-northeast-1.compute.internal Ready <none> 71m v1.30.9-eks-5d632ec 192.168.184.202 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27
Default戦略
最初に Default
戦略を見ていきます。ここでは最初にControl Planeを 1.31
に更新し、その後Managed node groupの更新を実行します。
Default
戦略での更新の流れは以下のようになりました。今回は比較のためにログを取っただけなので、折りたたんで表示しています。
Default戦略時のManaged node group更新ログ
# Managed node group更新開始前 ~ $ kubectl version Client Version: v1.32.0-eks-5ca49cb Kustomize Version: v5.5.0 Server Version: v1.31.7-eks-bcf3d70 ~ $ kubectl get nodes -owide NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME ip-192-168-122-16.ap-northeast-1.compute.internal Ready <none> 83m v1.30.9-eks-5d632ec 192.168.122.16 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-184-202.ap-northeast-1.compute.internal Ready <none> 83m v1.30.9-eks-5d632ec 192.168.184.202 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 # 更新開始 ### 新規Node作成 ~ $ kubectl get nodes -owide -w ip-192-168-174-34.ap-northeast-1.compute.internal NotReady <none> 0s v1.31.5-eks-5d632ec 192.168.174.34 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-113-10.ap-northeast-1.compute.internal NotReady <none> 0s v1.31.5-eks-5d632ec 192.168.113.10 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-174-34.ap-northeast-1.compute.internal Ready <none> 15s v1.31.5-eks-5d632ec 192.168.174.34 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-113-10.ap-northeast-1.compute.internal Ready <none> 15s v1.31.5-eks-5d632ec 192.168.113.10 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ### 旧NodeからのPod退避とSchedulingDisabled ip-192-168-174-34.ap-northeast-1.compute.internal Ready <none> 61s v1.31.5-eks-5d632ec 192.168.174.34 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-122-16.ap-northeast-1.compute.internal Ready,SchedulingDisabled <none> 92m v1.30.9-eks-5d632ec 192.168.122.16 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-184-202.ap-northeast-1.compute.internal Ready,SchedulingDisabled <none> 92m v1.30.9-eks-5d632ec 192.168.184.202 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-113-10.ap-northeast-1.compute.internal Ready <none> 2m3s v1.31.5-eks-5d632ec 192.168.113.10 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ### 旧Node削除 ip-192-168-122-16.ap-northeast-1.compute.internal NotReady,SchedulingDisabled <none> 95m v1.30.9-eks-5d632ec 192.168.122.16 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-184-202.ap-northeast-1.compute.internal NotReady,SchedulingDisabled <none> 97m v1.30.9-eks-5d632ec 192.168.184.202 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 # 更新後 ~ $ kubectl get nodes -owide ip-192-168-113-10.ap-northeast-1.compute.internal Ready <none> 7m59s v1.31.5-eks-5d632ec 192.168.113.10 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-174-34.ap-northeast-1.compute.internal Ready <none> 8m v1.31.5-eks-5d632ec 192.168.174.34 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27
なお、ここで新規バージョンのNodeが2つ作成されているのは、こちらのドキュメントにあるように、ASGの配置されたAZの2倍の分だけ作成されたからです。
It increments the Auto Scaling Group’s maximum size and desired size by the larger of either:
- Up to twice the number of Availability Zones that the Auto Scaling Group is deployed in.
- The maximum unavailable of upgrade.
Minimal戦略
次に Minimal
戦略の場合です。Managed node groupの更新戦略はNode groupの編集画面から変更できるので、事前にこちらを変更しておきます。
上記修正後、Control Planeを 1.32
に更新してからManaged node groupの更新を行い、挙動を追いかけます。
Minimal
戦略での更新の流れは以下のようになりました。
# Managed node group更新開始前 ~ $ kubectl version Client Version: v1.32.0-eks-5ca49cb Kustomize Version: v5.5.0 Server Version: v1.32.3-eks-bcf3d70 ~ $ kubectl get nodes -owide NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME ip-192-168-113-10.ap-northeast-1.compute.internal Ready <none> 19m v1.31.5-eks-5d632ec 192.168.113.10 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-174-34.ap-northeast-1.compute.internal Ready <none> 19m v1.31.5-eks-5d632ec 192.168.174.34 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 # 更新開始 ### 旧NodeからのPod退避とSchedulingDisabled ip-192-168-174-34.ap-northeast-1.compute.internal Ready,SchedulingDisabled <none> 26m v1.31.5-eks-5d632ec 192.168.174.34 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-113-10.ap-northeast-1.compute.internal Ready,SchedulingDisabled <none> 26m v1.31.5-eks-5d632ec 192.168.113.10 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ### 旧Node削除、新Node作成 ##### 1セット目 ip-192-168-113-10.ap-northeast-1.compute.internal Ready,SchedulingDisabled <none> 27m v1.31.5-eks-5d632ec 192.168.113.10 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-113-10.ap-northeast-1.compute.internal Ready,SchedulingDisabled <none> 28m v1.31.5-eks-5d632ec 192.168.113.10 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-101-57.ap-northeast-1.compute.internal NotReady <none> 0s v1.32.1-eks-5d632ec 192.168.101.57 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-101-57.ap-northeast-1.compute.internal NotReady <none> 0s v1.32.1-eks-5d632ec 192.168.101.57 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-101-57.ap-northeast-1.compute.internal NotReady <none> 0s v1.32.1-eks-5d632ec 192.168.101.57 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-101-57.ap-northeast-1.compute.internal NotReady <none> 0s v1.32.1-eks-5d632ec 192.168.101.57 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-101-57.ap-northeast-1.compute.internal NotReady <none> 0s v1.32.1-eks-5d632ec 192.168.101.57 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-101-57.ap-northeast-1.compute.internal NotReady <none> 2s v1.32.1-eks-5d632ec 192.168.101.57 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-101-57.ap-northeast-1.compute.internal NotReady <none> 10s v1.32.1-eks-5d632ec 192.168.101.57 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-101-57.ap-northeast-1.compute.internal NotReady <none> 13s v1.32.1-eks-5d632ec 192.168.101.57 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-101-57.ap-northeast-1.compute.internal Ready <none> 15s v1.32.1-eks-5d632ec 192.168.101.57 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-101-57.ap-northeast-1.compute.internal Ready <none> 15s v1.32.1-eks-5d632ec 192.168.101.57 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-113-10.ap-northeast-1.compute.internal NotReady,SchedulingDisabled <none> 30m v1.31.5-eks-5d632ec 192.168.113.10 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-101-57.ap-northeast-1.compute.internal Ready <none> 17s v1.32.1-eks-5d632ec 192.168.101.57 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-113-10.ap-northeast-1.compute.internal NotReady,SchedulingDisabled <none> 30m v1.31.5-eks-5d632ec 192.168.113.10 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-113-10.ap-northeast-1.compute.internal NotReady,SchedulingDisabled <none> 30m v1.31.5-eks-5d632ec 192.168.113.10 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-101-57.ap-northeast-1.compute.internal Ready <none> 30s v1.32.1-eks-5d632ec 192.168.101.57 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-113-10.ap-northeast-1.compute.internal NotReady,SchedulingDisabled <none> 30m v1.31.5-eks-5d632ec 192.168.113.10 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ##### 2セット目 ip-192-168-174-34.ap-northeast-1.compute.internal Ready,SchedulingDisabled <none> 31m v1.31.5-eks-5d632ec 192.168.174.34 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-174-34.ap-northeast-1.compute.internal Ready,SchedulingDisabled <none> 31m v1.31.5-eks-5d632ec 192.168.174.34 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-181-59.ap-northeast-1.compute.internal NotReady <none> 0s v1.32.1-eks-5d632ec 192.168.181.59 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-181-59.ap-northeast-1.compute.internal NotReady <none> 0s v1.32.1-eks-5d632ec 192.168.181.59 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-181-59.ap-northeast-1.compute.internal NotReady <none> 0s v1.32.1-eks-5d632ec 192.168.181.59 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-181-59.ap-northeast-1.compute.internal NotReady <none> 0s v1.32.1-eks-5d632ec 192.168.181.59 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-181-59.ap-northeast-1.compute.internal NotReady <none> 0s v1.32.1-eks-5d632ec 192.168.181.59 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-181-59.ap-northeast-1.compute.internal NotReady <none> 0s v1.32.1-eks-5d632ec 192.168.181.59 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-181-59.ap-northeast-1.compute.internal NotReady <none> 4s v1.32.1-eks-5d632ec 192.168.181.59 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-181-59.ap-northeast-1.compute.internal NotReady <none> 10s v1.32.1-eks-5d632ec 192.168.181.59 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-181-59.ap-northeast-1.compute.internal NotReady <none> 11s v1.32.1-eks-5d632ec 192.168.181.59 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-174-34.ap-northeast-1.compute.internal NotReady,SchedulingDisabled <none> 33m v1.31.5-eks-5d632ec 192.168.174.34 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-174-34.ap-northeast-1.compute.internal NotReady,SchedulingDisabled <none> 33m v1.31.5-eks-5d632ec 192.168.174.34 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-181-59.ap-northeast-1.compute.internal Ready <none> 15s v1.32.1-eks-5d632ec 192.168.181.59 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-181-59.ap-northeast-1.compute.internal Ready <none> 15s v1.32.1-eks-5d632ec 192.168.181.59 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-181-59.ap-northeast-1.compute.internal Ready <none> 19s v1.32.1-eks-5d632ec 192.168.181.59 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-174-34.ap-northeast-1.compute.internal NotReady,SchedulingDisabled <none> 33m v1.31.5-eks-5d632ec 192.168.174.34 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 # 更新後 ip-192-168-101-57.ap-northeast-1.compute.internal Ready <none> 4m56s v1.32.1-eks-5d632ec 192.168.101.57 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27 ip-192-168-181-59.ap-northeast-1.compute.internal Ready <none> 98s v1.32.1-eks-5d632ec 192.168.181.59 <none> Amazon Linux 2 5.10.234-225.921.amzn2.x86_64 containerd://1.7.27
ログだけ見ると新規Nodeが作られてから旧Nodeが削除される順番で更新されているように見えるのですが、どうなんでしょう。ログはほぼ並行して出力されたので挙動自体は正しそうですが、詳細は追いかけられませんでした。
さいごに
APCはAWS Advanced Tier Services(アドバンストティアサービスパートナー)認定を受けております。
その中で私達クラウド事業部はAWSなどのクラウド技術を活用したSI/SESのご支援をしております。
https://www.ap-com.co.jp/service/utilize-aws/
また、一緒に働いていただける仲間も募集中です!
今年もまだまだ組織規模拡大中なので、ご興味持っていただけましたらぜひお声がけください。