3.2. 配置对象存储


您需要在安装 Red Hat Quay 前配置对象存储,无论您是否允许 Red Hat Quay Operator 管理存储还是自行管理。

如果您希望 Red Hat Quay Operator 负责管理存储,请参阅受管存储部分,以了解有关 安装和配置 NooBaa 和 Red Hat OpenShift Data Foundations Operator 的信息。

如果使用单独的存储解决方案,请在配置 Operator 时将 objectstorage 设置为 unmanaged。请参见以下部分。非受管存储,以了解有关配置现有存储的详细信息。

3.2.1. 使用非受管存储

本节为您提供了非受管存储的配置示例。有关如何设置对象存储的完整说明,请参阅 Red Hat Quay 配置指南。

3.2.1.1. AWS S3 存储

在为您的 Red Hat Quay 部署配置 AWS S3 存储时,请使用以下示例。

DISTRIBUTED_STORAGE_CONFIG:
  s3Storage:
    - S3Storage
    - host: s3.us-east-2.amazonaws.com
      s3_access_key: ABCDEFGHIJKLMN
      s3_secret_key: OL3ABCDEFGHIJKLMN
      s3_bucket: quay_bucket
      storage_path: /datastorage/registry
DISTRIBUTED_STORAGE_DEFAULT_LOCATIONS: []
DISTRIBUTED_STORAGE_PREFERENCE:
    - s3Storage

3.2.1.2. Google Cloud 存储

在为您的 Red Hat Quay 部署配置 Google Cloud 存储时,请使用以下示例。

DISTRIBUTED_STORAGE_CONFIG:
    googleCloudStorage:
        - GoogleCloudStorage
        - access_key: GOOGQIMFB3ABCDEFGHIJKLMN
          bucket_name: quay-bucket
          secret_key: FhDAYe2HeuAKfvZCAGyOioNaaRABCDEFGHIJKLMN
          storage_path: /datastorage/registry
DISTRIBUTED_STORAGE_DEFAULT_LOCATIONS: []
DISTRIBUTED_STORAGE_PREFERENCE:
    - googleCloudStorage

3.2.1.3. Microsoft Azure 存储

在为您的 Red Hat Quay 部署配置 Microsoft Azure 存储时,请使用以下示例。

DISTRIBUTED_STORAGE_CONFIG:
  azureStorage:
    - AzureStorage
    - azure_account_name: azure_account_name_here
      azure_container: azure_container_here
      storage_path: /datastorage/registry
      azure_account_key: azure_account_key_here
      sas_token: some/path/
      endpoint_url: https://[account-name].blob.core.usgovcloudapi.net 
1

DISTRIBUTED_STORAGE_DEFAULT_LOCATIONS: []
DISTRIBUTED_STORAGE_PREFERENCE:
    - azureStorage
1
Microsoft Azure 存储的 endpoint_url 参数是可选的,可用于 Microsoft Azure Government (MAG)端点。如果留空,则 endpoint_url 将连接到普通的 Microsoft Azure 区域。

从 Red Hat Quay 3.7 开始,您必须使用 MAG Blob 服务的主端点。使用 MAG Blob 服务的 Secondary 端点将导致以下错误: AuthenticationErrorDetail:Cannot find the claimed account when trying to GetProperties for the account whusc8-secondary.

3.2.1.4. Ceph/RadosGW Storage

在为您的 Red Hat Quay 部署配置 Ceph/RadosGW 存储时使用以下示例。

DISTRIBUTED_STORAGE_CONFIG:
  radosGWStorage: #storage config name
    - RadosGWStorage #actual driver
    - access_key: access_key_here #parameters
      secret_key: secret_key_here
      bucket_name: bucket_name_here
      hostname: hostname_here
      is_secure: 'true'
      port: '443'
      storage_path: /datastorage/registry
DISTRIBUTED_STORAGE_DEFAULT_LOCATIONS: []
DISTRIBUTED_STORAGE_PREFERENCE: #must contain name of the storage config
    - radosGWStorage

3.2.1.5. Swift 存储

在为您的 Red Hat Quay 部署配置 Swift 存储时,请使用以下示例。

DISTRIBUTED_STORAGE_CONFIG:
  swiftStorage:
    - SwiftStorage
    - swift_user: swift_user_here
      swift_password: swift_password_here
      swift_container: swift_container_here
      auth_url: https://example.org/swift/v1/quay
      auth_version: 1
      ca_cert_path: /conf/stack/swift.cert"
      storage_path: /datastorage/registry
DISTRIBUTED_STORAGE_DEFAULT_LOCATIONS: []
DISTRIBUTED_STORAGE_PREFERENCE:
    - swiftStorage

3.2.1.6. NooBaa 非受管存储

使用以下步骤将 NooBaa 部署为您的非受管存储配置。

步骤

  1. 进入 Storage Object Bucket Claims,在 Red Hat Quay 控制台中创建一个 NooBaa Object Bucket Claim。
  2. 检索 Object Bucket Claim Data details,包括 Access Key, Bucket Name, Endpoint (hostname)和 Secret Key。
  3. 创建 config.yaml 配置文件,该文件使用 Object Bucket Claim 的信息:

    DISTRIBUTED_STORAGE_CONFIG:
      default:
        - RHOCSStorage
        - access_key: WmrXtSGk8B3nABCDEFGH
          bucket_name: my-noobaa-bucket-claim-8b844191-dc6c-444e-9ea4-87ece0abcdef
          hostname: s3.openshift-storage.svc.cluster.local
          is_secure: true
          port: "443"
          secret_key: X9P5SDGJtmSuHFCMSLMbdNCMfUABCDEFGH+C5QD
          storage_path: /datastorage/registry
    DISTRIBUTED_STORAGE_DEFAULT_LOCATIONS: []
    DISTRIBUTED_STORAGE_PREFERENCE:
      - default

有关配置对象 Bucket 声明的更多信息,请参阅 Object Bucket Claim

3.2.2. 使用一个非受管 NooBaa 实例

使用以下步骤为您的 Red Hat Quay 部署使用非受管 NooBaa 实例。

步骤

  1. 在控制台的 Storage Object Bucket Claims 创建一个 NooBaa Object Bucket Claim。
  2. 检索对象 Bucket 声明数据详细信息,包括 Access Key,Bucket Name,Endpoint (hostname), 和 Secret Key
  3. 使用 Object Bucket Claim 的信息创建 config.yaml 配置文件。例如:

    DISTRIBUTED_STORAGE_CONFIG:
      default:
        - RHOCSStorage
        - access_key: WmrXtSGk8B3nABCDEFGH
          bucket_name: my-noobaa-bucket-claim-8b844191-dc6c-444e-9ea4-87ece0abcdef
          hostname: s3.openshift-storage.svc.cluster.local
          is_secure: true
          port: "443"
          secret_key: X9P5SDGJtmSuHFCMSLMbdNCMfUABCDEFGH+C5QD
          storage_path: /datastorage/registry
    DISTRIBUTED_STORAGE_DEFAULT_LOCATIONS: []
    DISTRIBUTED_STORAGE_PREFERENCE:
      - default

3.2.3. 受管存储

如果您希望 Red Hat Quay Operator 管理 Red Hat Quay 的对象存储,您的集群需要能够通过 ObjectBucketClaim API 提供对象存储。使用 Red Hat OpenShift Data Foundation Operator,有两个支持的选项:

  • 由本地 Kubernetes PersistentVolume 存储支持的 Multi-Cloud Object Gateway 的独立实例

    • 不可用
    • Red Hat Quay 订阅中包含
    • 不需要单独订阅 Red Hat OpenShift Data Foundation
  • 带有横向扩展对象服务和 Ceph 的 Red Hat OpenShift Data Foundation 的生产环境部署

    • 高可用性
    • 为 Red Hat OpenShift Data Foundation 需要单独的订阅

要使用独立实例选项,请继续阅读以下内容。有关 Red Hat OpenShift Data Foundation 的生产部署,请参阅 官方文档

注意

带有 50 GiB 的 Red Hat Quay Operator 会自动分配对象存储磁盘空间。这个数字代表了大多数中小型 Red Hat Quay 安装可用存储量,但可能不适用于您的用例。重新定义 Red Hat OpenShift Data Foundation 卷的大小目前不是由 Red Hat Quay Operator 处理。如需了解更多详细信息,请参见下面的有关调整受管存储大小的部分。

作为 Red Hat Quay 订阅的一部分,用户有权使用 Red Hat OpenShift Data Foundation Operator 的 Multicloud Object Gateway 组件(以前称为 OpenShift Container Storage Operator)。此网关组件允许您将 S3 兼容对象存储接口提供给由基于 Kubernetes PersistentVolume- 的块存储支持的 Red Hat Quay。使用量仅限于由 Operator 管理的 Red Hat Quay 部署,以及 multicloud Object Gateway 实例的确切规格,如下所述。

由于 Red Hat Quay 不支持本地文件系统存储,因此用户可以结合使用网关与 Kubernetes PersistentVolume 存储,以提供受支持的部署。PersistentVolume 直接挂载到网关实例上,作为对象存储的后备存储,支持任何基于块的 StorageClass

通过 PersistentVolume 的性质,这不是横向扩展、高度可用的解决方案,不会取代像 Red Hat OpenShift Data Foundation 等横向扩展的存储系统。只有一个网关实例正在运行。如果因为重新调度、更新或计划外停机运行网关的 pod 不可用,这会导致连接的 Red Hat Quay 实例出现临时降级。

使用 Red Hat OpenShift Data Foundation 在 OpenShift Container Platform 上部署 Red Hat Quay 需要您下载 Local Storage Operator、Red Hat OpenShift Data Foundation Operator,然后使用 OpenShift Container Platform UI 部署独立多云对象网关。有关这些步骤,请参阅以下 Red Hat OpenShift Data Foundation 文档:

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部