3.4.3. Scaling up the deployment
Scale the application deployment up or down to meet workload demands.
In Kubernetes, a Deployment object defines how an application deploys. In most cases when you deploy an application, OpenShift Container Platform creates the Pod, Service, ReplicaSet, and Deployment resources for you.
When you deploy the parksmap image, a deployment resource is created. In this example, only one pod is deployed. You might want to scale up your application to keep up with user demand or to ensure that your application is always running even if one pod is down.
The following procedure scales the parksmap deployment to use two instances.
Prerequisites
-
You have deployed the
parksmapfront-end application.
Procedure
Scale your deployment from one pod instance to two pod instances by running the following command:
$ oc scale --replicas=2 deployment/parksmapExample output
deployment.apps/parksmap scaled
Verification
Verify that your deployment scaled up properly by running the following command:
$ oc get podsExample output
NAME READY STATUS RESTARTS AGE parksmap-5f9579955-6sng8 1/1 Running 0 7m39s parksmap-5f9579955-8tgft 1/1 Running 0 24sVerify that two
parksmappods are listed.작은 정보To scale your deployment back down to one pod instance, pass in
1to the--replicasoption:$ oc scale --replicas=1 deployment/parksmap