Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix of pull request #18960 #18974

Merged
merged 3 commits into from
Feb 7, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,13 @@ 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" >}}


Run the following command:
```shell
kubectl apply -f https://k8s.io/examples/application/php-apache.yaml
Copy link
Contributor

@kbhawkey kbhawkey Feb 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @kkanska . Thanks for the updates.
Similar to the hpa configuration file listed on line 472, you could use a codenew shortcode to introduce the configuration file before using the file in the kubectl command. Such as:

{{< codenew file="application/php-apache.yaml" >}}

The other configuration file is in the hpa subdirectory and uses the same name:

{{< codenew file="application/hpa/php-apache.yaml" >}}

```
Expand All @@ -74,17 +79,18 @@ 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
Copy link
Contributor

@kbhawkey kbhawkey Feb 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kkanska , Thanks for the updates! Looks good.
I wonder if the appendix-other-possible-scenarios section on this page could be removed since you replaced kubectl autoscale with kubectl apply ...?
Lines 82-83, Possible edits:
With the php-apache service deployed and running, create a Horizontal Pod Autoscaler that maintains between 1 and 10 replicas of the Pods controlled by the php-apache deployment.

/lgtm

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest I didn't notice this appendix, my bad. This part can as well stay as it was before my changes and probably would be more readable with the kubectl autoscale.

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" >}}

Run the following command:
```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
Expand Down