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

自訂 Trident Protect 安裝

貢獻者 netapp-shwetav netapp-mwallis

您可以自訂 Trident Protect 的預設組態,以符合您環境的特定需求。

指定 Trident Protect 容器資源限制

安裝 Trident Protect 之後,您可以使用組態檔來指定 Trident Protect 容器的資源限制。設定資源限制可讓您控制 Trident Protect 作業消耗多少叢集資源。

步驟
  1. 建立名為的檔案 resourceLimits.yaml

  2. 根據您的環境需求,在檔案中填入 Trident Protect 容器的資源限制選項。

    以下範例組態檔顯示可用的設定,並包含每個資源限制的預設值:

    ---
    jobResources:
      defaults:
        limits:
          cpu: 8000m
          memory: 10000Mi
          ephemeralStorage: ""
        requests:
          cpu: 100m
          memory: 100Mi
          ephemeralStorage: ""
      resticVolumeBackup:
        limits:
          cpu: ""
          memory: ""
          ephemeralStorage: ""
        requests:
          cpu: ""
          memory: ""
          ephemeralStorage: ""
      resticVolumeRestore:
        limits:
          cpu: ""
          memory: ""
          ephemeralStorage: ""
        requests:
          cpu: ""
          memory: ""
          ephemeralStorage: ""
      kopiaVolumeBackup:
        limits:
          cpu: ""
          memory: ""
          ephemeralStorage: ""
        requests:
          cpu: ""
          memory: ""
          ephemeralStorage: ""
      kopiaVolumeRestore:
        limits:
          cpu: ""
          memory: ""
          ephemeralStorage: ""
        requests:
          cpu: ""
          memory: ""
          ephemeralStorage: ""
  3. 套用檔案中的值 resourceLimits.yaml

    helm upgrade trident-protect -n trident-protect netapp-trident-protect/trident-protect -f resourceLimits.yaml --reuse-values

自訂安全性內容限制

安裝 Trident Protect 之後,您可以使用組態檔來修改 Trident Protect 容器的 OpenShift 安全性內容限制( SCC )。這些限制定義了 Red Hat OpenShift 叢集中 Pod 的安全性限制。

步驟
  1. 建立名為的檔案 sccconfig.yaml

  2. 將 SCC 選項新增至檔案,並根據環境需求修改參數。

    以下範例顯示 SCC 選項參數的預設值:

    scc:
      create: true
      name: trident-protect-job
      priority: 1

    下表說明 SCC 選項的參數:

    參數 說明 預設

    建立

    決定是否可以建立 SCC 資源。只有在設定為 true`且 Helm 安裝程序識別 OpenShift 環境時,才會建立 SCC 資源 `scc.create。如果未在 OpenShift 上操作,或如果設為 false,則 `scc.create`不會建立任何 SCC 資源。

    是的

    名稱

    指定SCC的名稱。

    Trident 保護工作

    優先順序

    定義 SCC 的優先順序。優先順序值較高的 SCC 會在值較低之前進行評估。

    1

  3. 套用檔案中的值 sccconfig.yaml

    helm upgrade trident-protect netapp-trident-protect/trident-protect -f sccconfig.yaml --reuse-values

    這會將預設值取代為檔案中指定的值 sccconfig.yaml

設定其他Trident保護 Helm Chart 設定

您可以自訂AutoSupport設定和命名空間過濾以滿足您的特定要求。下表描述了可用的配置參數:

參數 類型 說明

自動支援代理

字串

為NetApp AutoSupport連線配置代理 URL。使用此功能透過代理伺服器路由支援包上傳。例子: http://my.proxy.url

自動支援.不安全

布林值

設定為時跳過AutoSupport代理連線的 TLS 驗證 true。僅用於不安全的代理連線。 (預設: false )

自動支援已啟用

布林值

啟用或停用每日Trident保護AutoSupport捆綁包上傳。當設定為 false,計劃的每日上傳已停用,但您仍然可以手動產生支援包。 (預設: true )

恢復跳過命名空間註釋

字串

若要從備份和復原作業中排除的命名空間註解的逗號分隔清單。允許您根據註釋過濾命名空間。

restoreSkipNamespaceLabels

字串

若要從備份和復原作業中排除的命名空間標籤的逗號分隔清單。允許您根據標籤過濾命名空間。

您可以使用 YAML 設定檔或命令列標誌來設定這些選項:

使用 YAML 文件
步驟
  1. 建立設定檔並命名 values.yaml

  2. 在您建立的文件中,新增您想要自訂的設定選項。

    autoSupport:
      enabled: false
      proxy: http://my.proxy.url
      insecure: true
    restoreSkipNamespaceAnnotations: "annotation1,annotation2"
    restoreSkipNamespaceLabels: "label1,label2"
  3. 填充後 `values.yaml`具有正確值的文件,應用設定檔:

    helm upgrade trident-protect -n trident-protect netapp-trident-protect/trident-protect -f values.yaml --reuse-values
使用 CLI 標誌
步驟
  1. 使用以下命令 `--set`標誌來指定單一參數:

    helm upgrade trident-protect -n trident-protect netapp-trident-protect/trident-protect \
      --set autoSupport.enabled=false \
      --set autoSupport.proxy=http://my.proxy.url \
      --set restoreSkipNamespaceAnnotations="annotation1,annotation2" \
      --set restoreSkipNamespaceLabels="label1,label2" \
      --reuse-values

將 Trident 保護 Pod 限制在特定節點

您可以使用 Kubernetes nodeSelector 節點選擇限制,根據節點標籤來控制哪些節點符合執行 Trident Protect Pod 的資格。根據預設, Trident Protect 僅限於執行 Linux 的節點。您可以根據自己的需求,進一步自訂這些限制。

步驟
  1. 建立名為的檔案 nodeSelectorConfig.yaml

  2. 將 nodeSelector 選項新增至檔案,並修改檔案以新增或變更節點標籤,以根據環境需求加以限制。例如,下列檔案包含預設的作業系統限制,但也針對特定區域和應用程式名稱:

    nodeSelector:
      kubernetes.io/os: linux
      region: us-west
      app.kubernetes.io/name: mysql
  3. 套用檔案中的值 nodeSelectorConfig.yaml

    helm upgrade trident-protect -n trident-protect netapp-trident-protect/trident-protect -f nodeSelectorConfig.yaml --reuse-values

    這會將預設限制取代為您在檔案中指定的限制 nodeSelectorConfig.yaml