이 페이지에서는 수직형 포드 자동 확장을 사용하여 리소스 할당을 분석하고 최적화하여 Google Kubernetes Engine(GKE)에서 워크로드 효율성을 개선하는 방법을 설명합니다. 시간 경과에 따른 워크로드의 리소스 사용량을 분석하여 최적화 추천을 받고 CPU 및 메모리 요청과 포드 내 컨테이너에 대한 한도를 자동으로 조정할 수 있습니다.
이 페이지에서는 수직형 포드 자동 확장의 작동 방식, 이점 및 제한사항, 사용 권장사항을 알아보고 VerticalPodAutoscaler 커스텀 리소스 및 관련 유형의 API 참조에 액세스합니다.
이 페이지는 클라우드 리소스를 프로비저닝 및 구성하고, 워크로드를 배포하고, 애플리케이션 확장을 관리하는 운영자 및 개발자를 위해 작성되었습니다. 일반적인 역할에 대해 자세히 알아보려면 일반 GKE Enterprise 사용자 역할 및 태스크를 참조하세요.
수직형 포드 자동 확장을 사용하면 포드에 필요한 CPU 및 메모리 리소스를 분석하고 설정할 수 있습니다. 포드에서 컨테이너의 최신 CPU 요청 및 제한과 메모리 요청 및 제한을 설정할 필요 없이 수직형 포드 자동 확장을 구성하여 포드를 수동으로 업데이트하는 데 사용할 수 있는 CPU 및 메모리 요청과 한도의 권장 값을 제공하거나 수직형 포드 자동 확장을 구성하여 값을 자동으로 업데이트할 수 있습니다.
수직형 포드 자동 확장은 기본적으로 Autopilot 클러스터에서 사용 설정됩니다.
자동 모드의 수직형 pod 자동 확장
Kubernetes 제한사항에 따라 실행 중인 포드의 리소스 요청을 수정하는 유일한 방법은 포드를 다시 만드는 것입니다. updateMode가 Auto인 VerticalPodAutoscaler 객체를 만들면 VerticalPodAutoscaler는 포드의 리소스 요청을 변경해야 하는 경우 포드를 삭제합니다.
수직형 포드 자동 확장은 업데이트 전에 클러스터 자동 확장 처리에 업데이트를 알리며 워크로드를 다시 만들기 전에 크기가 조절된 워크로드에 필요한 리소스를 제공하여 중단 시간을 최소화합니다.
이점
수직형 포드 자동 확장은 다음과 같은 이점을 제공합니다.
워크로드에 적합한 리소스 요청 및 한도를 설정하면 안정성과 비용 효율성이 향상됩니다. 포드 리소스 크기가 워크로드에 필요한 것보다 작은 경우 애플리케이션이 제한되거나 메모리 부족 오류로 인해 실패할 수 있습니다. 리소스 크기가 너무 크면 낭비하게 되어 더 많은 비용이 청구됩니다.
포드가 필요한 만큼만 사용하기 때문에 클러스터 노드가 효율적으로 사용됩니다.
사용할 수 있는 적절한 리소스가 있는 노드에 포드가 예약됩니다.
CPU 및 메모리 요청의 정확한 값을 알아내기 위해 런타임을 소비하는 벤치마크 테스트를 실행할 필요가 없습니다.
시간이 지나면서 자동 확장 처리가 사용자 개입 없이 CPU 및 메모리 요청을 조정할 수 있기 때문에 유지보수 시간이 단축됩니다.
자동 확장 처리가 제어할 pod 집합을 관리하는 컨트롤러를 가리킵니다(예: 배포 또는 StatefulSet).
확장 하위 리소스가 있는 컨트롤러의 VerticalPodAutoscaler를 가리킬 수 있습니다. 일반적으로 VerticalPodAutoscaler는 컨트롤러의 ScaleStatus에서 pod 집합을 검색합니다. 일부 잘 알려진 컨트롤러(예: DaemonSet)의 경우, VerticalPodAutoscaler는 컨트롤러 사양에서 pod 집합을 검색합니다.
updatePolicy
PodUpdatePolicy
포드가 시작될 때 추천 업데이트가 적용되는지 여부와 포드의 수명 동안 추천 업데이트가 적용되는지 여부를 지정합니다.
resourcePolicy
PodResourcePolicy
개별 컨테이너의 CPU 및 메모리 요청을 조정하는 방법에 대한 정책을 지정합니다. 리소스 정책을 사용하면 개별 컨테이너의 추천에 제약조건을 설정할 수 있습니다. 지정되지 않은 경우 자동 확장 처리는 추가 제약 없이 포드의 모든 컨테이너에 대한 추천 리소스를 계산합니다.
recommenders
VerticalPodAutoscalerRecommenderSelector array
이 VPA 객체의 권장사항을 생성하는 추천자입니다. GKE에서 제공되는 기본 추천자를 사용하려면 비워 둡니다.
그렇지 않으면 사용자가 제공한 대체 추천자에 해당하는 정확히 하나의 항목이 목록에 포함될 수 있습니다.
GKE 1.22부터 지원됩니다.
컨테이너에 추천되는 최소 CPU 요청 및 메모리 요청. 이 양은 애플리케이션을 안정적으로 실행하는 데 충분하다는 것을 보장하지 않습니다. 더 적은 CPU 및 메모리 요청으로 실행하면 성능이나 가용성에 상당한 영향을 미칠 가능성이 높습니다.
upperBound
ResourceList
컨테이너에 추천되는 최대 CPU 요청 및 메모리 요청. 이 값보다 높은 CPU 및 메모리 요청은 낭비될 가능성이 높습니다.
uncappedTarget
ResourceList
자동 확장 처리에서 계산한 최근의 리소스 추천으로, ContainerResourcePolicy를 고려하지 않고 실제 리소스 사용량을 기준으로 계산한 것입니다. 실제 리소스 사용량으로 인해 대상이 ContainerResourcePolicy를 위반하게 되는 경우 제한된 추천과 다를 수 있습니다. 이 필드는 실제 리소스 할당에는 영향을 미치지 않습니다. 상태 표시 용도로만 사용됩니다.
[[["이해하기 쉬움","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-06-27(UTC)"],[],[],null,["# Vertical Pod autoscaling\n\n[Autopilot](/kubernetes-engine/docs/concepts/autopilot-overview) [Standard](/kubernetes-engine/docs/concepts/choose-cluster-mode)\n\n*** ** * ** ***\n\nThis page explains how you can analyze and optimize your resource allocation to improve your workload efficiency in Google Kubernetes Engine (GKE), using vertical Pod autoscaling. By analyzing your workload's resource usage over time, you can get optimization recommendations and automatically adjust CPU and memory requests, and limits for containers within the Pods.\n\nIn this page, you learn how vertical Pod autoscaling works, its benefits and limitations, best practices for using it, and access the [API references](#reference) for the `VerticalPodAutoscaler` custom resource and related types.\n\nThis page is for Operators and Developers who provision and configure cloud resources, deploy workloads, and manage application scaling. To learn\nmore about common roles, see\n[Common GKE user roles and tasks](/kubernetes-engine/enterprise/docs/concepts/roles-tasks).\n\nBefore reading this page, ensure that you are familiar with [resource requests and limits in Kubernetes](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/).\n\nFor rapid scaling needs in response to sudden resource usage, use the\n[Horizontal Pod Autoscaler](/kubernetes-engine/docs/concepts/horizontalpodautoscaler).\n\nTo learn best practices for autoscaling, see\n[Best practices for running cost-optimized Kubernetes applications on GKE](/architecture/best-practices-for-running-cost-effective-kubernetes-applications-on-gke#fine-tune_gke_autoscaling).\n\nHow vertical Pod autoscaling works\n----------------------------------\n\n*Vertical Pod autoscaling* lets you analyze and set CPU and memory resources\nrequired by Pods. Instead of having to set up-to-date\n[CPU requests and limits](https://kubernetes.io/docs/tasks/configure-pod-container/assign-cpu-resource/)\nand\n[memory requests and limits](https://kubernetes.io/docs/tasks/configure-pod-container/assign-memory-resource/)\nfor the containers in your Pods, you can configure vertical Pod autoscaling to\nprovide recommended values for CPU and memory requests and limits that you can\nuse to manually update your Pods, or you can configure vertical Pod autoscaling\nto automatically update the values.\n\nVertical Pod autoscaling is enabled by default in Autopilot clusters.\n\n### Vertical Pod autoscaling in Auto mode\n\nDue to Kubernetes limitations, the only way to modify the resource requests of a\nrunning Pod is to recreate the Pod. If you create a `VerticalPodAutoscaler`\nobject with an `updateMode` of `Auto`, the `VerticalPodAutoscaler` evicts a Pod\nif it needs to change the Pod's resource requests.\n\nTo limit the amount of Pod restarts, use a\n[Pod disruption budget](https://kubernetes.io/docs/tasks/run-application/configure-pdb/).\nTo ensure that your cluster can handle the new sizes of your workloads, use\n[cluster autoscaler](/kubernetes-engine/docs/concepts/cluster-autoscaler) and\n[node auto-provisioning](/kubernetes-engine/docs/how-to/node-auto-provisioning).\n\nVertical Pod autoscaling notifies the cluster autoscaler ahead of the update,\nand provides the resources needed for the resized workload before recreating\nthe workload, to minimize the disruption time.\n\nBenefits\n--------\n\nVertical Pod autoscaling provides the following benefits:\n\n- Setting the right resource requests and limits for your workloads improves stability and cost efficiency. If your Pod resource sizes are smaller than your workloads require, your application can either be throttled or it can fail due to out-of-memory errors. If your resource sizes are too large, you have waste and, therefore, larger bills.\n- Cluster nodes are used efficiently because Pods use exactly what they need.\n- Pods are scheduled onto nodes that have the appropriate resources available.\n- You don't have to run time-consuming benchmarking tasks to determine the correct values for CPU and memory requests.\n- Reduced maintenance time because the autoscaler can adjust CPU and memory requests over time without any action on your part.\n\nGKE vertical Pod autoscaling provides the following benefits over\nthe\n[Kubernetes open source autoscaler](https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler):\n\n- Takes maximum node size and resource quotas into account when determining the recommendation target.\n- Notifies the [cluster autoscaler](/kubernetes-engine/docs/concepts/cluster-autoscaler) to adjust cluster capacity.\n- Uses historical data, providing metrics collected before you enable the Vertical Pod Autoscaler.\n- Runs Vertical Pod Autoscaler Pods as [control plane](/kubernetes-engine/docs/concepts/cluster-architecture#control_plane) processes, instead of deployments on your [worker nodes](/kubernetes-engine/docs/concepts/cluster-architecture#nodes).\n\nLimitations\n-----------\n\n- To use vertical Pod autoscaling with [horizontal Pod autoscaling](/kubernetes-engine/docs/concepts/horizontalpodautoscaler), use [multidimensional Pod autoscaling](/kubernetes-engine/docs/how-to/multidimensional-pod-autoscaling). You can also use vertical Pod autoscaling with horizontal Pod autoscaling on [custom](/kubernetes-engine/docs/tutorials/custom-metrics-autoscaling) and [external](/kubernetes-engine/docs/tutorials/external-metrics-autoscaling) metrics.\n- Vertical Pod autoscaling is not ready for use with JVM-based workloads due to limited visibility into actual memory usage of the workload.\n- Vertical Pod autoscaling has a default setting of two minimum replicas for Deployments to replace Pods with revised resource values. In GKE version 1.22 and later, you can override this setting by specifying a value for `minReplicas` in the [PodUpdatePolicy](/kubernetes-engine/docs/concepts/verticalpodautoscaler#podupdatepolicy_v1_autoscalingk8sio) field.\n\n### Best practices\n\n- To avoid cluster update disruptions, we recommend that you keep the number of `VerticalPodAutoscaler` objects per cluster under 1,000.\n- Vertical Pod autoscaling works best with long-running homogenous workloads.\n\nAPI reference\n-------------\n\nThis is the `v1` API reference. We strongly recommend using this version of the\nAPI.\n\n### VerticalPodAutoscaler v1 autoscaling.k8s.io\n\n### VerticalPodAutoscalerSpec v1 autoscaling.k8s.io\n\n### VerticalPodAutoscalerList v1 autoscaling.k8s.io\n\n### PodUpdatePolicy v1 autoscaling.k8s.io\n\n### PodResourcePolicy v1 autoscaling.k8s.io\n\n### ContainerResourcePolicy v1 autoscaling.k8s.io\n\n### VerticalPodAutoscalerRecommenderSelector v1 autoscaling.k8s.io\n\n### VerticalPodAutoscalerStatus v1 autoscaling.k8s.io\n\n### RecommendedPodResources v1 autoscaling.k8s.io\n\n### RecommendedContainerResources v1 autoscaling.k8s.io\n\n### VerticalPodAutoscalerCondition v1 autoscaling.k8s.io\n\nWhat's next\n-----------\n\n- Learn how to [Scale container resource requests and limits](/kubernetes-engine/docs/how-to/vertical-pod-autoscaling).\n- Learn [best practices for running cost-optimized Kubernetes applications on GKE](/architecture/best-practices-for-running-cost-effective-kubernetes-applications-on-gke#vertical_pod_autoscaler).\n- Learn about [Cluster autoscaler](/kubernetes-engine/docs/concepts/cluster-autoscaler)."]]