DEV Community

Cover image for How to scale an application in OpenShift?
Sagar Jadhav
Sagar Jadhav

Posted on • Updated on • Originally published at developersthought.in

How to scale an application in OpenShift?

Objective

  • Scale up Nginx application using oc scale command
  • Scale up Nginx application by updating DeploymentConfig
  • Scale down Nginx application using oc scale command

Step 1: Deploy Nginx application

Refer User & Project Management blog

Step 2: List pods

oc get pods
Enter fullscreen mode Exit fullscreen mode

Step 3: Scale up Nginx application using oc scale command

oc scale dc nginx --replicas=5
Enter fullscreen mode Exit fullscreen mode
oc get pods --watch
Enter fullscreen mode Exit fullscreen mode

Step 4: Scale up nginx application by updating DeploymentConfig

oc edit dc nginx
Enter fullscreen mode Exit fullscreen mode
update replicas = 7
Enter fullscreen mode Exit fullscreen mode
oc get pods --watch
Enter fullscreen mode Exit fullscreen mode

Step 5: Scale down nginx application using oc scale command

oc scale dc nginx --replicas=1
Enter fullscreen mode Exit fullscreen mode
oc get pods --watch
Enter fullscreen mode Exit fullscreen mode

Top comments (0)