Applications are designed and created to meet the demands of customers and can be scaled up or down based on business needs.
Scale an application as follows. This example uses hello-openshift.
- Log in to the OpenShift cluster:
[core@csah ~]$ oc login -u <user name>
- Switch to the project under which the application is running:
[core@csah ~]$ oc project sample
Now using project "sample" on server "https://api.ocp.example.com:6443".
- Identify the deployment configuration that is associated with the application:
[core@csah ~]$ oc get dc
NAME REVISION DESIRED CURRENT TRIGGERED BY
hello-openshift 1 3 3 config,image(hello-openshift:latest)
- Increase the DESIRED count to 3:
[core@csah ~]$ oc scale --replicas=3 dc/hello-openshift
deploymentconfig.apps.openshift.io/hello-openshift scaled
[core@csah ~]$ oc get dc
NAME REVISION DESIRED CURRENT TRIGGERED BY
Hello-openshift 1 3 3 config,image(hello-openshift:latest)
Note: OpenShift supports the autoscaling of pods if cluster metrics are installed. Run oc autoscale dc/hello-openshift –min=1 --min=10 --cpu-percent=80. This feature is under Technology Preview. For more information about enabling cluster metrics for pods, see Exposing custom application metrics for autoscaling in the OpenShift Container Platform documentation.