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选项的参数:

    参数 Description Default

    创建

    确定是否可以创建SCC资源。只有在将设置为 true`且Helm安装过程标识OpenShift环境时、才会创建SCC资源 `scc.create。如果不在OpenShift上运行,或者如果 scc.create`设置为 `false,则不会创建任何SCC资源。

    true

    name

    指定SCC的名称。

    Trident保护作业

    优先级

    定义SCC的优先级。优先级值较高的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设置和命名空间过滤以满足您的特定要求。下表描述了可用的配置参数:

参数 Type Description

自动支持代理

string

为NetApp AutoSupport连接配置代理 URL。使用此功能通过代理服务器路由支持包上传。例子: http://my.proxy.url

自动支持.不安全

boolean

设置为时跳过AutoSupport代理连接的 TLS 验证 true。仅用于不安全的代理连接。 (默认: false )

自动支持已启用

boolean

启用或禁用每日Trident保护AutoSupport捆绑包上传。当设置为 false,计划的每日上传已被禁用,但您仍然可以手动生成支持包。 (默认: true )

恢复跳过命名空间注释

string

要从备份和恢复操作中排除的命名空间注释的逗号分隔列表。允许您根据注释过滤命名空间。

restoreSkipNamespaceLabels

string

要从备份和恢复操作中排除的命名空间标签的逗号分隔列表。允许您根据标签过滤命名空间。

您可以使用 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限制为特定节点

您可以使用Kubenetes nodeSelecte节点选择约束根据节点标签控制哪些节点有资格运行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