1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 21:46:22 +01:00
Files
openshift-docs/modules/getting-started-cli-scaling-app.adoc
2022-02-21 13:52:35 +00:00

63 lines
1.8 KiB
Plaintext

// Module included in the following assemblies:
//
// * getting-started/openshift-cli.adoc
:_content-type: PROCEDURE
[id="getting-started-cli-scaling-app_{context}"]
= Scaling the application
In Kubernetes, a `Deployment`(D) defines how an application deploys. In most cases, users use `Pod`, `Service`, `ReplicaSets`(RS), 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 are logged in to the {product-title} web console.
* You are in the xref:../web_console/odc-about-developer-perspective.adoc#odc-about-developer-perspective[*Developer* perspective].
* 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
----
.Scale down your application
* 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
----
.Additional resources
* xref:../cli_reference/openshift_cli/developer-cli-commands.adoc#oc-scale[oc scale]