441 | ```
442 | For example: `kubectl apply -f Samples/Volumes/pvc-sample.yaml`
443 |
444 | ### 4. Verify the Connection (Optional)
445 |
446 | After completing the deployment steps, verify if the connection is mapped in iSCSI & Fibre Channel on the NAS. You should locate the connection in the "iSCSI Target List" on the "iSCSI Storage" page, as shown in the red frame in Figure 2.
447 |
448 | [](https://postimg.cc/vDq1bsqN)
449 | Figure 2. Checking the iSCSI target connection.
450 |
451 |
452 | ## Operations
453 | ### Expanding a PVC
454 | ```
455 | kubectl edit pvc
456 | ```
457 | For example: `kubectl edit pvc pvc-sample`
458 |
459 | After a few seconds, the capacity will increase on the NAS.
460 | After the pod restarts, the capacity information will be updated.
461 |
462 | ### Cloning a PVC
463 |
464 | Create or edit the YAML file `Samples/Volumes/pvc-clone.yaml` based on your usage requirements.
465 |
466 | Example:
467 | ```yaml
468 | apiVersion: v1
469 | kind: PersistentVolumeClaim
470 | metadata:
471 | name: pvc-from-clone
472 | spec:
473 | accessModes:
474 | - ReadWriteOnce # iSCSI: ReadWriteOnce, Samba: ReadWriteMany
475 | resources:
476 | requests:
477 | storage: 5Gi
478 | dataSource:
479 | kind: PersistentVolumeClaim
480 | name: pvc-sample
481 | storageClassName: storageclass1
482 | ```
483 | Name the cloned PVC using the `name` field, configure the `storage` field, and assign the source PVC in the `dataSource` field.
484 | >[!Note]
485 | >The cloned PVC's storage size must be greater than or equal to that of the source PVC.
486 |
487 | After configuring the YAML file, run the following command:
488 | ```
489 | kubectl apply -f
490 | ```
491 | For example: `kubectl apply -f Samples/Volumes/pvc-clone.yaml`
492 |
493 |
494 | ### Importing a PVC
495 |
496 | iSCSI:
497 | Create or edit the YAML file `Samples/Volumes/pvc-import.yaml` based on your usage requirements.
498 | >[!NOTE]
499 | >Only iSCSI LUNs are supported.
500 |
501 | Example:
502 | ```yaml
503 | kind: PersistentVolumeClaim
504 | apiVersion: v1
505 | metadata:
506 | name: pvc-import-iscsi
507 | namespace: default
508 | annotations:
509 | trident.qnap.io/importOriginalName: "test"
510 | trident.qnap.io/importBackendName: "hero"
511 | spec:
512 | accessModes:
513 | - ReadWriteOnce
514 | resources:
515 | requests:
516 | storage: 10Gi
517 | storageClassName: storageclass1
518 | ```
519 | After configuring the YAML file, run the following command:
520 | ```
521 | kubectl apply -f
522 | ```
523 | For example: `kubectl apply -f Samples/Volumes/pvc-import.yaml`
524 |
525 | Samba:
526 | Create or edit the YAML file `Samples/Volumes/pvc-import.yaml` based on your usage requirements.
527 | ```yaml
528 | kind: PersistentVolumeClaim
529 | apiVersion: v1
530 | metadata:
531 | name: pvc-import-file
532 | annotations:
533 | trident.qnap.io/importOriginalName: "shared-name"
534 | trident.qnap.io/importBackendName: "qts"
535 | spec:
536 | accessModes:
537 | - ReadWriteMany
538 | resources:
539 | requests:
540 | storage: 10Gi #The value entered should correspond to the actual or displayed size.
541 | storageClassName: storageclass1
542 | ```
543 | >[!Note]
544 | >Due to filesystem limitations in QTS, the capacity shown in "Storage & Snapshot" may be slightly smaller than the specified size when creating a shared folder. For `resources.requests.storage`, enter either the specified size or the displayed size.
545 | For example:
546 | - Specified size: 10GB
547 | - Displayed size: 9.34GB.
548 | [](https://postimg.cc/zbkKFXC3)
549 |
In QuTS Hero, always use the specified size.
550 |
551 | ### Creating a VolumeSnapshot from a PVC
552 |
553 | Create or edit the YAML file `Samples/Snapshot/VolumeSnapshot.yaml` based on your usage requirements.
554 |
555 | Example:
556 | ```yaml
557 | apiVersion: snapshot.storage.k8s.io/v1
558 | kind: VolumeSnapshot
559 | metadata:
560 | name: pvc-snapshot
561 | spec:
562 | volumeSnapshotClassName: trident-snapshotclass
563 | source:
564 | persistentVolumeClaimName: pvc-sample
565 | ```
566 | After configuring the YAML file, run the following commands one at a time:
567 | ```
568 | kubectl apply -f
569 | ```
570 | ```
571 | kubectl apply -f
572 | ```
573 | Check the result.
574 | ```
575 | kubectl get volumesnapshot
576 | ```
577 |
578 | ### Creating a PVC from a Snapshot
579 | Create or edit the YAML file `Samples/Volumes/pvc-from-snapshot.yaml` based on your usage requirements.
580 |
581 | Example:
582 | ```yaml
583 | kind: PersistentVolumeClaim
584 | apiVersion: v1
585 | metadata:
586 | name: pvc-from-snap
587 | spec:
588 | accessModes:
589 | - ReadWriteOnce # iSCSI: ReadWriteOnce, Samba: ReadWriteMany
590 | resources:
591 | requests:
592 | storage: 5Gi
593 | dataSource:
594 | name: pvc-snapshot
595 | kind: VolumeSnapshot
596 | apiGroup: snapshot.storage.k8s.io
597 | storageClassName: storageclass1
598 | ```
599 |
600 | After configuring the YAML file, run the following command:
601 | ```
602 | kubectl apply -f
603 | ```
604 |
605 | ### Reboot
606 |
607 | Execute the following commands in order:
608 | ```
609 | kubectl delete tridentorchestrator trident
610 | ```
611 | ```
612 | kubectl apply -f Deploy/Trident/tridentorchestrator.yaml
613 | ```
614 | ### Uninstallation
615 | * Uninstalling via Kustomize (normal method)
616 | Execute the following commands in order:
617 | ```
618 | kubectl delete deployment trident-operator -n trident
619 | ```
620 | ```
621 | ./ uninstall -n trident
622 | ```
623 | ```
624 | kubectl delete tridentorchestrator trident
625 | ```
626 |
627 | * Uninstalling via Helm
628 | ```
629 | helm delete qnap-trident -n trident
630 | ```
--------------------------------------------------------------------------------