GKE on AWS에서 워크로드를 확장하려면 AWSNodePools를 자동으로 확장하도록 구성하거나 수동으로 AWSNodePool을 만들고 삭제하여 확장 또는 축소할 수 있습니다.
클러스터 자동 확장 처리
GKE on AWS는 Kubernetes 클러스터 자동 확장 처리를 구현합니다.
노드 수요가 높으면 클러스터 자동 확장 처리가 노드 풀에 노드를 추가합니다. 노드 수요가 낮으면 클러스터 자동 확장 처리가 지정된 최소 크기로 축소 조정합니다. 이를 통해 필요한 경우 워크로드의 가용성을 높이고 비용을 관리할 수 있습니다.
개요
클러스터 자동 확장 처리는 워크로드 수요를 기준으로 지정된 노드 풀에서 노드 수 크기를 자동으로 조정합니다. 수동으로 노드를 추가, 제거하거나 노드 풀을 과도하게 프로비저닝할 필요가 없습니다. 대신 노드 풀의 최소 및 최대 크기를 지정하면 클러스터는 자동으로 확장됩니다.
클러스터를 자동 확장하는 동안 리소스가 삭제되거나 이동되면 워크로드가 일시적으로 중단될 수 있습니다. 예를 들어 워크로드가 단일 복제본으로 구성되었으면, 현재 노드가 삭제된 경우 해당 복제본의 포드를 다른 노드에서 다시 예약할 수 있습니다. AWSNodePool에서 클러스터 자동 확장 처리를 사용 설정하기 전에 워크로드가 잠재적인 중단을 견디도록 설계하거나 중요한 포드가 중단되지 않는지 확인합니다.
클러스터 자동 확장 처리 작동 방식
클러스터 자동 확장 처리는 노드당 풀 기준으로 작동합니다. 노드 풀을 만들 때는 AWSNodePool Kubernetes 리소스에서 노드 풀에 대해 최소 및 최대 크기를 지정합니다.
spec.minNodeCount를 AWSNodePool의 동일한 spec.maxNodeCount로 설정하여 클러스터 자동 확장 처리를 사용 중지할 수 있습니다.
클러스터 자동 확장 처리는 실제 리소스 사용률 대신 노드 풀의 노드에서 실행되는 포드의 리소스 요청에 따라 자동으로 노드 풀의 크기를 늘리거나 줄입니다. 주기적으로 포드 및 노드의 상태를 확인하고 작업을 수행합니다.
노드 풀에 노드가 충분하지 않아 포드를 예약할 수 없는 경우 클러스터 자동 확장 처리가 노드 풀의 최대 크기까지 노드를 추가합니다. 노드의 사용률이 적고 노드 풀에 있는 노드 수가 적은 상태에서도 모든 포드를 예약할 수 있는 경우 클러스터 자동 확장 처리는 노드를 제거하고 노드 풀의 최소 크기까지 축소합니다. 노드가 제한 시간(10분) 후에 정상적으로 유출되지 않으면 노드가 강제로 종료됩니다. 유예 기간은 구성할 수 없습니다.
포드가 너무 적은 리소스를 요청한 경우(예: 기본값이 부족한 경우) 클러스터 자동 확장 처리는 이러한 상황을 해결하지 않습니다. 모든 워크로드에 적절한 리소스 요청을 만들어서 클러스터 자동 확장 처리가 가능한 한 정확하게 작동하도록 보장할 수 있습니다.
작동 조건
클러스터 자동 확장 처리는 노드 풀 크기를 조절할 때 다음 가정을 따릅니다.
복제된 모든 포드를 다른 일부 노드에서 다시 시작할 수 있으며, 결과적으로 일시적인 중단이 발생할 수 있습니다. 서비스에 중단이 허용되지 않는 경우에는 클러스터 자동 확장 처리를 사용하지 않는 것이 좋습니다.
단일 노드 풀의 모든 노드에 동일한 라벨 집합이 포함됩니다.
다른 인스턴스 유형의 AWSNodePool이 있는 경우, 클러스터 자동 확장 처리는 새 노드 실행에 대한 상대적 비용을 고려하고 비용이 가장 적은 노드 풀을 확장하려고 시도합니다.
최초 클러스터 또는 노드 풀 생성 이후 수동으로 추가된 라벨은 추적되지 않습니다. 클러스터 자동 확장 처리로 생성되는 노드에는 노드 풀 생성 시 --node-labels로 지정된 라벨이 할당됩니다.
노드 풀 크기 조정
AWSNodePool에는 minNodeCount 및 maxNodeCount 필드가 포함됩니다. 이러한 필드는 풀에서 워커 노드의 최소 및 최대 개수를 선언합니다. 이러한 값은 AWSNodePool을 만들기 전이나 후에 수정할 수 있습니다.
시작하기 전에
사용자 클러스터 만들기의 안내에 따라 클러스터를 프로비저닝합니다. 클러스터를 만드는 YAML 파일(예: cluster-0.yaml)을 준비합니다.
자동 노드 풀 확장 사용 설정
anthos-aws 디렉터리에서 anthos-gke를 사용하여 컨텍스트를 관리 서비스로 전환합니다.
cd anthos-aws
anthos-gke aws management get-credentials
클러스터 자동 확장 처리를 사용 설정하려면 AWSNodePool에 대해 매니페스트를 수정합니다. cluster-0.yaml 파일을 수정하고 AWSNodePool 섹션을 찾습니다. spec.minNodeCount 및 spec.maxNodeCount의 값을 변경합니다.
아래 예시에서는 이 노드 풀의 최소 크기를 3 노드로 유지하지만, 클러스터 자동 확장 처리가 크기를 10 노드로 늘릴 수 있도록 사용 설정합니다.
[[["이해하기 쉬움","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-07-29(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)."]]