This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.26.5. 为 CPU 使用率自动扩展
使用 oc autoscale
命令,并至少指定您要在任意给定时间运行的 pod 的最大数量。您可以选择指定 OpenShift Container Platform 服务器的 pod 的最小数量和 pod 的平均 CPU 使用率,否则这些利用率从 OpenShift Container Platform 服务器赋予默认值。
例如:
oc autoscale dc/frontend --min 1 --max 10 --cpu-percent=80
$ oc autoscale dc/frontend --min 1 --max 10 --cpu-percent=80
deploymentconfig "frontend" autoscaled
在使用 pod 横向自动扩展的 autoscaling/v1
版本时,上面的 pod 横向自动扩展使用以下定义:
例 26.1. Pod 横向自动扩展对象定义
另外,oc autoscale
命令在使用 pod 横向自动扩展 v2beta1
版本时,会根据定义创建一个 pod 横向自动扩展: