クラスタの自動スケーリング時にリソースを削除または移動すると、ワークロードが一時的に中断することがあります。たとえば、ワークロードが 1 つのレプリカで構成されている場合、現在のノードを削除すると、レプリカの Pod は別のノードに再スケジュールされる可能性があります。AWSNodePool でクラスタ オートスケーラーを有効にする前に、一時的な中断が許容されるようにワークロードを設計するか、重要な Pod で割り込みが発生しないように設計してください。
クラスタ オートスケーラーは、実際のリソース使用率ではなく、ノードプールのノードで実行されている Pod のリソース リクエスト数に基づいて、ノードプールのサイズを自動的に調整します。Pod とノードのステータスを定期的にチェックし、次の処理を行います。
ノードプール内のノード数が不足しているために Pod のスケジューリングができない場合、クラスタ オートスケーラーはノードプールの最大サイズまでノードを追加します。ノードの使用率が低く、ノードプール内のノード数を少なくしてもすべての Pod のスケジューリングが可能な場合、クラスタ オートスケーラーはノードプールの最小サイズになるまでノードを削除します。ノードがタイムアウト後(10 分後)に正常にドレインされなかった場合、ノードは強制終了されます。猶予期間は指定できません。
Pod がリクエストするリソースが少なすぎる場合(たとえば、デフォルト値が過小な場合)、クラスタ オートスケーラーは状況を改善できません。クラスタ オートスケーラーが正常に動作するように、すべてのワークロードで適切なリソース リクエストを行う必要があります。
動作条件
クラスタ オートスケーラーは、次のことを前提としてノードプールのサイズを変更します。
複製対象のすべての Pod を、他のノードで再起動できるものとします。これにより、短い中断が発生する可能性があります。サービスの中断を許容できない場合、クラスタ オートスケーラーの使用はおすすめしません。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-08-30 UTC。"],[],[],null,["# Scaling user clusters\n\nTo scale your workloads on GKE on AWS, you can configure your\nAWSNodePools to automatically scale out, or manually create and\ndelete AWSNodePools to scale up or down.\n\nCluster Autoscaler\n------------------\n\nGKE on AWS implements the Kubernetes [Cluster Autoscaler](https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler).\nWhen demand on your nodes is high, Cluster Autoscaler adds nodes to the node\npool. When demand is low, Cluster Autoscaler scales back down to a minimum size\nthat you designate. This can increase the availability of your workloads when\nyou need it while controlling costs.\n\n### Overview\n\nCluster Autoscaler automatically resizes the number of nodes in a given node\npool, based on the demands your workloads. You don't need to manually add or\nremove nodes or over-provision your node pools. Instead, you specify a minimum\nand maximum size for the node pool, and the cluster scales automatically.\n\nIf resources are deleted or moved when autoscaling your cluster, your workloads\nmight experience transient disruption. For example, if your workload consists of\na single replica, that replica's Pod might be rescheduled onto a different node\nif its current node is deleted. Before enabling Cluster Autoscaler in your\nAWSNodePool, design your workloads to tolerate potential disruption or\nensure that critical Pods are not interrupted.\n| **Note:** For autoscaling to function correctly, GKE on AWS deploys the `metrics-server` Deployment with elevated [RBAC permissions](https://kubernetes.io/docs/reference/access-authn-authz/authorization/#determine-the-request-verb) to your nodes, such as the ability to patch and update itself. Additional components, such as `coredns` and `konnectivity-agent` have specific autoscalers with permissions to scale their component up or down depending on need.\n\n### How Cluster Autoscaler Works\n\nCluster Autoscaler works on a per-node pool basis. When you create a node pool,\nyou specify a minimum and maximum size for the node pool in the\n[AWSNodePool](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/reference/node-pools)\nKubernetes resource.\n\nYou can disable Cluster Autoscaler by setting `spec.minNodeCount`\nto equal `spec.maxNodeCount` on your AWSNodePools.\n\nCluster Autoscaler increases or decreases the size of the node pool\nautomatically, based on the resource requests (rather than actual resource\nutilization) of Pods running on that node pool's nodes. It periodically checks\nthe status of Pods and nodes, and takes action:\n\nIf Pods are unschedulable because there are not enough nodes in the node pool,\nCluster Autoscaler adds nodes, up to the maximum size of the node pool. If nodes\nare under-utilized, and all Pods could be scheduled even with fewer nodes in the\nnode pool, Cluster Autoscaler removes nodes, down to the minimum size of the\nnode pool. If the node cannot be drained gracefully after a timeout period\n(10 minutes), the node is forcibly terminated. The grace period is not\nconfigurable.\n\nIf your Pods have requested too few resources (for example, if the defaults are\ninsufficient), Cluster Autoscaler does not correct the situation. You can help\nensure Cluster Autoscaler works as accurately as possible by creating adequate\nresource requests for all of your workloads.\n\n### Operating Criteria\n\nCluster Autoscaler makes the following assumptions when resizing a node pool:\n\n- All replicated Pods can be restarted on some other node, possibly causing a\n brief disruption. If your services do not tolerate disruption, we don't\n recommend using Cluster Autoscaler.\n\n- All nodes in a single node pool have the same set of labels.\n\n- If you have AWSNodePools with different instance types, Cluster\n Autoscaler considers the relative cost of launching new nodes, and attempts\n to expand the least expensive node pool.\n\n- Labels manually added after initial cluster or node pool creation are not\n tracked. Nodes created by Cluster Autoscaler are assigned labels specified\n with --node-labels at the time of node pool creation.\n\nResize a Node Pool\n------------------\n\nAn [AWSNodePool](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/reference/node-pools) includes\n`minNodeCount` and `maxNodeCount` fields. These fields declare a minimum and\nmaximum number of worker nodes in the pool. You may edit these values before or\nafter the AWSNodePool is created.\n\n### Before you begin\n\nProvision a cluster using the instructions in\n[Creating a user cluster](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/how-to/creating-user-cluster). Have the\nYAML file (for example, `cluster-0.yaml`) that creates the cluster available.\n\n### Enabling automatic node pool scaling\n\n1. From your `anthos-aws` directory, use\n `anthos-gke` to switch context to your management service.\n\n ```sh\n cd anthos-aws\n anthos-gke aws management get-credentials\n ```\n | **Note:** `anthos-gke` uses the credentials you specified when you ran `aws configure`.\n\n \u003cbr /\u003e\n\n2. To enable the Cluster Autoscaler, you edit the manifest for your\n AWSNodePool. Edit the `cluster-0.yaml` file and find the\n AWSNodePool section. Change the values for `spec.minNodeCount` and\n `spec.maxNodeCount`.\n\n The example below keeps the minimum size of this node pool at `3` nodes, but\n enables the Cluster Autoscaler to increase its size to `10` nodes. \n\n apiVersion: multicloud.cluster.gke.io/v1\n kind: AWSNodePool\n metadata:\n name: cluster-0-pool-0\n spec:\n clusterName: cluster-0\n version: 1.25.5-gke.2100\n minNodeCount: 3\n maxNodeCount: 10\n ...\n\n3. Next, apply the YAML to resize the node pool.\n\n env HTTPS_PROXY=http://localhost:8118 \\\n kubectl apply -f cluster-0.yaml\n\n4. The AWSNodePool resource will transition into a `Resizing` state.\n When the AWSNodePool completes scaling, it moves to the `Provisioned`\n state.\n\n env HTTPS_PROXY=http://localhost:8118 \\\n kubectl get AWSNodePools\n\n The output shows that the AWSNodePool is `Resizing`. Resize operations\n take several minutes to complete. \n\n NAME CLUSTER STATE AGE VERSION\n cluster-0-pool-0 cluster-0 Resizing 3h 1.25.5-gke.2100\n\nManually creating a new AWSNodePool\n-----------------------------------\n\nYou can also scale your cluster by creating new AWSNodePools.\nWhen you create a new AWSNodePool, you can also scale up or down\n[instance sizes](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/reference/instance-types).\n\n1. You can retrieve the configuration manifest of an existing AWSNodePool with\n `kubectl get`.\n\n env HTTPS_PROXY=http://localhost:8118 \\\n kubectl get awsnodepool cluster-0-pool-0 -o yaml \u003e new_nodepool.yaml\n\n2. Edit `new_nodepool.yaml` and remove the sections that are not present in the\n following example. Save the file.\n\n ```yaml\n apiVersion: multicloud.cluster.gke.io/v1\n kind: AWSNodePool\n metadata:\n name: NODE_POOL_NAME\n spec:\n clusterName: AWSCLUSTER_NAME\n version: CLUSTER_VERSION # latest version is 1.25.5-gke.2100\n region: AWS_REGION\n subnetID: AWS_SUBNET_ID\n minNodeCount: MINIMUM_NODE_COUNT\n maxNodeCount: MAXIMUM_NODE_COUNT\n maxPodsPerNode: MAXIMUM_PODS_PER_NODE_COUNT\n instanceType: AWS_NODE_TYPE\n keyName: KMS_KEY_PAIR_NAME\n iamInstanceProfile: NODE_IAM_PROFILE\n proxySecretName: PROXY_SECRET_NAME\n rootVolume:\n sizeGiB: ROOT_VOLUME_SIZE\n volumeType: VOLUME_TYPE # Optional\n iops: IOPS # Optional\n kmsKeyARN: NODE_VOLUME_KEY # Optional \n ```\n3. To create a new AWSNodePool, apply the manifest to your management\n cluster.\n\n env HTTPS_PROXY=http://localhost:8118 \\\n kubectl apply -f new_nodepool.yaml\n\nWhat's next\n-----------\n\nDeploy a service backed by [Ingress](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/how-to/ingress).\n\nTo see additional options, read the reference documentation on\n[AWSNodePool](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/reference/node-pools)."]]