diff --git a/content/en/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough.md b/content/en/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough.md index 8a45ae0c8399a..df29d9389e5b6 100644 --- a/content/en/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough.md +++ b/content/en/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough.md @@ -62,7 +62,11 @@ It defines an index.php page which performs some CPU intensive computations: ?> ``` -First, we will start a deployment running the image and expose it as a service: +First, we will start a deployment running the image and expose it as a service +using the following configuration: + +{{< codenew file="application/php-apache.yaml" >}} + ```shell kubectl apply -f https://k8s.io/examples/application/php-apache.yaml @@ -74,17 +78,17 @@ service/php-apache created ## Create Horizontal Pod Autoscaler -Now that the server is running, we will create the autoscaler using -[kubectl autoscale](/docs/reference/generated/kubectl/kubectl-commands#autoscale). -The following command will create a Horizontal Pod Autoscaler that maintains between 1 and 10 replicas of the Pods +Now that the server is running, we will create a Horizontal Pod Autoscaler that maintains between 1 and 10 replicas of the Pods controlled by the php-apache deployment we created in the first step of these instructions. Roughly speaking, HPA will increase and decrease the number of replicas (via the deployment) to maintain an average CPU utilization across all Pods of 50% (since each pod requests 200 milli-cores by `kubectl run`), this means average CPU usage of 100 milli-cores). See [here](/docs/tasks/run-application/horizontal-pod-autoscale/#algorithm-details) for more details on the algorithm. +{{< codenew file="application/hpa/php-apache.yaml" >}} + ```shell -kubectl autoscale deployment php-apache --cpu-percent=50 --min=1 --max=10 +kubectl apply -f https://k8s.io/examples/application/hpa/php-apache.yaml ``` ``` horizontalpodautoscaler.autoscaling/php-apache autoscaled