Define an application for management with Trident protect
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.
-
Create the destination application CR file:
-
Create the custom resource (CR) file and name it (for example,
maria-app.yaml
). -
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.
-
metadata.annotations.protect.trident.netapp.io/skip-vm-freeze: (Optional) This annotation is only applicable to applications defined from virtual machines, such as in KubeVirt environments, where filesystem freezes occur before snapshots. Specify whether this application can write to the filesystem during a snapshot. If set to true, the application ignores the global setting and can write to the filesystem during a snapshot. If set to false, the application ignores the global setting and the filesystem is frozen during a snapshot. If specified but the application has no virtual machines in the application definition, the annotation is ignored. If not specified, the application follows the global Trident protect freeze setting.
If you need to apply this annotation after an application has already been created, you can use the following command:
kubectl annotate application -n <application CR namespace> <application CR name> protect.trident.netapp.io/skip-vm-freeze="true"
Example YAML:
apiVersion: protect.trident.netapp.io/v1 kind: Application metadata: annotations: protect.trident.netapp.io/skip-vm-freeze: "false" name: my-app-name namespace: my-app-namespace spec: includedNamespaces: - labelSelector: {} namespace: namespace-1 - labelSelector: {} namespace: namespace-2
-
-
-
After you create the application CR to match your environment, apply the CR. For example:
kubectl apply -f maria-app.yaml
-
Create and apply the application definition using one of the following examples, 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 examples.
You can optionally use an annotation when you create an app to specify whether the application can write to the filesystem during a snapshot. This is only applicable to applications defined from virtual machines, such as in KubeVirt environments, where filesystem freezes occur before snapshots. If you set the annotation to
true
, the application ignores the global setting and can write to the filesystem during a snapshot. If you set it tofalse
, the application ignores the global setting and the filesystem is frozen during a snapshot. If you use the annotation but the application has no virtual machines in the application definition, the annotation is ignored. If you don't use the annotation, the application follows the global Trident protect freeze setting.To specify the annotation when you use the CLI to create an application, you can use the
--annotation
flag.-
Create the application and use the global setting for filesystem freeze behavior:
tridentctl-protect create application <my_new_app_cr_name> --namespaces <namespaces_to_include> --csr <cluster_scoped_resources_to_include> --namespace <my-app-namespace>
-
Create the application and configure the local application setting for filesystem freeze behavior:
tridentctl-protect create application <my_new_app_cr_name> --namespaces <namespaces_to_include> --csr <cluster_scoped_resources_to_include> --namespace <my-app-namespace> --annotation protect.trident.netapp.io/skip-vm-freeze=<"true"|"false">
-