You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -4,34 +4,28 @@ A simple sample for setting up your application to be backed up by Trident Prote
4
4
5
5
## Prerequisites:
6
6
The following items should be already be deployed before install Trident Protect.
7
-
- EKS cluster. If you don't already have one, refer to the [FSx for NetApp ONTAP as persistent storage](https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/EKS/FSxN-as-PVC-for-EKS) GitHub repo for an example of how to not only deploy an EKS cluster, but also deploy an FSx for ONTAP file system with Tident installed and its backend and storage classes configured.
7
+
- EKS cluster. If you don't already have one, refer to the [FSx for NetApp ONTAP as persistent storage](https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/EKS/FSxN-as-PVC-for-EKS) GitHub repo for an example of how to not only deploy an EKS cluster, but also deploy an FSx for ONTAP file system with Tident installed and its backend and storage classes configured. If you follow it, it will provide the rest of the prerequisites listed below.
8
8
- Trident installed. Please refer to this [Trident installation documentation](https://docs.netapp.com/us-en/trident/trident-get-started/kubernetes-deploy-helm.html) for the easiest way to do that.
9
-
- Configure Trident Backend. Refer to the NetApp Trident documentation for guidance on creating [TridentBackendConfig resources](https://docs.netapp.com/us-en/trident/trident-use/backend-kubectl.html)
10
-
- Install the Trident CSI drivers for SAN and NAS type storage. Refer to NetApp documentation for [installation instructions](https://docs.netapp.com/us-en/trident/trident-use/ontap-san-examples)
11
-
This guide provides steps to set up and configure a StorageClass using ONTAP NAS backends with Trident.
9
+
- Configure Trident Backend. Refer to the NetApp Trident documentation for guidance on creating [TridentBackendConfig resources](https://docs.netapp.com/us-en/trident/trident-use/backend-kubectl.html).
10
+
- Install the Trident CSI drivers for SAN and NAS type storage. Refer to NetApp documentation for [installation instructions](https://docs.netapp.com/us-en/trident/trident-use/trident-fsx-storage-backend.html).
11
+
- Configure a StorageClass Trident for SAN and/or NAS type storage. Refer to NetApp documentation for [instructions](https://docs.netapp.com/us-en/trident/trident-use/trident-fsx-storageclass-pvc.html).
12
12
- kubectl installed - Refer to [this documentation](https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/) on how to install it.
13
13
- helm installed - Refer to [this documentation](https://helm.sh/docs/intro/install/) on how to install it.
14
14
15
15
## Preperation
16
16
The following are the steps required before you can use Trident Protect to backup your EKS application.
1.[Create Kubernetes secret for S3 bucket](#7-create-a-kubernetes-secret-for-the-s3-bucket)
22
25
23
-
### 1. Install Trident Protect
24
-
Execute the following commands to install Trident Protect. For more info please consult official [Trident Protect documentation](https://docs.netapp.com/us-en/trident/trident-protect/trident-protect-installation.html).
26
+
### 1. Make sure Trident Backend is configured correctly
### 2. Make sure Trident Backend is configured correctly
33
-
34
-
Run the follwing kubectl commands to check if TridentBackendConfig for ontap-san and ontap-nas exists and configured correctly, It outputs the name of any matching TridentBackendConfig:
28
+
Run the follwing kubectl commands to check if TridentBackendConfig for ontap-san and ontap-nas exists and configured correctly. These commands should output the name of any matching TridentBackendConfigs:
kubectl get tbc -n trident -o jsonpath='{.items[?(@.spec.storageDriverName=="ontap-san")].metadata.name}'
37
+
kubectl get tbc -n trident -o jsonpath='{.items[?(@.spec.storageDriverName=="ontap-nas")].metadata.name}'
44
38
```
45
39
46
40
If no matching TridentBackendConfig resources are found, you may need to create one. Refer to the prerequisites section above for more information on how to do that.
47
-
### 3. Make Sure Trident CSI Drivers for NAS and SAN are Installed
41
+
### 2. Make Sure Trident CSI Drivers for NAS and SAN are Installed
48
42
Run the follwing kubectl commands to check that a storageclass exist for both SAN and NAS type storage.
49
43
50
-
#### SAN Driver
44
+
#### SAN StorageClass
51
45
Checks for StorageClasses in Kubernetes that use 'ontap-san' as their backend type. It outputs the name of any matching StorageClass:
52
46
```bash
53
47
kubectl get storageclass -o jsonpath='{.items[?(@.parameters.backendType=="ontap-san")].metadata.name}'
@@ -61,8 +55,59 @@ kubectl get storageclass -o jsonpath='{.items[?(@.parameters.backendType=="ontap
61
55
62
56
If one or both are not found, you may need to create them. Refer to the prerequisites section above for more information on how to do that.
63
57
58
+
### 3. Install the Kubernetes External Snapshotter
59
+
Run the following commands to install the Kubernetes External Snapshotter. For more information please consult the official [external-snapshotter documentation](https://github.com/kubernetes-csi/external-snapshotter).
### 4. Create VolumeSnapshotClasses for your storage provider.
68
+
Trident Protect requires a VolumeSnapshotClass to be created for the storage CSI driver you are using. You can use the following command to see if you already one defined:
69
+
```
70
+
kubectl get VolumeSnapshotClass
71
+
```
72
+
If you don't have one defined you'll need to create one. Here is an example of a yaml file that defines a VolumeSnapshotClass for Trident CSI driver:
Here is an example of a yaml file that defines a VolumeSnapshotClass for EBS CSI driver:
85
+
```
86
+
apiVersion: snapshot.storage.k8s.io/v1
87
+
kind: VolumeSnapshotClass
88
+
metadata:
89
+
name: ebs-csi-snapclass
90
+
driver: ebs.csi.aws.com
91
+
deletionPolicy: Delete
92
+
```
93
+
94
+
After creating the yaml file with the VolumeSnapshotClass for your CSI driver, run the following command to create the VolumeSnapshotClass:
95
+
96
+
```bash
97
+
kubectl apply -f <VolumeSnapshotClass.yaml>
98
+
```
99
+
100
+
### 5. Install Trident Protect
101
+
Execute the following commands to install Trident Protect. For more info please consult official [Trident Protect documentation](https://docs.netapp.com/us-en/trident/trident-protect/trident-protect-installation.html).
Note that the above commands should install the latest version. If you want to install a specific version add the --version option and provide the version you want to sue. Please use version `100.2410.1` or later.
64
109
65
-
### 4. Create Private S3 Bucket for Backup Data and Metadata
110
+
### 6. Create Private S3 Bucket for Backup Data and Metadata
-`<APP VAULT NAME>` with the name you want assigned to the Trident Vault
111
164
-`<APP VAULT BUCKET NAME>` with the name of the bucket you created in step 5 above.
112
-
-`<AWS_REGION>` with the AWS region the s3 bucket was created in.
113
-
-`<accessKeyID>` with the access key ID that has access to the S3 bucket.
114
-
-`<secretAccessKey>` with the secret that is associated with the access key ID.
165
+
-`<S3 ENDPOINT>` the hostname of the S3 endpoint. For example: `s3.us-west-2.amazonaws.com`.
115
166
116
167
Now run the following command to create the Trident Vault:
117
168
@@ -128,14 +179,14 @@ If you want to avoid storing AWS credentials explicitly in Kubernetes secrets, a
128
179
- Create a Kubernetes service account in the trident-protect namespace and associate it with the IAM role
129
180
130
181
### Create a Trident Application
131
-
Create a Trident application to backup your application by first creating a file named `trident-application.yaml` with the following contents:
182
+
You create a Trident application with the specification of your application in order to back it up. You do that by creating a file named `trident-application.yaml` with the following contents:
-[Restore backup to a different namespace](#restore-backup-to-a-different-namespace)
248
+
-[Restore backup to the same namespace](#restore-backup-to-the-same-namespace)
249
+
250
+
### Restore backup to a different namespace
251
+
To restore the backup you created above to a different namespace, you first need to create a restore configuration file named `trident-restore.yaml` with the following contents:
252
+
253
+
```markdown
254
+
apiVersion: protect.trident.netapp.io/v1
255
+
kind: BackupRestore
256
+
metadata:
257
+
name: <APP RESTORE NAME>
258
+
namespace: <DESTINATION NAMESPACE>
259
+
spec:
260
+
appArchivePath: <APP ARCHIVE PATH>
261
+
appVaultRef: <APP VAULT NAME>
262
+
namespaceMapping:
263
+
- source: <SOURCE NAMESPACE>
264
+
destination: <DESTINATION NAMESPACE>
265
+
```
266
+
267
+
Where:
268
+
- `<APP RESTORE NAME>` with the name you want to assign the restore configuration
269
+
- `<DESTINATION NAMESPACE>` with the namespace where you want to restore the application
270
+
- `<APP VAULT NAME>` with the name of the backup configuration used to create the backup you want to restore from.
271
+
- `<SOURCE NAMESPACE>` with the namespace where the application was backed up from.
272
+
- `<DESTINATION NAMESPACE>` with the namespace where you want the application to be restored to.
273
+
- `<APP ARCHIVE PATH>` with the path to the backup archive. You can get this by running the following command:
Note in the above example, not only are we reestoring to the same namespace, but we are also migrating the PVCs from one storage class to anther. If you don't want to do that, you can remove the `storageClassMapping` section from the yaml file.
220
320
221
-
Run the following command to keep the application in place while migrating application's PVC from gp3 to trident-csi-nas
321
+
Once the yaml file is created, run the following command to start the restore:
222
322
223
323
```markdown
224
324
kubectl apply -f backupinplacerestore.yaml
225
325
```
226
326
227
-
Verify application restore was successful and check PVC storage class:
327
+
Verify application restore was successful run the following command:
228
328
229
329
```markdown
230
-
kubectl get <APP BACKUP RESTORE NAME> -n trident-protect -o jsonpath='{.status.state}'
231
-
kubectl get pvc <PVC NAME> -n <NAMESPACE> -o jsonpath='{.spec.storageClassName}'
0 commit comments