After you deploy an application, you can scale the application by updating its runtime to change the number of app instances (horizontal scaling) and edit the CPU and memory configuration (vertical scaling).
Changing the number of app instances manually allows you to perform horizontal scaling in a static fashion. To instead use automatic horizontal scaling, see Configure horizontal autoscaling of an application.
The
tanzu app scale
command includes an interactive mode. When you runtanzu app scale <APP-NAME>
, the command prompts you to provide a new value for the application instance count, CPU, and memory.The CPU and memory values that you provide are applied to all app instances. For example, if you configure 3 instances with 300M CPU and 1Gi memory each, this consumes 900M CPU and 3Gi memory in total. Only resources for which you provide a value are updated.
Update the app instance count
You can scale an application by updating the number of app instances per Space replica.
- UI-based steps
- Do the following in the Tanzu Platform UI:
- Set the Project context to your Project.
- On the left navigation pane, go to Spaces > Overview.
- Click on your Space.
- Select the Applications tab and then click on your application.
- Click the Scale button.
- In the window that opens, update App instances to specify the number of app instances per Space replica. Leaving the field empty removes the configuration from the underlying resource.
- Click Save.
- Tanzu CLI-based steps
- Use Tanzu CLI commands to update the number of app instances.
-
Use the Tanzu CLI to ensure that your Project and Space are set correctly by running:
tanzu project use PROJECT-NAME tanzu space use SPACE-NAME
-
Update the number of app instances per Space replica by running:
tanzu app scale APP-NAME --instances=10
Where
APP-NAME
is theContainerApp
name of your application. -
To delete the application replica count configuration, run the
tanzu app scale
command without specifying a number of replicas:tanzu app scale APP-NAME --instances-
This command keeps the current number of replicas running unless the currently enforced number of instances is
0
. If the enforced number of instances is0
, the default number of replicas is started instead. This number is most likely1
unless the app was custom built with other default values.
-
Update application CPU and memory
You can scale an application by updating the application CPU and memory configuration for all app instances in each Space replica.
- UI-based steps
- Do the following in the Tanzu Platform UI:
- Set the Project context to your Project.
- On the left navigation pane, go to Spaces > Overview.
- Click on your Space.
- Select the Applications tab and click on your application.
- Scroll to Requested Resources and click the Edit button.
- In the window that opens, update the CPU and Memory resources. Leaving the fields empty removes the configuration from the underlying resource.
- Click Save.
- Tanzu CLI-based steps
- Use Tanzu CLI commands to update the application CPU configuration in each Space replica.
-
Use the Tanzu CLI to ensure that your Project and Space are set correctly by running:
tanzu project use PROJECT-NAME tanzu space use SPACE-NAME
-
Update the application CPU configuration in each Space replica by running:
tanzu app scale <APP-NAME> --cpu=10
Where
<APP-NAME>
is theContainerApp
name of your application.You can provide either a number of cores, such as
--cpu=10
, or a number of millicores, such as500m
. -
Delete the application CPU configuration by running:
tanzu app scale <APP-NAME> --cpu-
-
Update the application memory configuration in each Space replica by running:
tanzu app scale <APP-NAME> --memory=500M
By default, memory configuration is in bytes. You can also use any of the other quantity suffixes described in the Kubernetes documentation.
-
Delete the application memory configuration by running:
tanzu app scale <APP-NAME> --memory-
-
Content feedback and comments