Your application requires more resources from the server if you have many users on your application. One way to get more resources is by adding lots of resources, but it is not desirable to pay for resources you don't use. Autoscaling is a way of adding (and paying) for extra resources only when it is needed.
- Go to Google Cloud Console in your browser and go to Container Engine in the menu on the left.
- Click on your cluster
- Click Edit
- From the Autoscaling drop-down menu, click On
- Input 1 as minimum size and 4 as maximum size
- Set Number of instanes to 1
- Click save. This might take several minutes.
Your cluster will now scale up or down from 1 to 3 based on the workload. This is still beta functionality, meaning it can change in a backward-incompatible way without notice, so use with caution.
To test the auto scaling, run this little bash script in a terminal:
for i in `seq 1 500`; do curl --silent http://INSERT_YOUR_EXTERNAL_IP > /dev/null; done
Go to Google Cloud Console, navigate to Compute Engine in the menu on the left.
Choose Instance Groups and click on your group named something like gke-cv-cluster-default-pool-1233564-grp