-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
Fix of pull request #18960 #18974
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
``` | ||
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kkanska , Thanks for the updates! Looks good. /lgtm There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
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 | ||
|
There was a problem hiding this comment.
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 acodenew
shortcode to introduce the configuration file before using the file in the kubectl command. Such as:The other configuration file is in the
hpa
subdirectory and uses the same name: