After you deploy an application, you can scale it by updating its runtime to change the number of app replicas and modify 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 app replica count, CPU, and memory. The CPU and memory values that you provide are applied to all app replicas. For example, if you configure 3 replicas 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 app by updating the number of app replicas per Space replica. A Space replica is an availability target for an app.
In the window that opens, update App replicas to specify the number of app replicas per space replica.
Leaving the field empty removes the configuration from the underlying resource.
Use the Tanzu CLI to ensure that your project context is set correctly.
tanzu project use PROJECT-NAME
To update the number of app replicas per Space replica, run the tanzu app scale
command with the --replicas
option.
tanzu app scale <APP-NAME> --replicas=10
In the example above, <APP-NAME>
is the ContainerApp
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> --replicas-
You can scale an app by updating the application CPU and memory configuration for all application replicas in each Space replica.
In the window that opens, update the CPU and Memory resources.
Leaving the fields empty removes the configuration from the underlying resource.
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-