From 772bc41ba014ff8790332ca3f1e298df5cebee2e Mon Sep 17 00:00:00 2001 From: Michael Burke Date: Tue, 22 Mar 2022 16:15:49 -0400 Subject: [PATCH] HPA autoscaling/v2beta2 is deprecated; change to v2 --- modules/nodes-pods-autoscaling-about.adoc | 4 ++-- modules/nodes-pods-autoscaling-creating-cpu.adoc | 4 ++-- modules/nodes-pods-autoscaling-creating-memory.adoc | 8 ++++---- modules/nodes-pods-autoscaling-policies.adoc | 6 +++--- modules/nodes-pods-autoscaling-status-about.adoc | 2 +- modules/nodes-pods-autoscaling-status-viewing.adoc | 3 +-- 6 files changed, 13 insertions(+), 14 deletions(-) diff --git a/modules/nodes-pods-autoscaling-about.adoc b/modules/nodes-pods-autoscaling-about.adoc index 9f86b40a5a..7bbc20670e 100644 --- a/modules/nodes-pods-autoscaling-about.adoc +++ b/modules/nodes-pods-autoscaling-about.adoc @@ -44,11 +44,11 @@ The following metrics are supported by horizontal pod autoscalers: |CPU utilization |Number of CPU cores used. Can be used to calculate a percentage of the pod's requested CPU. -|`autoscaling/v1`, `autoscaling/v2beta2` +|`autoscaling/v1`, `autoscaling/v2` |Memory utilization |Amount of memory used. Can be used to calculate a percentage of the pod's requested memory. -|`autoscaling/v2beta2` +|`autoscaling/v2` |=== [IMPORTANT] diff --git a/modules/nodes-pods-autoscaling-creating-cpu.adoc b/modules/nodes-pods-autoscaling-creating-cpu.adoc index bc241413aa..488f4a08e7 100644 --- a/modules/nodes-pods-autoscaling-creating-cpu.adoc +++ b/modules/nodes-pods-autoscaling-creating-cpu.adoc @@ -89,7 +89,7 @@ $ oc autoscale deployment/image-registry --min=5 --max=7 --cpu-percent=75 + [source,yaml,options="nowrap"] ---- -apiVersion: autoscaling/v2beta2 <1> +apiVersion: autoscaling/v2 <1> kind: HorizontalPodAutoscaler metadata: name: cpu-autoscale <2> @@ -109,7 +109,7 @@ spec: type: AverageValue <10> averageValue: 500m <11> ---- -<1> Use the `autoscaling/v2beta2` API. +<1> Use the `autoscaling/v2` API. <2> Specify a name for this horizontal pod autoscaler object. <3> Specify the API version of the object to scale: * For a `Deployment`, `ReplicaSet`, `Statefulset` object, use `apps/v1`. diff --git a/modules/nodes-pods-autoscaling-creating-memory.adoc b/modules/nodes-pods-autoscaling-creating-memory.adoc index 820ad4a35a..60e935e7a9 100644 --- a/modules/nodes-pods-autoscaling-creating-memory.adoc +++ b/modules/nodes-pods-autoscaling-creating-memory.adoc @@ -70,7 +70,7 @@ To create a horizontal pod autoscaler for memory utilization: + [source,yaml,options="nowrap"] ---- -apiVersion: autoscaling/v2beta2 <1> +apiVersion: autoscaling/v2 <1> kind: HorizontalPodAutoscaler metadata: name: hpa-resource-metrics-memory <2> @@ -101,7 +101,7 @@ spec: periodSeconds: 60 selectPolicy: Max ---- -<1> Use the `autoscaling/v2beta2` API. +<1> Use the `autoscaling/v2` API. <2> Specify a name for this horizontal pod autoscaler object. <3> Specify the API version of the object to scale: * For a `Deployment`, `ReplicaSet`, or `Statefulset` object, use `apps/v1`. @@ -122,7 +122,7 @@ spec: + [source,yaml,options="nowrap"] ---- -apiVersion: autoscaling/v2beta2 <1> +apiVersion: autoscaling/v2 <1> kind: HorizontalPodAutoscaler metadata: name: memory-autoscale <2> @@ -153,7 +153,7 @@ spec: periodSeconds: 120 selectPolicy: Max ---- -<1> Use the `autoscaling/v2beta2` API. +<1> Use the `autoscaling/v2` API. <2> Specify a name for this horizontal pod autoscaler object. <3> Specify the API version of the object to scale: * For a ReplicationController, use `v1`. diff --git a/modules/nodes-pods-autoscaling-policies.adoc b/modules/nodes-pods-autoscaling-policies.adoc index 9407418ea6..22d7524b65 100644 --- a/modules/nodes-pods-autoscaling-policies.adoc +++ b/modules/nodes-pods-autoscaling-policies.adoc @@ -5,12 +5,12 @@ [id="nodes-pods-autoscaling-policies_{context}"] = Scaling policies -The `autoscaling/v2beta2` API allows you to add _scaling policies_ to a horizontal pod autoscaler. A scaling policy controls how the {product-title} horizontal pod autoscaler (HPA) scales pods. Scaling policies allow you to restrict the rate that HPAs scale pods up or down by setting a specific number or specific percentage to scale in a specified period of time. You can also define a _stabilization window_, which uses previously computed desired states to control scaling if the metrics are fluctuating. You can create multiple policies for the same scaling direction, and determine which policy is used, based on the amount of change. You can also restrict the scaling by timed iterations. The HPA scales pods during an iteration, then performs scaling, as needed, in further iterations. +The `autoscaling/v2` API allows you to add _scaling policies_ to a horizontal pod autoscaler. A scaling policy controls how the {product-title} horizontal pod autoscaler (HPA) scales pods. Scaling policies allow you to restrict the rate that HPAs scale pods up or down by setting a specific number or specific percentage to scale in a specified period of time. You can also define a _stabilization window_, which uses previously computed desired states to control scaling if the metrics are fluctuating. You can create multiple policies for the same scaling direction, and determine which policy is used, based on the amount of change. You can also restrict the scaling by timed iterations. The HPA scales pods during an iteration, then performs scaling, as needed, in further iterations. .Sample HPA object with a scaling policy [source, yaml] ---- -apiVersion: autoscaling/v2beta2 +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: hpa-resource-metrics-memory @@ -54,7 +54,7 @@ spec: .Example policy for scaling down [source,yaml] ---- -apiVersion: autoscaling/v2beta2 +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: hpa-resource-metrics-memory diff --git a/modules/nodes-pods-autoscaling-status-about.adoc b/modules/nodes-pods-autoscaling-status-about.adoc index b7229b0459..387d306c4f 100644 --- a/modules/nodes-pods-autoscaling-status-about.adoc +++ b/modules/nodes-pods-autoscaling-status-about.adoc @@ -11,7 +11,7 @@ You can use the status conditions set to determine whether or not the horizontal pod autoscaler (HPA) is able to scale and whether or not it is currently restricted in any way. -The HPA status conditions are available with the `v2beta1` version of the +The HPA status conditions are available with the `v2` version of the autoscaling API. The HPA responds with the following status conditions: diff --git a/modules/nodes-pods-autoscaling-status-viewing.adoc b/modules/nodes-pods-autoscaling-status-viewing.adoc index 5e7b4f988d..423a4a7161 100644 --- a/modules/nodes-pods-autoscaling-status-viewing.adoc +++ b/modules/nodes-pods-autoscaling-status-viewing.adoc @@ -11,8 +11,7 @@ You can view the status conditions set on a pod by the horizontal pod autoscaler [NOTE] ==== -The horizontal pod autoscaler status conditions are available with the `v2beta1` version of the -autoscaling API. +The horizontal pod autoscaler status conditions are available with the `v2` version of the autoscaling API. ==== .Prerequisites