3.2. 配置对象存储
在安装 Red Hat Quay 前,您需要配置对象存储,无论您是否允许 Red Hat Quay Operator 管理存储或自己管理它。
如果您希望 Red Hat Quay Operator 负责管理存储,请参阅 Managed 存储中的部分来安装和配置 NooBaa 和 Red Hat OpenShift Data Foundation 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
s3_region: <region>
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
boto_timeout: 120
DISTRIBUTED_STORAGE_DEFAULT_LOCATIONS: []
DISTRIBUTED_STORAGE_PREFERENCE:
- googleCloudStorage
- 1
- 可选。从连接时抛出超时异常的时间(以秒为单位)。默认值为
60秒。另外,还包括时间(以秒为单位),直到尝试进行连接时抛出超时异常。默认值为60秒。
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
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 服务的二级端点将导致以下错误:
AuthenticationErrorDetail:Cannot find the claimed account when trying the account whusc8-secondary。
3.2.1.4. Ceph/RadosGW 存储 复制链接链接已复制到粘贴板!
在为 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: 3
os_options:
tenant_id: <osp_tenant_id_here>
user_domain_name: <osp_domain_name_here>
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 部署为您的非受管存储配置。
流程
-
在 Red Hat Quay 控制台中,导航到 Storage
Object Bucket Claims,在 Red Hat Quay 控制台中创建一个 NooBaa Object Bucket Claim。 - 检索 Object Bucket Claim 数据详情,包括 Access Key, Bucket Name, Endpoint (hostname)和 Secret Key。
创建
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。