Container: Deploying An Application - Auto-Scaling



Applications running within OpenShift can increase capacity based on user load. This functionality is called 'auto-scaling'.

Setting up auto-scaling is essentially a two-step process:

Modify your deployment configuration to set a request-limit for CPU resources. You will want to observe the application's metrics during a busy period to understand what an appropriate request might be. Your request should sit just above the upper-limit of normal traffic for an individual pod.

  1. Under the section spec: template: spec: containers: resources:
    • requests:
    • cpu: 50m
  2. Create an auto-scaling rule to add additional pods when this CPU resource request is exceeded.
    • Example autoscaling command: oc autoscale dc/ruby-thin --max 5 --cpu-percent=80
    • This means you will add additional pods up to 5 when 80% of your cpu request is exceeded.
Last Updated: 
Thursday, September 13, 2018