Restart applications

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

Note

Restarting an application stops and then immediately restarts all the application 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 Tanzu Platform hub, Tanzu CLI, or kubectl.

    UI-based steps
    Do the following in 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 Restart. A confirmation pop-up appears.
    6. Click Restart to submit.
    Tanzu CLI-based steps
    Use Tanzu CLI commands to restart the application 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>
      
    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 Tanzu Platform hub or by using Tanzu CLI.

    UI-based steps
    Do the following in Tanzu Platform hub:
    1. Navigate 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 application instances.

      tanzu app instances <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.

check-circle-line exclamation-circle-line close-line
Scroll to top icon