Scale applications

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.

Note

The tanzu app scale command includes an interactive mode. When you run tanzu 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.

Update the application replica count

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.

UI-based steps
Do the following on the Tanzu Platform hub:
  1. Set the project context to your project.
  2. On the left navigation pane, expand Application Spaces.
  3. Click Spaces and select your Space.
  4. Select the Applications tab and click on your application.
  5. Click the Scale button.
  6. 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.

  7. Click Save.
Tanzu CLI-based steps
Use Tanzu CLI commands to update the number of application replicas.
  1. Use the Tanzu CLI to ensure that your project context is set correctly.

    tanzu project use PROJECT-NAME
    
  2. 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.

  3. 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-
    

Update application CPU and memory

You can scale an app by updating the application CPU and memory configuration for all application replicas in each Space replica.

UI-based steps
Do the following on the Tanzu Platform hub:
  1. Set the project context to your project.
  2. On the left navigation pane, expand Application Spaces.
  3. Click Spaces and select your Space.
  4. Select the Applications tab and click on your application.
  5. Scroll to Requested Resources and click the Edit button.
  6. In the window that opens, update the CPU and Memory resources.

    Leaving the fields empty removes the configuration from the underlying resource.

  7. Click Save.
Tanzu CLI-based steps
Use Tanzu CLI commands to update the application CPU configuration in each Space replica.
  1. Use the Tanzu CLI to ensure that your project context is set correctly.

    tanzu project use PROJECT-NAME
    
  2. 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.

  3. To delete the application CPU configuration, run the tanzu app scale command without specifying a number of CPUs.

    tanzu app scale <APP-NAME> --cpu-
    
  4. 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
    
  5. To delete the application memory configuration, run the tanzu app scale command without specifying a quantity of memory.

    tanzu app scale <APP-NAME> --memory-
    
check-circle-line exclamation-circle-line close-line
Scroll to top icon