You can stop running applications by using the Tanzu Platform UI or the Tanzu CLI, for example for bug fixing or troubleshooting purposes. You can then subsequently start the application again.
Stopping 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.
Stop a running application
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 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 Stop. A confirmation pop-up appears.
- Click Stop to submit.
- Tanzu CLI-based steps
- Use Tanzu CLI commands to stop the application instances.
-
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- You can also stop 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>
-
Edit the
stopped
field in theContainerApp
spec, setting it totrue
.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 toStopped
. In case of failures, the status changes toDeployFailed
. -
View the state of the application.
As the application stop is requested, you can observe the state of the application in the Tanzu Platform UI or using Tanzu CLI.
- UI-based steps
- Do the following in the Tanzu Platform UI:
-
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 showsStopped
. -
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.
-
- Tanzu CLI-based steps
- Use Tanzu CLI commands to observe the state of the application.
-
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 theOverview
section showsStopping
. If the application has stopped completely, the status showsStopped
. You can also use thetanzu app instances <APP-NAME>
command to observe the details of the application instances while the application is stopping.
-
Start a previously stopped application
You can start the previously stopped application in a Space by using the Tanzu Platform UI 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 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 Start. A confirmation pop-up appears.
- Click Start to submit.
- Tanzu CLI-based steps
- Use Tanzu CLI commands to start the application instances.
-
Make sure that your Space context is set correctly.
tanzu project use PROJECT-NAME
tanzu space use SPACE-NAME
-
Start the application.
tanzu app start <APP-NAME>
-
kubectl
-based steps- You can also start 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>
-
Edit the
stopped
field in theContainerApp
spec, setting it tofalse
.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 toRunning
. In case of failures, the status changes toDeployFailed
. -
View the state of the application
After you start the application, you can observe the state of the application in the Tanzu Platform UI or by using the Tanzu CLI.
- UI-based steps
- Do the following in the Tanzu Platform UI:
-
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 showsRunning
. -
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.
-
- Tanzu CLI-based steps
- Use Tanzu CLI commands to observe the state of the application.
-
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 showsDeploying
. If the application has started fully, the status showsRunning
. You can also use thetanzu app instances <APP-NAME>
command to observe details of the application instances after starting the application.
-
Content feedback and comments