Apply templates to all concepts and tasks to fix double bullets in TOC (#9149)

* Apply concept template to fix double bullet issue.

* Apply concept template

* Apply templates to tasks
This commit is contained in:
Steve Perry
2018-06-22 11:20:04 -07:00
committed by k8s-ci-robot
parent ec15f3fab9
commit 75f00dfc60
71 changed files with 1059 additions and 321 deletions
@@ -5,10 +5,11 @@ reviewers:
- justinsb
- directxman12
title: Horizontal Pod Autoscaler Walkthrough
content_template: templates/task
weight: 100
---
{{< toc >}}
{{% capture overview %}}
Horizontal Pod Autoscaler automatically scales the number of pods
in a replication controller, deployment or replica set based on observed CPU utilization
@@ -16,7 +17,12 @@ in a replication controller, deployment or replica set based on observed CPU uti
This document walks you through an example of enabling Horizontal Pod Autoscaler for the php-apache server. For more information on how Horizontal Pod Autoscaler behaves, see the [Horizontal Pod Autoscaler user guide](/docs/tasks/run-application/horizontal-pod-autoscale/).
## Prerequisites
{{% /capture %}}
{{< toc >}}
{{% capture prerequisites %}}
This example requires a running Kubernetes cluster and kubectl, version 1.2 or later.
[Heapster](https://github.com/kubernetes/heapster) monitoring needs to be deployed in the cluster
@@ -31,7 +37,11 @@ not related to any Kubernetes object you must have a Kubernetes cluster at versi
you must be able to communicate with the API server that provides the external metrics API.
See the [Horizontal Pod Autoscaler user guide](/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-custom-metrics) for more details.
## Step One: Run & expose php-apache server
{{% /capture %}}
{{% capture steps %}}
## Run & expose php-apache server
To demonstrate Horizontal Pod Autoscaler we will use a custom docker image based on the php-apache image.
The Dockerfile has the following content:
@@ -62,7 +72,7 @@ service "php-apache" created
deployment "php-apache" created
```
## Step Two: Create Horizontal Pod Autoscaler
## Create Horizontal Pod Autoscaler
Now that the server is running, we will create the autoscaler using
[kubectl autoscale](https://github.com/kubernetes/kubernetes/blob/{{< param "githubbranch" >}}/docs/user-guide/kubectl/kubectl_autoscale.md).
@@ -90,7 +100,7 @@ php-apache Deployment/php-apache/scale 0% / 50% 1 10 1
Please note that the current CPU consumption is 0% as we are not sending any requests to the server
(the ``CURRENT`` column shows the average across all the pods controlled by the corresponding deployment).
## Step Three: Increase load
## Increase load
Now, we will see how the autoscaler reacts to increased load.
We will start a container, and send an infinite loop of queries to the php-apache service (please run it in a different terminal):
@@ -125,7 +135,7 @@ php-apache 7 7 7 7 19m
Since the amount of load is not controlled in any way it may happen that the final number of replicas will
differ from this example.
## Step Four: Stop load
## Stop load
We will finish our example by stopping the user load.
@@ -146,7 +156,13 @@ php-apache 1 1 1 1 27m
Here CPU utilization dropped to 0, and so HPA autoscaled the number of replicas back down to 1.
{{< note >}}
**Note** autoscaling the replicas may take a few minutes.
{{< /note >}}
{{% /capture %}}
{{% capture discussion %}}
## Autoscaling on multiple metrics and custom metrics
@@ -377,3 +393,5 @@ We will create the autoscaler by executing the following command:
$ kubectl create -f https://k8s.io/docs/tasks/run-application/hpa-php-apache.yaml
horizontalpodautoscaler "php-apache" created
```
{{% /capture %}}