このページでは、垂直 Pod 自動スケーリングを使用して、リソース割り当ての分析と最適化を行い、Google Kubernetes Engine(GKE)でワークロードの効率を改善する方法について説明します。ワークロードのリソース使用状況の経時的な変化を分析することで、最適化の推奨事項を取得し、Pod 内のコンテナの CPU リクエスト、メモリ リクエスト、上限を自動的に調整できます。
このページでは、垂直 Pod 自動スケーリングの仕組み、そのメリットと制限事項、使用に関するベスト プラクティスについて説明します。また、VerticalPodAutoscaler カスタム リソースとそれに関連するタイプの API リファレンスを提供します。
垂直 Pod 自動スケーリングを使用すると、Pod に必要な CPU リソースとメモリリソースを分析して設定できます。Pod 内のコンテナに最新の CPU のリクエストと制限やメモリのリクエストと制限を設定する代わりに、垂直 Pod 自動スケーリングを構成して CPU とメモリのリクエストおよび制限の推奨値を指定します。これらの推奨値は、Pod を手動で更新するときに使用できます。または、値を自動的に更新するように垂直 Pod 自動スケーリングを構成することもできます。
垂直 Pod 自動スケーリングは、Autopilot クラスタではデフォルトで有効になっています。
自動モードでの垂直 Pod 自動スケーリング
Kubernetes の制限により、実行中の Pod のリソース リクエストを変更するには、その Pod を再作成しなければなりません。updateMode が Auto である VerticalPodAutoscaler オブジェクトを作成した場合、Pod のリソース リクエストを変更する必要が生じると VerticalPodAutoscaler は 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-05-08 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)."]]