Skip to content

Commit aacdf18

Browse files
committed
Made changes are more testing.
1 parent 4107e1f commit aacdf18

File tree

5 files changed

+46
-28
lines changed

5 files changed

+46
-28
lines changed

EKS/Migrate-Backup-EKS-Applications/README.md

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ Note that the above commands should install the latest version. If you want to i
113113

114114
### 6. Create Private S3 Bucket for Backup Data and Metadata
115115

116+
If you don't already have an S3 bucket, you can create one with the following command:
117+
116118
```markdown
117119
aws s3 mb s3://<bucket_name> --region <aws_region>
118120
```
@@ -168,7 +170,7 @@ spec:
168170
```
169171

170172
Replace:
171-
- `<APP VAULT NAME>` with the name you want assigned to the Trident Vault
173+
- `<APP VAULT NAME>` with the name you want assigned to the Trident Vault.
172174
- `<APP VAULT BUCKET NAME>` with the name of the bucket you created in step 6 above.
173175
- `<S3 ENDPOINT>` the hostname of the S3 endpoint. For example: `s3.us-west-2.amazonaws.com`.
174176

@@ -218,7 +220,7 @@ spec:
218220

219221
Replace:
220222
- `<APP NAMESPACE>` with the namespace where the application resides.
221-
- `<APP BACKUP NAME>` with the name you want assigned to the backup. This has to be unique.
223+
- `<APP BACKUP NAME>` with the name you want assigned to the backup. This has to be different from any other backup ever run.
222224
- `<APP NAME>` with the name of the application defined in the step above.
223225
- `<APP VAULT NAME>` with the name of the Trident Vault created in the step above.
224226

@@ -232,24 +234,20 @@ kubectl apply -f trident-backup.yaml
232234
To check the status of the backup run the following command:
233235

234236
```markdown
235-
kubectl get backup -n <APP NAMESPACE> <APP BACKUP NAME> -o jsonpath='{.status.state}'
237+
kubectl get backup -n <APP NAMESPACE> <APP BACKUP NAME>
236238
```
237239

238240
- If status is `Completed` Backup completed successfully .
239241
- If status is `Running` run the command again in a few minutes to check status.
240-
- If status is `Failed` or `Error` check the error message with:
241-
242-
```markdown
243-
kubectl get backup -n <APP NAMESPACE> <APP BACKUP NAME> -o jsonpath='{.status.error}'
244-
```
242+
- If status is `Failed` the error message will give you a clue as to what went wrong. If you need more information, try using `kubectl describe` instead of `kubectl get` to get more information.
245243

246244
## Perform a Restore of a Backup
247245
There are two ways to restore a backup:
248246
- [Restore backup to the same namespace](#restore-backup-to-the-same-namespace)
249247
- [Restore backup to a different namespace](#restore-backup-to-a-different-namespace)
250248

251249
### Restore backup to the same namespace
252-
To restore your appilcation in the same namespace, create an `BackupInPlaceRestore` configuration file named `backupinplacerestore.yaml` with the following contents:
250+
To restore your appilcation in the same namespace, create an `BackupInPlaceRestore` configuration file named `trident-restore-inplace.yaml` with the following contents:
253251

254252
```markdown
255253
apiVersion: protect.trident.netapp.io/v1
@@ -275,17 +273,17 @@ kubectl get backup -n <APP NAMESPACE> <APP BACKUP NAME> -o jsonpath='{.status.ap
275273
Once the yaml file is created, run the following command to start the restore:
276274

277275
```markdown
278-
kubectl apply -f backupinplacerestore.yaml
276+
kubectl apply -f trident-restore-inplace.yaml
279277
```
280278

281279
Verify application restore was successful run the following command:
282280

283281
```markdown
284-
kubectl get <APP BACKUP RESTORE NAME> -n <APP NAMESPACE> -o jsonpath='{.status.state}'
282+
kubectl get BackupInplaceRestore <APP BACKUP RESTORE NAME> -n <APP NAMESPACE>
285283
```
286284

287285
### Restore backup to a different namespace
288-
To restore the backup to a different namespace and optionally to a different storage class, you first need to create a restore configuration file named `trident-migrate.yaml` with the following contents:
286+
To restore the backup to a different namespace, you first need to create a restore configuration file named `trident-restore-diff-ns.yaml` with the following contents:
289287

290288
```markdown
291289
apiVersion: protect.trident.netapp.io/v1
@@ -299,9 +297,6 @@ spec:
299297
namespaceMapping:
300298
- source: <SOURCE NAMESPACE>
301299
destination: <DESTINATION NAMESPACE>
302-
storageClassMapping:
303-
- source: <SOURCE STORAGE CLASS>
304-
destination: <DESTINATION STORAGE CLASS>
305300
```
306301

307302
Replace:
@@ -310,33 +305,45 @@ Replace:
310305
- `<APP VAULT NAME>` with the name of the Trident Vault used when creating the backup.
311306
- `<SOURCE NAMESPACE>` with the namespace where the application was backed up from.
312307
- `<DESTINATION NAMESPACE>` with the namespace where you want the application to be restored to.
313-
- `<SOURCE STORAGE CLASS>` with the name of storage class of the PVCs in the source namespace.
314-
- `<DESTINATION STORAGE CLASS>` with the name of storage class you want to be used for the PVC(s) when the data is restored.
315308
- `<APP ARCHIVE PATH>` with the path to the backup archive. You can get this by running the following command:
316309

317-
Note that with the above example, you are migrating the PVCs from one storage class to another. If you don't want to do that, you can remove the `storageClassMapping` section from the yaml file.
318-
319310
```markdown
320311
kubectl get backup -n <APP NAMESPACE> <APP BACKUP NAME> -o jsonpath='{.status.appArchivePath}'
321312
```
322313

323-
Run the following command to start the restore:
314+
Once the yaml file has been created, run the following command to start the restore:
324315

325316
```markdown
326-
kubectl apply -f trident-migrate.yaml
317+
kubectl apply -f trident-restore-diff-ns.yaml
327318
```
328319

329320
You can check the status of the restore by running the following command:
330321

331322
```markdown
332-
kubectl get backuprestore -n <DESTINATION NAMESPACE> <APP RESTORE NAME> -o jsonpath='{.status.state}'
323+
kubectl get backuprestore -n <DESTINATION NAMESPACE> <APP RESTORE NAME>
333324
```
334325

335326
## Final Notes
336-
This is a simple example of how to use Trident Protect to backup and restore your application.
337-
There are a lot of other features and options available with Trident Protect that are not covered here for example:
338-
- Creating snapshots of your application.
327+
There are a lot of other features and options available with Trident Protect that are not covered here, for example:
328+
- Creating zero space snapshots of your application.
329+
- Restoring backups to a different storage class and therefore migrate the data from one storage class to another. You can refer to this [PV Migrate with Trident Protect](https://github.com/NetApp/FSx-ONTAP-samples-scripts/tree/main/EKS/FSxN-as-PVC-for-EKS) for an example of how to do that.
339330
- Scheduling backups.
340331
- Replicating backups to another FSxN file system with SnapMirror.
341332

342333
For more information please refer to the official [Trident Protect documentation](https://docs.netapp.com/us-en/trident/trident-protect/trident-protect-installation.html).
334+
335+
## Author Information
336+
337+
This repository is maintained by the contributors listed on [GitHub](https://github.com/NetApp/FSx-ONTAP-samples-scripts/graphs/contributors).
338+
339+
## License
340+
341+
Licensed under the Apache License, Version 2.0 (the "License").
342+
343+
You may obtain a copy of the License at [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0).
344+
345+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an _"AS IS"_ basis, without WARRANTIES or conditions of any kind, either express or implied.
346+
347+
See the License for the specific language governing permissions and limitations under the License.
348+
349+
© 2025 NetApp, Inc. All Rights Reserved.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
apiVersion: snapshot.storage.k8s.io/v1
2+
kind: VolumeSnapshotClass
3+
metadata:
4+
name: ebs-csi-snapclass
5+
driver: ebs.csi.aws.com
6+
deletionPolicy: Delete

EKS/Migrate-Backup-EKS-Applications/trident-migrate.yaml renamed to EKS/Migrate-Backup-EKS-Applications/trident-restore-diff-ns.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,3 @@ spec:
99
namespaceMapping:
1010
- source: <SOURCE NAMESPACE>
1111
destination: <DESTINATION NAMESPACE>
12-
storageClassMapping:
13-
- source: <SOURCE STORAGE CLASS>
14-
destination: <DESTINATION STORAGE CLASS>

EKS/Migrate-Backup-EKS-Applications/trident-restore.yaml renamed to EKS/Migrate-Backup-EKS-Applications/trident-restore-inplace.yaml

File renamed without changes.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: snapshot.storage.k8s.io/v1
2+
kind: VolumeSnapshotClass
3+
metadata:
4+
name: trident-csi-snapclass
5+
annotations:
6+
snapshot.storage.kubernetes.io/is-default-class: "true"
7+
driver: csi.trident.netapp.io
8+
deletionPolicy: Delete

0 commit comments

Comments
 (0)