EKSのマネージド型ノードを並列更新

ノードを並列更新することで、マネージド型ノードグループの更新時間を短縮できるようなので試してみました。

docs.aws.amazon.com

It determines the maximum quantity of nodes to upgrade in parallel using the updateConfig property for the node group.

aws.amazon.com

Now, the amount of nodes that can be upgraded at a time is configurable, and clusters with applications that are more fault tolerant can benefit from reduced time to complete node group upgrades.

ノードグループの設定から「Node Group update configuration」で「Number」または「Percentage」に並列更新するノードの数または割合を設定します(ただし、並列更新できるのは最大で100ノード)。
今回はPercentageを100%とし、一度に全ノードを更新します。

docs.aws.amazon.com

eksctlのYAMLで管理する場合はこちらを参照してください。

managedNodeGroups:
...
    updateConfig:
      maxUnavailablePercentage: 100

設定変更後、試しにAMIを更新してみると、複数のノードが一度に更新される様子を確認できました。

❯ eksctl upgrade nodegroup \
   --name=<node-group-name> \
   --cluster=<cluster-name> \
   --region=<region>
...
❯ kubectl get nodes 
NAME                                                STATUS                     ROLES    AGE     VERSION
ip-192-168-14-112.ap-northeast-1.compute.internal   Ready                      <none>   3m34s   v1.24.15-eks-a5565ad
ip-192-168-18-140.ap-northeast-1.compute.internal   Ready,SchedulingDisabled   <none>   5d21h   v1.24.15-eks-a5565ad
ip-192-168-24-91.ap-northeast-1.compute.internal    Ready,SchedulingDisabled   <none>   5d21h   v1.24.15-eks-a5565ad
ip-192-168-27-53.ap-northeast-1.compute.internal    Ready                      <none>   3m31s   v1.24.15-eks-a5565ad
ip-192-168-32-111.ap-northeast-1.compute.internal   Ready                      <none>   3m34s   v1.24.15-eks-a5565ad
ip-192-168-44-222.ap-northeast-1.compute.internal   Ready                      <none>   3m29s   v1.24.15-eks-a5565ad
ip-192-168-45-236.ap-northeast-1.compute.internal   Ready,SchedulingDisabled   <none>   5d20h   v1.24.15-eks-a5565ad
ip-192-168-53-167.ap-northeast-1.compute.internal   Ready,SchedulingDisabled   <none>   5d21h   v1.24.15-eks-a5565ad
ip-192-168-64-207.ap-northeast-1.compute.internal   Ready                      <none>   3m34s   v1.24.15-eks-a5565ad
ip-192-168-83-46.ap-northeast-1.compute.internal    Ready                      <none>   3m27s   v1.24.15-eks-a5565ad
ip-192-168-88-250.ap-northeast-1.compute.internal   Ready,SchedulingDisabled   <none>   5d21h   v1.24.15-eks-a5565ad
ip-192-168-90-162.ap-northeast-1.compute.internal   Ready,SchedulingDisabled   <none>   5d20h   v1.24.15-eks-a5565ad

なお、スケールダウンは相変わらず1ノードずつ処理するので時間がかかるとのことです。

github.com