Link Search Menu Expand Document

Remove an application

Removing an application will free quota resources and enable you to deploy other applications. OAM applications are defined by an application configuration entity that links all the components that form the application applying traits and scopes. To remove an application, you will need to delete all associated entities.


  • Playground tools are installed
    • playground
    • kubectl if you prefer to remove the application with it
playground login
Login success

Removing an application

The simplest way to remove an application is using the playground command, execute:

playground apps delete <appName>  

this command deletes the application and its components and scopes at once.

Anyway, there are two more methods to remove an application depending on how it was deployed and the access to the original sources.

In these cases you need to obtain kubeconfig file to connect to your cluster.

playground get-kubeconfig

Use this kubeconfig to connect to the cluster and deploy applications:
kubectl --kubeconfig <napptive-kubeconfig> ...

I deployed the app from a directory

If you created the application from a directory, you can use the following shortcut:

kubectl --kubeconfig <path_to>/napptive-kubeconfig delete -f /<path_to>/myapp

I want to remove an arbitrary app

To remove an application, identify which are the elements that compose it. The easiest method is to get the information from the application configuration.

kubectl --kubeconfig <path_to>/napptive-kubeconfig describe my-wordpress
    Component Name:  mysql-db
    Parameter Values:
      Name:   password
      Value:  root
      Name:   portNumber
      Value:  3306
      Scope Ref:
        API Version:
        Kind:         HealthScope
        Name:         wordpress-health
    Component Name:   wordpress
    Parameter Values:
      Name:   dbpass
      Value:  root
      Name:   host
      Value:  mysql-db
      Scope Ref:
        API Version:
        Kind:         HealthScope
        Name:         wordpress-health
        API Version:
        Kind:         ManualScalerTrait
          Name:  wordpress-replication
          Replica Count:  1

From the output we can identify that the application is composed by:

  • mysql-db and wordpress which are the two components of the application.
  • wordpress-health which is a HealthScope.
  • wordpress-replication which is a ManualScalerTrait.

To remove the app execute:

Remove the application

kubectl --kubeconfig <path_to>/napptive-kubeconfig delete my-wordpress "my-wordpress" deleted

the components

kubectl --kubeconfig <path_to>/napptive-kubeconfig delete mysql-db wordpress "mysql-db" deleted "wordpress" deleted

and the healthscope trait

kubectl --kubeconfig <path_to>/napptive-kubeconfig delete wordpress-health "wordpress-health" deleted

Note that the lifecycle of the ManualScalerTrait is linked with the application configuration, so it will be automatically removed.

Removing all applications

In case you want to remove all applications in your cluster, use the following commands:

Remove the applications

kubectl --kubeconfig <path_to>/napptive-kubeconfig delete --all

the components

kubectl --kubeconfig <path_to>/napptive-kubeconfig delete --all

the manualscaler traits

kubectl --kubeconfig <path_to>/napptive-kubeconfig delete --all

and remove the healthscope traits

kubectl --kubeconfig <path_to>/napptive-kubeconfig delete --all

A note on removal order

Notice that the order in which elements are removed is important as entities are linked together. Please follow the recommended order of removal. If you get an entity stuck in a finalizer, recreate the dependent entity and proceed with the removal process.

What’s next

  • Check our tutorials on how to deploy predefined applications