mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 21:46:22 +01:00
58 lines
1.6 KiB
Plaintext
58 lines
1.6 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * getting-started/openshift-cli.adoc
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="getting-started-cli-scaling-app_{context}"]
|
|
= Scaling the application
|
|
|
|
In Kubernetes, a `Deployment` object defines how an application deploys. In most cases, users use `Pod`, `Service`, `ReplicaSets`, and `Deployment` resources together. In most cases, {product-title} creates the resources for you.
|
|
|
|
When you deploy the `national-parks-app` image, a deployment resource is created. In this example, only one `Pod` is deployed.
|
|
|
|
The following procedure scales the `national-parks-image` to use two instances.
|
|
|
|
.Prerequisites
|
|
|
|
* You must have access to an {product-title} cluster.
|
|
* You must have installed the OpenShift CLI (`oc`).
|
|
* You have a deployed image.
|
|
|
|
.Procedure
|
|
|
|
* To scale your application from one pod instance to two pod instances, enter the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc scale --current-replicas=1 --replicas=2 deployment/parksmap
|
|
----
|
|
+
|
|
.Example output
|
|
[source,text]
|
|
----
|
|
deployment.apps/parksmap scaled
|
|
----
|
|
|
|
.Verification
|
|
. To ensure that your application scaled properly, enter the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc get pods
|
|
----
|
|
+
|
|
.Example output
|
|
[source,terminal]
|
|
----
|
|
NAME READY STATUS RESTARTS AGE
|
|
parksmap-5f9579955-6sng8 1/1 Running 0 7m39s
|
|
parksmap-5f9579955-8tgft 1/1 Running 0 24s
|
|
----
|
|
|
|
. To scale your application back down to one pod instance, enter the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc scale --current-replicas=2 --replicas=1 deployment/parksmap
|
|
----
|