Skip to main content

Define an application for management with Trident protect

Contributors netapp-mwallis netapp-aruldeepa

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.

Define an application

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

Add an application using a CR
Steps
  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:
            - namespace: my-app-namespace
  2. After you create the application CR to match your environment, apply the CR. For example:

    kubectl apply -f maria-app.yaml
Add an application using the CLI
Steps
  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> --namespace <my-app-namespace>