Tanzu Platform SaaS

Restart applications

Last Updated February 19, 2025

After you deploy an application to a Space, you can restart the application by using the Tanzu Platform UI or the Tanzu CLI.

Restarting an application stops and then immediately restarts all the app instances across all Availability Targets. To stop an application without restarting it immediately, see Stop and start applications.

For information about how to build and deploy and application to a Space, see Build and deploy an application from source.

  1. Restart the application

    You can restart an application using the Tanzu Platform UI, Tanzu CLI, or kubectl.

    UI-based steps
    Do the following in the Tanzu Platform UI:
    1. Set the project context to your project.
    2. On the left navigation pane, go to Spaces > Overview.
    3. Select your Space.
    4. Select the Applications tab and click on your application.
    5. Click Restart. A confirmation pop-up appears.
    6. Click Restart to submit.
    Tanzu CLI-based steps
    Use Tanzu CLI commands to restart the app instances.
    1. Make sure that you are using the latest Tanzu CLI build plug-in by running:
    tanzu plugin upgrade build
    
    1. Make sure that your project and Space context is set correctly.

      tanzu project use PROJECT-NAME
      
      tanzu space use SPACE-NAME
      
    2. Restart the application.

      tanzu app restart APP-NAME
      
    kubectl-based steps
    You can also restart the application declaratively by updating the ContainerApp Kubernetes resource.
    1. From the context of your Space, get the kubeconfig.

      tanzu context current
      
    2. Copy the path to the kubeconfig from the Kube config: section of the output.

    3. Set your KUBECONFIG

      export KUBECONFIG=COPIED-PATH
      

      Where COPIED-PATH is the path you copied in the previous step.

    4. Edit the restartNonce field in the ContainerApp spec, setting it to a unique string. The string must be different than the currently applied string.

      kubectl edit containerapps.apps.tanzu.vmware.com CONTAINER-APP-NAME
      
    5. Add the following section to the spec:

      spec:
       ...
       restartNonce: "UNIQUE-STRING"
       ...
      

      Save the changes. The system will notice this update and restart the app as a result.

During the restart, the application status changes to Deploying. After the application is restarted successfully across all instances, the status changes to Running / DeploySucceeded. In case of failures, the status changes to DeployFailed.

  1. View the state of each replica

    As the restart is rolled out, you can observe the state of each replica in the Tanzu Platform UI or by using Tanzu CLI.

    UI-based steps
    Do the following in the Tanzu Platform UI:
    1. Go to the application page similar to above.
    2. Scroll down to the Applications Instances widget.
    3. See the Version status column for each instance.

      The status is Up-to-date if the app has been restarted with the latest changes.

      The status is Out-of-date if the restart is still being rolled out and an older version currently deployed.

    Tanzu CLI-based steps
    Use Tanzu CLI commands to observe the state of each replica.
    1. Make sure that your project and Space context is set correctly.

      tanzu project use PROJECT-NAME
      
      tanzu space use SPACE-NAME
      
    2. Observe the app instances.

      tanzu app instance list APP-NAME
      

      See the VERSION-STATUS column for each instance.

      The status is Up-to-date if the app has been restarted with the latest changes.

      The status is Out-of-date if the restart is still being rolled out and an older version currently deployed.