After you deploy an application, you can scale the application by updating its runtime to change the number of application instances and edit the CPU and memory configuration.
NoteThe
tanzu app scale
command includes an interactive mode. When you runtanzu app scale <APP-NAME>
, the command prompts you to provide new values for each of the application instance count, CPU, and memory.The CPU and memory values that you provide are applied to all application 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.
You can scale an application by updating the number of application instances per Space replica. A Space replica is an availability target for an application.
Use the Tanzu CLI to ensure that your project context is set correctly.
tanzu project use PROJECT-NAME
To update the number of application instances per Space replica, run the tanzu app scale
command with the --instances
option.
tanzu app scale <APP-NAME> --instances=10
In the example above, <APP-NAME>
is the ContainerApp
name of your application.
To delete the application instance count configuration without specifying a number of instances, run:
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 is 0
, the default number of replicas is started instead. This number is most likely 1
unless the app was custom built with other default values.
You can scale an application by updating the application CPU and memory configuration for all application instances in each Space replica.
Use the Tanzu CLI to ensure that your project context is set correctly.
tanzu project use PROJECT-NAME
To update the application CPU configuration in each Space replica, run the tanzu app scale
command with the --cpu
option.
You can provide either a number of cores, for example --cpu=10
, or a number of millicores, for example 500m
.
tanzu app scale <APP-NAME> --cpu=10
In the example above, <APP-NAME>
is the ContainerApp
name of your application.
To delete the application CPU configuration, run the tanzu app scale
command without specifying a number of CPUs.
tanzu app scale <APP-NAME> --cpu-
To update the application memory configuration in each Space replica, run the tanzu app scale
command with the --memory
option.
By default memory configuration is in bytes, but you can also use any of the quantity suffixes described in Memory resource units in the Kubernetes documentation.
tanzu app scale <APP-NAME> --memory=500M
To delete the application memory configuration, run the tanzu app scale
command without specifying a quantity of memory.
tanzu app scale <APP-NAME> --memory-