Auto-scaling An Application
In this exercise we will learn how to setup horizontal pod autoscalers
Step 1: Create projects
If you want to, you can create a new project based on what you have learned in the previous lab. Since we already have a project we will use it. Run the following command to make sure.
Important
|
Please replace username with the username assigned to you in the commands below. |
To create a new project"
-
Click
Create Project
-
Enter project information, i.e.
lab2-username
-
Click
Create
Step 4 Create Application
-
Click
Add to project
if you are not already in the Browse Catalog. -
Click
PHP
under Browse Catalog -
Click
Select
in the PHP box -
Enter: phpapp as name
-
Enter: https://github.com/RedHatWorkshops/welcome-php.git as Git Repository URL
-
Click
Create
-
Click
Continue to Overview
-
Wait and see if the solid blue coming up again.
Step 5 Add Autoscaler to Deployment
-
Click
Applications
-→Deployments
-
Click on the name of Deployment that you need to add autoscaler
-
Click
Actions
(top right) -→ selectAdd Resource Limits
-
Enter
200
for CPU request -
Enter
300
for CPU limit -
Enter
100
for Memory request -
Enter
200
for Memory limit -
Click
Save
-
Click
Actions
(top right) -→ selectAdd Autoscalers
-
Enter name for Autoscaler
-
Enter
1
for Min Pods -
Enter
2
for Max Pods -
Enter
3
for CPU request target -
Click
Save
-
Click
Overview
*Step 6 install Apache Bench on Windows 1. Download apache binaries from an apache recommended download site (i.e. https://www.apachelounge.com/download/apache) 2. Extract the content using zip tool 3. Copy the /bin/ab.exe to a folder of your choice (i.e.: c:\temp)
Step 7 Add loads to Application
-
URL of the application is on the top right of the overview page.
-
run on linux or MAC: ab -n 100000000 -c 100 <your application URL> Example: ab -n 1000000000 -c 100 http://welcome-autoscaler.cloudapps.example.com/