From 128c883755d25e18dd7916c4f9d14002a9603dbf Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Mon, 7 Dec 2020 11:24:01 +0200 Subject: [PATCH] Update docs and examples to HPA v2beta2 Signed-off-by: Stefan Prodan --- .../tutorials/appmesh-progressive-delivery.md | 2 +- .../tutorials/contour-progressive-delivery.md | 2 +- .../tutorials/crossover-progressive-delivery.md | 2 +- docs/gitbook/tutorials/flagger-smi-istio.md | 2 +- .../tutorials/gloo-progressive-delivery.md | 2 +- docs/gitbook/tutorials/istio-ab-testing.md | 2 +- .../tutorials/istio-progressive-delivery.md | 2 +- docs/gitbook/tutorials/kubernetes-blue-green.md | 2 +- .../tutorials/linkerd-progressive-delivery.md | 4 ++-- .../tutorials/nginx-progressive-delivery.md | 2 +- .../tutorials/skipper-progressive-delivery.md | 2 +- .../tutorials/traefik-progressive-delivery.md | 2 +- .../tutorials/zero-downtime-deployments.md | 2 +- docs/gitbook/usage/how-it-works.md | 2 +- kustomize/podinfo/hpa.yaml | 16 +++++++++------- 15 files changed, 24 insertions(+), 22 deletions(-) diff --git a/docs/gitbook/tutorials/appmesh-progressive-delivery.md b/docs/gitbook/tutorials/appmesh-progressive-delivery.md index 15f5ca95..d828a22b 100644 --- a/docs/gitbook/tutorials/appmesh-progressive-delivery.md +++ b/docs/gitbook/tutorials/appmesh-progressive-delivery.md @@ -76,7 +76,7 @@ spec: progressDeadlineSeconds: 60 # HPA reference (optional) autoscalerRef: - apiVersion: autoscaling/v2beta1 + apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler name: podinfo service: diff --git a/docs/gitbook/tutorials/contour-progressive-delivery.md b/docs/gitbook/tutorials/contour-progressive-delivery.md index 953f1d33..f95c33db 100644 --- a/docs/gitbook/tutorials/contour-progressive-delivery.md +++ b/docs/gitbook/tutorials/contour-progressive-delivery.md @@ -79,7 +79,7 @@ spec: name: podinfo # HPA reference autoscalerRef: - apiVersion: autoscaling/v2beta1 + apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler name: podinfo service: diff --git a/docs/gitbook/tutorials/crossover-progressive-delivery.md b/docs/gitbook/tutorials/crossover-progressive-delivery.md index cd26ed09..8f81dd9b 100644 --- a/docs/gitbook/tutorials/crossover-progressive-delivery.md +++ b/docs/gitbook/tutorials/crossover-progressive-delivery.md @@ -142,7 +142,7 @@ spec: progressDeadlineSeconds: 60 # HPA reference (optional) autoscalerRef: - apiVersion: autoscaling/v2beta1 + apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler name: podinfo service: diff --git a/docs/gitbook/tutorials/flagger-smi-istio.md b/docs/gitbook/tutorials/flagger-smi-istio.md index 90291e48..f7ee750a 100644 --- a/docs/gitbook/tutorials/flagger-smi-istio.md +++ b/docs/gitbook/tutorials/flagger-smi-istio.md @@ -122,7 +122,7 @@ spec: progressDeadlineSeconds: 60 # HPA reference (optional) autoscalerRef: - apiVersion: autoscaling/v2beta1 + apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler name: podinfo service: diff --git a/docs/gitbook/tutorials/gloo-progressive-delivery.md b/docs/gitbook/tutorials/gloo-progressive-delivery.md index 6ec09c4f..6ac14abf 100644 --- a/docs/gitbook/tutorials/gloo-progressive-delivery.md +++ b/docs/gitbook/tutorials/gloo-progressive-delivery.md @@ -97,7 +97,7 @@ spec: name: podinfo # HPA reference (optional) autoscalerRef: - apiVersion: autoscaling/v2beta1 + apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler name: podinfo service: diff --git a/docs/gitbook/tutorials/istio-ab-testing.md b/docs/gitbook/tutorials/istio-ab-testing.md index b7a3f781..00fe9720 100644 --- a/docs/gitbook/tutorials/istio-ab-testing.md +++ b/docs/gitbook/tutorials/istio-ab-testing.md @@ -86,7 +86,7 @@ spec: progressDeadlineSeconds: 60 # HPA reference (optional) autoscalerRef: - apiVersion: autoscaling/v2beta1 + apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler name: podinfo service: diff --git a/docs/gitbook/tutorials/istio-progressive-delivery.md b/docs/gitbook/tutorials/istio-progressive-delivery.md index b476f84d..eaeb3bd9 100644 --- a/docs/gitbook/tutorials/istio-progressive-delivery.md +++ b/docs/gitbook/tutorials/istio-progressive-delivery.md @@ -87,7 +87,7 @@ spec: progressDeadlineSeconds: 60 # HPA reference (optional) autoscalerRef: - apiVersion: autoscaling/v2beta1 + apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler name: podinfo service: diff --git a/docs/gitbook/tutorials/kubernetes-blue-green.md b/docs/gitbook/tutorials/kubernetes-blue-green.md index 59ff350c..840e9d59 100644 --- a/docs/gitbook/tutorials/kubernetes-blue-green.md +++ b/docs/gitbook/tutorials/kubernetes-blue-green.md @@ -87,7 +87,7 @@ spec: progressDeadlineSeconds: 60 # HPA reference (optional) autoscalerRef: - apiVersion: autoscaling/v2beta1 + apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler name: podinfo service: diff --git a/docs/gitbook/tutorials/linkerd-progressive-delivery.md b/docs/gitbook/tutorials/linkerd-progressive-delivery.md index 87c161d1..f7314c25 100644 --- a/docs/gitbook/tutorials/linkerd-progressive-delivery.md +++ b/docs/gitbook/tutorials/linkerd-progressive-delivery.md @@ -57,7 +57,7 @@ spec: name: podinfo # HPA reference (optional) autoscalerRef: - apiVersion: autoscaling/v2beta1 + apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler name: podinfo # the maximum time in seconds for the canary deployment @@ -400,7 +400,7 @@ spec: kind: Deployment name: podinfo autoscalerRef: - apiVersion: autoscaling/v2beta1 + apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler name: podinfo service: diff --git a/docs/gitbook/tutorials/nginx-progressive-delivery.md b/docs/gitbook/tutorials/nginx-progressive-delivery.md index 136f180c..f1ef1098 100644 --- a/docs/gitbook/tutorials/nginx-progressive-delivery.md +++ b/docs/gitbook/tutorials/nginx-progressive-delivery.md @@ -116,7 +116,7 @@ spec: name: podinfo # HPA reference (optional) autoscalerRef: - apiVersion: autoscaling/v2beta1 + apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler name: podinfo # the maximum time in seconds for the canary deployment diff --git a/docs/gitbook/tutorials/skipper-progressive-delivery.md b/docs/gitbook/tutorials/skipper-progressive-delivery.md index 2df8a2f4..ca57d3f3 100644 --- a/docs/gitbook/tutorials/skipper-progressive-delivery.md +++ b/docs/gitbook/tutorials/skipper-progressive-delivery.md @@ -109,7 +109,7 @@ spec: name: podinfo # HPA reference (optional) autoscalerRef: - apiVersion: autoscaling/v2beta1 + apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler name: podinfo # the maximum time in seconds for the canary deployment diff --git a/docs/gitbook/tutorials/traefik-progressive-delivery.md b/docs/gitbook/tutorials/traefik-progressive-delivery.md index 77d95669..687cfc20 100644 --- a/docs/gitbook/tutorials/traefik-progressive-delivery.md +++ b/docs/gitbook/tutorials/traefik-progressive-delivery.md @@ -96,7 +96,7 @@ spec: name: podinfo # HPA reference (optional) autoscalerRef: - apiVersion: autoscaling/v2beta1 + apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler name: podinfo # the maximum time in seconds for the canary deployment diff --git a/docs/gitbook/tutorials/zero-downtime-deployments.md b/docs/gitbook/tutorials/zero-downtime-deployments.md index 6eaad280..7dc0dcab 100644 --- a/docs/gitbook/tutorials/zero-downtime-deployments.md +++ b/docs/gitbook/tutorials/zero-downtime-deployments.md @@ -139,7 +139,7 @@ Note that without resource requests the horizontal pod autoscaler can't determin A production environment should be able to handle traffic bursts without impacting the quality of service. This can be achieved with Kubernetes autoscaling capabilities. Autoscaling in Kubernetes has two dimensions: the Cluster Autoscaler that deals with node scaling operations and the Horizontal Pod Autoscaler that automatically scales the number of pods in a deployment. ```yaml -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler spec: scaleTargetRef: diff --git a/docs/gitbook/usage/how-it-works.md b/docs/gitbook/usage/how-it-works.md index 7e44d1ef..a28136b9 100644 --- a/docs/gitbook/usage/how-it-works.md +++ b/docs/gitbook/usage/how-it-works.md @@ -65,7 +65,7 @@ spec: kind: Deployment name: podinfo autoscalerRef: - apiVersion: autoscaling/v2beta1 + apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler name: podinfo ``` diff --git a/kustomize/podinfo/hpa.yaml b/kustomize/podinfo/hpa.yaml index 9824ef1d..8c86aae7 100644 --- a/kustomize/podinfo/hpa.yaml +++ b/kustomize/podinfo/hpa.yaml @@ -1,4 +1,4 @@ -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2beta2 kind: HorizontalPodAutoscaler metadata: name: podinfo @@ -10,9 +10,11 @@ spec: minReplicas: 2 maxReplicas: 4 metrics: - - type: Resource - resource: - name: cpu - # scale up if usage is above - # 99% of the requested CPU (100m) - targetAverageUtilization: 99 + - type: Resource + resource: + name: cpu + target: + type: Utilization + # scale up if usage is above + # 99% of the requested CPU (100m) + averageUtilization: 99