Skip to main content
NetApp Solutions
本繁體中文版使用機器翻譯,譯文僅供參考,若與英文版本牴觸,應以英文版本為準。

安裝 OpenShift API for Data Protection ( OADP ) Operator

貢獻者

本節概述 OpenShift API for Data Protection ( OADP )操作員的安裝。

先決條件

  • Red Hat OpenShift 叢集(高於 4.12 版)安裝在具有 RHCOS 工作節點的裸機基礎架構上

  • NetApp ONTAP 叢集與使用 Astra Trident 的叢集整合

  • Trident後端在ONTAP 叢集上設定SVM

  • OpenShift叢集上設定的StorageClass、其中Astra Trident為資源配置程式

  • 在叢集上建立的 Trident Snapshot 類別

  • 叢集管理存取Red Hat OpenShift叢集

  • 管理員存取NetApp ONTAP 解決方案叢集

  • 一個應用程式、例如部署在叢集上的 PostgreSQL

  • 安裝了tridentctl和occ工具並新增至$path的管理工作站

安裝 OADP 操作員的步驟

  1. 前往叢集的運算子中樞、然後選取 Red Hat OADP 運算子。在「安裝」頁面中、使用所有預設選項、然後按一下「安裝」。在下一頁中、再次使用所有預設值、然後按一下「安裝」。OADP 運算子將安裝在命名空間 openshift-adp 中。

OpenShift API 、用於在 Operator Hub 中保護資料
OpenShift API 適用於 Data Protection Operator 安裝
已安裝適用於 Data Protection Operator 的 OpenShift API

具備 ONTAP S3 詳細資料的 Velero 組態先決條件

操作員安裝成功後、請設定 Velero 執行個體。
可將 Velero 設定為使用 S3 相容的物件儲存設備。使用中所示的程序來設定 ONTAP S3 "ONTAP 文件的「物件儲存管理」一節"。您需要 ONTAP S3 組態的下列資訊、才能與 Velero 整合。

  • 可用於存取 S3 的邏輯介面( LIF )

  • 存取 S3 的使用者認證、其中包括存取金鑰和秘密存取金鑰

  • S3 中的貯體名稱、用於具有使用者存取權限的備份

  • 為了安全存取物件儲存設備、應在物件儲存伺服器上安裝 TLS 憑證。

具備 StorageGRID S3 詳細資料的 Velero 組態先決條件

可將 Velero 設定為使用 S3 相容的物件儲存設備。您可以使用中所示的程序來設定 StorageGRID S3 "StorageGRID 文件"。您需要 StorageGRID S3 組態的下列資訊、才能與 Velero 整合。

  • 可用於存取 S3 的端點

  • 存取 S3 的使用者認證、其中包括存取金鑰和秘密存取金鑰

  • S3 中的貯體名稱、用於具有使用者存取權限的備份

  • 為了安全存取物件儲存設備、應在物件儲存伺服器上安裝 TLS 憑證。

設定 Velero 的步驟

  • 首先、為 ONTAP S3 使用者認證或 StorageGRID 租戶使用者認證建立秘密。這將用於稍後設定 Velero 。您可以從 CLI 或 Web 主控台建立機密。
    若要從網路主控台建立秘密、請選取「秘密」、然後按一下「金鑰 / 價值秘密」。提供認證名稱、金鑰和值的值、如圖所示。請務必使用 S3 使用者的存取金鑰 ID 和秘密存取金鑰。適當命名機密。在下面的範例中、系統會建立一個內含 ONTAP S3 使用者認證的密碼、名稱為 ONTAP S3 認證。

S3 使用者認證的秘密
建立 S3 使用者認證的秘密

若要從 CLI 建立名為 sg-s3-creDcreDs 的秘密、您可以使用下列命令。

使用 CLI 建立儲存網格 S3 使用者認證的機密
  • 接下來、若要設定 Velero 、請從運算子下的功能表項目中選取已安裝的運算子、按一下 OADP 運算子、然後選取「 DataProtectionApplication 」標籤。

DataProtectionApplication

按一下「建立 DataProtectionApplication 」。在表單檢視中、提供 DataProtection 應用程式的名稱或使用預設名稱。

建立 DataProtectionApplication

現在請前往 YAML 檢視並取代規格資訊、如以下 yaml 檔案範例所示。

  • 範例 yaml 檔案、用於將 Velero 設定為 ONTAP S3 作為備份位置 **

spec:
  backupLocations:
    - velero:
        config:
          insecureSkipTLSVerify: 'false' ->use this for https communication with ONTAP S3
          profile: default
          region: us-east-1
          s3ForcePathStyle: 'true'  ->This allows use of IP in s3URL
          s3Url: 'https://10.61.181.161' ->Ensure TLS certificate for S3 is configured
        credential:
          key: cloud
          name: ontap-s3-credentials -> previously created secret
        default: true
        objectStorage:
          bucket: velero -> Your bucket name previously created in S3 for backups
          prefix: container-demo-backup ->The folder that will be created in the bucket
          caCert: <base64 encoded CA Certificate installed on ONTAP Cluster with the SVM Scope where the bucker exists>
        provider: aws
  configuration:
    nodeAgent:
      enable: true
      uploaderType: kopia
      #default Data Mover uses Kopia to move snapshots to Object Storage
    velero:
      defaultPlugins:
        - csi ->This plugin to use CSI snapshots
        - openshift
        - aws
        - kubevirt -> This plugin to use Velero with OIpenShift Virtualization
  • 範例 yaml 檔案、用於將 Velero 設定為 StorageGRID S3 作為備份位置 **

spec:
  backupLocations:
    - velero:
        config:
          insecureSkipTLSVerify: 'true'
          profile: default
          region: us-east-1 ->region of your StorageGrid system
          s3ForcePathStyle: 'True'
          s3Url: 'https://172.21.254.25:10443' ->the IP used to access S3
        credential:
          key: cloud
          name: sg-s3-credentials ->secret created earlier
        default: true
        objectStorage:
          bucket: velero
          prefix: demobackup
        provider: aws
  configuration:
    nodeAgent:
      enable: true
      uploaderType: kopia
    velero:
      defaultPlugins:
        - csi
        - openshift
        - aws
        - kubevirt

yaml 檔案中的 SPEC 區段應適當設定、以符合上述範例所述的下列參數

  • 備份位置 **
    ONTAP S3 或 StorageGRID S3 (憑證和 yaml 中顯示的其他資訊)會設定為 Velero 的預設備份位置。

  • 快照位置 **
    如果您使用 Container Storage Interface ( CSI )快照、則不需要指定快照位置、因為您將建立一個 Volume SnapshotClass CR 來登錄 CSI 驅動程式。在我們的範例中、您使用的是 Astra Trident CSI 、而您先前已使用 Trident CSI 驅動程式建立了 Volume SnapShotClass CR 。

  • 啟用 CSI 外掛程式
    將 CSI 新增至 Velero 的 defaultPlugins 、以使用 CSI 快照備份持續磁碟區。
    為了備份 CSI 備份的 PVCS 、 Velero CSI 外掛程式會選擇叢集中已設定
    Velero.IO/csi - volumesnapshot-class** 標籤的 Volume SnapshotClass 。針對此

    • 您必須建立 Trident Volume SnapshotClass 。

    • 編輯 Trident 快照類別的標籤、並將其設定為
      Velero.IO/csi - volumesnapshot-class=true 如下所示。

Trident Snapshot 類別標籤

確保即使刪除了 Volume Snapshot 物件、快照仍可持續存在。您可以將 * 刪除原則 * 設定為保留來完成此作業。否則、刪除命名空間將會完全遺失其中備份的所有 PVC 。

apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshotClass
metadata:
  name: trident-snapshotclass
driver: csi.trident.netapp.io
deletionPolicy: Retain
應將 VolumeSnapshotClass 刪除原則設定為保留

確保已建立 DataProtectionApplication 、且其狀態為:已調整。

DataProtectionApplication 物件即會建立

OADP 操作員將建立對應的 BackupStorageLocation 。這將在建立備份時使用。

已建立 BackupStorageLocation