Trident Protect AppVault 객체를 사용하여 버킷을 관리합니다.
Trident Protect의 버킷 사용자 정의 리소스(CR)는 AppVault로 알려져 있습니다. AppVault 객체는 스토리지 버킷의 선언적 Kubernetes 워크플로 표현입니다. AppVault CR에는 백업, 스냅샷, 복원 작업, SnapMirror 복제와 같은 보호 작업에 버킷을 사용하는 데 필요한 구성이 포함되어 있습니다. 관리자만 AppVault를 만들 수 있습니다.
키 생성 및 AppVault 정의 예
AppVault CR을 정의할 때 공급자가 호스팅하는 리소스에 액세스하려면 자격 증명을 포함해야 합니다. 자격 증명에 대한 키를 생성하는 방법은 공급자에 따라 다릅니다. 다음은 여러 공급자에 대한 명령줄 키 생성 예제와 각 공급자에 대한 AppVault 정의 예입니다.
키 생성 예
다음 예제를 사용하여 각 클라우드 공급자의 자격 증명에 대한 키를 생성할 수 있습니다.
kubectl create secret generic <secret-name> --from-file=credentials=<mycreds-file.json> -n trident-protect
kubectl create secret generic <secret-name> --from-literal=accessKeyID=<objectstorage-accesskey> --from-literal=secretAccessKey=<generic-s3-trident-protect-src-bucket-secret> -n trident-protect
kubectl create secret generic <secret-name> --from-literal=accountKey=<secret-name> -n trident-protect
kubectl create secret generic <secret-name> --from-literal=accessKeyID=<objectstorage-accesskey> --from-literal=secretAccessKey=<generic-s3-trident-protect-src-bucket-secret> -n trident-protect
kubectl create secret generic <secret-name> --from-literal=accessKeyID=<objectstorage-accesskey> --from-literal=secretAccessKey=<generic-s3-trident-protect-src-bucket-secret> -n trident-protect
kubectl create secret generic <secret-name> --from-literal=accessKeyID=<objectstorage-accesskey> --from-literal=secretAccessKey=<generic-s3-trident-protect-src-bucket-secret> -n trident-protect
AppVault CR 예
다음 CR 예제를 사용하여 각 클라우드 공급자에 대한 AppVault 개체를 만들 수 있습니다.
apiVersion: protect.trident.netapp.io/v1
kind: AppVault
metadata:
name: gcp-trident-protect-src-bucket-b643cc50-0429-4ad5-971f-ac4a83621922
namespace: trident-protect
spec:
providerType: GCP
providerConfig:
gcp:
bucketName: trident-protect-src-bucket
projectID: project-id
providerCredentials:
credentials:
valueFromSecret:
key: credentials
name: gcp-trident-protect-src-bucket-secret
apiVersion: protect.trident.netapp.io/v1
kind: AppVault
metadata:
name: amazon-s3-trident-protect-src-bucket-b643cc50-0429-4ad5-971f-ac4a83621922
namespace: trident-protect
spec:
providerType: AWS
providerConfig:
s3:
bucketName: trident-protect-src-bucket
endpoint: s3.example.com
providerCredentials:
accessKeyID:
valueFromSecret:
key: accessKeyID
name: s3
secretAccessKey:
valueFromSecret:
key: secretAccessKey
name: s3
apiVersion: protect.trident.netapp.io/v1
kind: AppVault
metadata:
name: azure-trident-protect-src-bucket-b643cc50-0429-4ad5-971f-ac4a83621922
namespace: trident-protect
spec:
providerType: Azure
providerConfig:
azure:
accountName: account-name
bucketName: trident-protect-src-bucket
providerCredentials:
accountKey:
valueFromSecret:
key: accountKey
name: azure-trident-protect-src-bucket-secret
apiVersion: protect.trident.netapp.io/v1
kind: AppVault
metadata:
name: generic-s3-trident-protect-src-bucket-b643cc50-0429-4ad5-971f-ac4a83621922
namespace: trident-protect
spec:
providerType: GenericS3
providerConfig:
s3:
bucketName: trident-protect-src-bucket
endpoint: s3.example.com
providerCredentials:
accessKeyID:
valueFromSecret:
key: accessKeyID
name: s3
secretAccessKey:
valueFromSecret:
key: secretAccessKey
name: s3
apiVersion: protect.trident.netapp.io/v1
kind: AppVault
metadata:
name: ontap-s3-trident-protect-src-bucket-b643cc50-0429-4ad5-971f-ac4a83621922
namespace: trident-protect
spec:
providerType: OntapS3
providerConfig:
s3:
bucketName: trident-protect-src-bucket
endpoint: s3.example.com
providerCredentials:
accessKeyID:
valueFromSecret:
key: accessKeyID
name: s3
secretAccessKey:
valueFromSecret:
key: secretAccessKey
name: s3
apiVersion: protect.trident.netapp.io/v1
kind: AppVault
metadata:
name: storagegrid-s3-trident-protect-src-bucket-b643cc50-0429-4ad5-971f-ac4a83621922
namespace: trident-protect
spec:
providerType: StorageGridS3
providerConfig:
s3:
bucketName: trident-protect-src-bucket
endpoint: s3.example.com
providerCredentials:
accessKeyID:
valueFromSecret:
key: accessKeyID
name: s3
secretAccessKey:
valueFromSecret:
key: secretAccessKey
name: s3
Trident Protect CLI를 사용한 AppVault 생성 예
다음 CLI 명령 예제를 사용하여 각 공급자에 대해 AppVault CRS를 만들 수 있습니다.
tridentctl-protect create vault GCP my-new-vault --bucket mybucket --project my-gcp-project --secret <gcp-creds>/<credentials>
tridentctl-protect create vault AWS <vault-name> --bucket <bucket-name> --secret <secret-name> --endpoint <s3-endpoint>
tridentctl-protect create vault Azure <vault-name> --account <account-name> --bucket <bucket-name> --secret <secret-name>
tridentctl-protect create vault GenericS3 <vault-name> --bucket <bucket-name> --secret <secret-name> --endpoint <s3-endpoint>
tridentctl-protect create vault OntapS3 <vault-name> --bucket <bucket-name> --secret <secret-name> --endpoint <s3-endpoint>
tridentctl-protect create vault StorageGridS3 s3vault --bucket <bucket-name> --secret <secret-name> --endpoint <s3-endpoint>
AppVault 브라우저를 사용하여 AppVault 정보를 봅니다
Trident Protect CLI 플러그인을 사용하면 클러스터에서 생성된 AppVault 개체에 대한 정보를 볼 수 있습니다.
-
AppVault 개체의 내용을 봅니다.
tridentctl-protect get appvaultcontent gcp-vault --show-resources all-
출력 예 *:
+-------------+-------+----------+-----------------------------+---------------------------+ | CLUSTER | APP | TYPE | NAME | TIMESTAMP | +-------------+-------+----------+-----------------------------+---------------------------+ | | mysql | snapshot | mysnap | 2024-08-09 21:02:11 (UTC) | | production1 | mysql | snapshot | hourly-e7db6-20240815180300 | 2024-08-15 18:03:06 (UTC) | | production1 | mysql | snapshot | hourly-e7db6-20240815190300 | 2024-08-15 19:03:06 (UTC) | | production1 | mysql | snapshot | hourly-e7db6-20240815200300 | 2024-08-15 20:03:06 (UTC) | | production1 | mysql | backup | hourly-e7db6-20240815180300 | 2024-08-15 18:04:25 (UTC) | | production1 | mysql | backup | hourly-e7db6-20240815190300 | 2024-08-15 19:03:30 (UTC) | | production1 | mysql | backup | hourly-e7db6-20240815200300 | 2024-08-15 20:04:21 (UTC) | | production1 | mysql | backup | mybackup5 | 2024-08-09 22:25:13 (UTC) | | | mysql | backup | mybackup | 2024-08-09 21:02:52 (UTC) | +-------------+-------+----------+-----------------------------+---------------------------+
-
-
선택적으로, 각 리소스의 AppVaultPath를 보려면 플래그를 `--show-paths`사용합니다.
표의 첫 번째 열에 있는 클러스터 이름은 Trident Protect helm 설치 시 클러스터 이름이 지정된 경우에만 사용할 수 있습니다. 예를 들어:
--set clusterName=production1.
AppVault를 제거합니다
언제든지 AppVault 개체를 제거할 수 있습니다.
|
|
AppVault 개체를 삭제하기 전에 AppVault CR에서 키를 제거하지 finalizers 마십시오. 이렇게 하면 AppVault 버킷의 잔여 데이터와 클러스터의 분리된 리소스가 생성될 수 있습니다.
|
연결된 버킷에 저장된 모든 스냅샷과 백업을 삭제했는지 확인합니다.
-
AppVault 개체를 제거하고
appvault_name제거할 AppVault 개체의 이름으로 바꿉니다.kubectl delete appvault <appvault_name> -n trident-protect
-
AppVault 개체를 제거하고
appvault_name제거할 AppVault 개체의 이름으로 바꿉니다.tridentctl-protect delete appvault <appvault_name> -n trident-protect