Skip to main content

Define an application for management

Contributors netapp-mwallis

You can define an application that you want to manage with Trident protect by creating an application CR and an associated AppVault CR.

Create an AppVault CR

You need to create an AppVault CR that will be used when performing data protection operations on the application, and the AppVault CR needs to reside on the cluster where Trident protect is installed. The AppVault CR is specific to your environment; for examples of AppVault CRs, refer to AppVault custom resources.

Create an application CR

You need to create an application CR to for each application that you want to manage with Trident protect. You can add an application for management by manually creating an application CR or by using the Trident protect CLI to create the CR.

Add an application using a CR
  1. Create the destination application CR file:

    1. Create the custom resource (CR) file and name it (for example, maria-app.yaml).

    2. Configure the following attributes:

      • metadata.name: (Required) The name of the application custom resource. Note the name you choose because other CR files needed for protection operations refer to this value.

      • spec.includedNamespaces: (Required) Use namespace labels or a namespace name to specify namespaces that the application resources exist in. The application namespace must be part of this list.

        Example YAML:

        apiVersion: protect.trident.netapp.io/v1
        kind: Application
        metadata:
          name: maria
          namespace: my-app-namespace
        spec:
          includedNamespaces:
            labelSelector: {}
            namespace: my-app-namespace
Add an application using the CLI
  1. Create and apply the application definition, replacing values in brackets with information from your environment. You can include namespaces and resources in the application definition using comma-separated lists with the arguments shown in the following example:

    tridentctl protect create application <my_new_app_cr_name> --namespaces <namespaces_to_include> --csr <cluster_scoped_resources_to_include>