Skip to content

Latest commit

 

History

History
62 lines (47 loc) · 2.11 KB

24-appcon-auto-scaling-of-your-application.adoc

File metadata and controls

62 lines (47 loc) · 2.11 KB

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"

  1. Login https://openshift.caascloud.net:8443

  2. Click Create Project

  3. Enter project information, i.e. lab2-username

  4. Click Create

Step 4 Create Application

  1. Click Add to project if you are not already in the Browse Catalog.

  2. Click PHP under Browse Catalog

  3. Click Select in the PHP box

  4. Enter: phpapp as name

  5. Enter: https://github.com/RedHatWorkshops/welcome-php.git as Git Repository URL

  6. Click Create

  7. Click Continue to Overview

  8. Wait and see if the solid blue coming up again.

Step 5 Add Autoscaler to Deployment

  1. Click Applications -→ Deployments

  2. Click on the name of Deployment that you need to add autoscaler

  3. Click Actions (top right) -→ select Add Resource Limits

  4. Enter 200 for CPU request

  5. Enter 300 for CPU limit

  6. Enter 100 for Memory request

  7. Enter 200 for Memory limit

  8. Click Save

  9. Click Actions (top right) -→ select Add Autoscalers

  10. Enter name for Autoscaler

  11. Enter 1 for Min Pods

  12. Enter 2 for Max Pods

  13. Enter 3 for CPU request target

  14. Click Save

  15. 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

  1. URL of the application is on the top right of the overview page.

  2. 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/