From 95e92ad5476d64e09cd1affeb80befeeb7cc2687 Mon Sep 17 00:00:00 2001 From: Jerzy Szczepkowski Date: Fri, 30 Sep 2016 11:06:51 +0200 Subject: [PATCH] Updated hpa config file to the latest API version. Updated hpa config file to the latest API version. --- .../horizontal-pod-autoscaling/hpa-php-apache.yaml | 9 ++++----- .../user-guide/horizontal-pod-autoscaling/walkthrough.md | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/docs/user-guide/horizontal-pod-autoscaling/hpa-php-apache.yaml b/docs/user-guide/horizontal-pod-autoscaling/hpa-php-apache.yaml index 72d402743d..7ccdcabafd 100644 --- a/docs/user-guide/horizontal-pod-autoscaling/hpa-php-apache.yaml +++ b/docs/user-guide/horizontal-pod-autoscaling/hpa-php-apache.yaml @@ -1,14 +1,13 @@ -apiVersion: extensions/v1beta1 +apiVersion: autoscaling/v1 kind: HorizontalPodAutoscaler metadata: name: php-apache namespace: default spec: - scaleRef: + scaleTargetRef: + apiVersion: extensions/v1beta1 kind: Deployment name: php-apache - subresource: scale minReplicas: 1 maxReplicas: 10 - cpuUtilization: - targetPercentage: 50 + targetCPUUtilizationPercentage: 50 diff --git a/docs/user-guide/horizontal-pod-autoscaling/walkthrough.md b/docs/user-guide/horizontal-pod-autoscaling/walkthrough.md index d445b854e4..0f288352a0 100644 --- a/docs/user-guide/horizontal-pod-autoscaling/walkthrough.md +++ b/docs/user-guide/horizontal-pod-autoscaling/walkthrough.md @@ -127,20 +127,19 @@ Here CPU utilization dropped to 0, and so HPA autoscaled the number of replicas Instead of using `kubectl autoscale` command we can use the [hpa-php-apache.yaml](/docs/user-guide/horizontal-pod-autoscaling/hpa-php-apache.yaml) file, which looks like this: ```yaml -apiVersion: extensions/v1beta1 +apiVersion: autoscaling/v1 kind: HorizontalPodAutoscaler metadata: name: php-apache namespace: default spec: - scaleRef: + scaleTargetRef: + apiVersion: extensions/v1beta1 kind: Deployment name: php-apache - subresource: scale minReplicas: 1 maxReplicas: 10 - cpuUtilization: - targetPercentage: 50 + targetCPUUtilizationPercentage: 50 ``` We will create the autoscaler by executing the following command: