You can stop running applications by using Tanzu Platform hub or the Tanzu CLI, for example for bug fixing or troubleshooting purposes. You can then subsequently start the application again.
NoteStopping an application stops all the application instances across all Availability Targets. You must then manually start the application again. If you want to restart an application so that it stops and then starts again immediately, see Restart applications.
For information about how to build and deploy and application to a Space, see Build and deploy an application from source.
After you deploy an application to a Space, stopping a running application stops all of the application instances across all Availability Targets.
Stop the application.
You can stop a running application using Tanzu Platform hub, Tanzu CLI, or kubectl
.
Make sure that your Space context is set correctly.
tanzu project use PROJECT-NAME
tanzu space use SPACE-NAME
Stop the application.
tanzu app stop <APP-NAME>
kubectl
-based steps
From the context of your Space, get the kubeconfig
.
tanzu context current
Copy the path to the kubeconfig
from the Kube config:
section of the output.
Set your KUBECONFIG
export KUBECONFIG=<COPIED-PATH>
Edit the stopped
field in the ContainerApp
spec, setting it to true
.
kubectl edit containerapps.apps.tanzu.vmware.com CONTAINER-APP-NAME
Add the following section to the spec:
spec:
...
stopped: true
...
Save the changes. The system will notice this update and stop the application as a result.
While the application is stopping, the application status changes to Stopping
. After the application is stopped successfully across all instances, the status changes to Stopped
. In case of failures, the status changes to DeployFailed
.
View the state of the application.
As the application stop is requested, you can observe the state of the application in Tanzu Platform hub or using Tanzu CLI.
Navigate to the application page in the same way as in the previous step.
If the application is in the process of stopping, the status under the application name in the top left corner shows Stopping
. If the application has stopped completely, it shows Stopped
.
Scroll down to the Applications Instances widget.
If the application is in the process of stopping, you will see the current running instances. When the application has stopped completely, you will not see any application instances.
Set your Space context.
tanzu project use PROJECT-NAME
tanzu space use SPACE-NAME
Observe the application status.
tanzu app get <APP-NAME>
If the application is in the process of stopping, the Status
in the Overview
section shows Stopping
. If the application has stopped completely, the status shows Stopped
. You can also use the tanzu app instances <APP-NAME>
command to observe the details of the application instances while the application is stopping.
You can start the previously stopped application in a Space by using Tanzu Platform hub or the Tanzu CLI. Starting the application starts all the application instances across all Availability Targets.
Start the stopped application
You can start the previously stopped application using Tanzu Platform hub, Tanzu CLI, or kubectl
.
1. Make sure that your Space context is set correctly.
```console
tanzu project use PROJECT-NAME
tanzu space use SPACE-NAME
Start the application.
tanzu app start <APP-NAME>
kubectl
-based steps
From the context of your Space, get the kubeconfig
.
tanzu context current
Copy the path to the kubeconfig
from the Kube config:
section of the output.
Set your KUBECONFIG
export KUBECONFIG=<COPIED-PATH>
Edit the stopped
field in the ContainerApp
spec, setting it to false
.
kubectl edit containerapps.apps.tanzu.vmware.com CONTAINER-APP-NAME
Add the following section to the spec:
spec:
...
stopped: false
...
Save the changes. The system will notice the update and start the application.
While the application is being started, the application status changes to Deploying
. After the application has started successfully across all instances, the status changes to Running
. In case of failures, the status changes to DeployFailed
.
View the state of the application
After you start the application, you can observe the state of the application in Tanzu Platform hub or by using the Tanzu CLI.
Navigate to the application page in the same way as in the previous step.
The status under the application name in the top left corner of the application page shows Deploying
if the application is in the process of starting. Once the application has fully started, it shows Running
.
Scroll down to the Applications Instances widget.
If the application is in the process of starting, you see the currently running instances. Once the application has fully started, you see all of the running application instances.
Set your Space context.
tanzu project use PROJECT-NAME
tanzu space use SPACE-NAME
Observe the application status.
tanzu app get <APP-NAME>
If the application is in the process of starting, the status in the application Overview
section shows Deploying
. If the application has started fully, the status shows Running
. You can also use the tanzu app instances <APP-NAME>
command to observe details of the application instances after starting the application.