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.
-
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:
- Set the project context to your project.
- On the left navigation pane, go to Spaces > Overview.
- Select your Space.
- Select the Applications tab and click on your application.
- Click Restart. A confirmation pop-up appears.
- Click Restart to submit.
- Tanzu CLI-based steps
- Use Tanzu CLI commands to restart the app instances.
- Make sure that you are using the latest Tanzu CLI
build
plug-in by running:
tanzu plugin upgrade build
-
Make sure that your project and Space context is set correctly.
tanzu project use PROJECT-NAME
tanzu space use SPACE-NAME
-
Restart the application.
tanzu app restart APP-NAME
- Make sure that you are using the latest Tanzu CLI
kubectl
-based steps- You can also restart the application declaratively by updating the ContainerApp Kubernetes resource.
-
From the context of your Space, get the
kubeconfig
.tanzu context current
-
Copy the path to the
kubeconfig
from theKube config:
section of the output. -
Set your KUBECONFIG
export KUBECONFIG=COPIED-PATH
Where
COPIED-PATH
is the path you copied in the previous step. -
Edit the
restartNonce
field in theContainerApp
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
-
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
.
-
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:
- Go to the application page similar to above.
- Scroll down to the Applications Instances widget.
-
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.
-
Make sure that your project and Space context is set correctly.
tanzu project use PROJECT-NAME
tanzu space use SPACE-NAME
-
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.
-
Content feedback and comments