3.6. 镜像存储
本节详细介绍了 Red Hat Quay 中提供的镜像存储功能和配置字段。
3.6.1. 镜像存储功能 复制链接链接已复制到粘贴板!
下表描述了 Red Hat Quay 的镜像存储功能:
| 字段 | 类型 | 描述 |
|---|---|---|
| FEATURE_REPO_MIRROR | 布尔值 |
如果设置为 true,请启用存储库镜像。 |
| FEATURE_PROXY_STORAGE | 布尔值 |
是否通过 NGINX 代理存储中的所有直接下载 URL。 |
| FEATURE_STORAGE_REPLICATION | 布尔值 |
是否在存储引擎之间自动复制。 |
3.6.2. 镜像存储配置字段 复制链接链接已复制到粘贴板!
下表描述了 Red Hat Quay 的镜像存储配置字段:
| 字段 | 类型 | 描述 |
|---|---|---|
|
DISTRIBUTED_STORAGE_CONFIG | 对象 |
在 Red Hat Quay 中使用的存储引擎的配置。每个键代表存储引擎的唯一标识符。该值由组成一个对象(键、值)的元组组成,用于描述存储引擎参数。 |
|
DISTRIBUTED_STORAGE_DEFAULT_LOCATIONS | 字符串数组 |
默认情况下,存储引擎(由 |
|
DISTRIBUTED_STORAGE_PREFERENCE | 字符串数组 |
要使用的 |
| MAXIMUM_LAYER_SIZE | 字符串 |
镜像层允许的最大大小。 |
3.6.3. 本地存储 复制链接链接已复制到粘贴板!
以下 YAML 显示了使用本地存储的示例配置:
DISTRIBUTED_STORAGE_CONFIG:
default:
- LocalStorage
- storage_path: /datastorage/registry
DISTRIBUTED_STORAGE_DEFAULT_LOCATIONS: []
DISTRIBUTED_STORAGE_PREFERENCE:
- default
3.6.4. OpenShift Container Storage/NooBaa 复制链接链接已复制到粘贴板!
以下 YAML 显示了使用 OpenShift Container Storage/NooBaa 实例的配置示例:
DISTRIBUTED_STORAGE_CONFIG:
rhocsStorage:
- RHOCSStorage
- access_key: access_key_here
secret_key: secret_key_here
bucket_name: quay-datastore-9b2108a3-29f5-43f2-a9d5-2872174f9a56
hostname: s3.openshift-storage.svc.cluster.local
is_secure: 'true'
port: '443'
storage_path: /datastorage/registry
maximum_chunk_size_mb: 100
server_side_assembly: true
3.6.5. Ceph/RadosGW 存储 复制链接链接已复制到粘贴板!
以下示例演示了在使用 Ceph/RadosGW 时两个可能的 YAML 配置。
示例:使用带有 radosGWStorage 驱动程序的 RadosGW
DISTRIBUTED_STORAGE_CONFIG:
radosGWStorage:
- RadosGWStorage
- access_key: <access_key_here>
secret_key: <secret_key_here>
bucket_name: <bucket_name_here>
hostname: <hostname_here>
is_secure: true
port: '443'
storage_path: /datastorage/registry
maximum_chunk_size_mb: 100
server_side_assembly: true
示例 B:使用 RadosGW 带有常规 s3 访问
DISTRIBUTED_STORAGE_CONFIG:
s3Storage:
- RadosGWStorage
- access_key: <access_key_here>
bucket_name: <bucket_name_here>
hostname: <hostname_here>
is_secure: true
secret_key: <secret_key_here>
storage_path: /datastorage/registry
maximum_chunk_size_mb: 100
server_side_assembly: true
3.6.6. AWS S3 存储 复制链接链接已复制到粘贴板!
以下 YAML 显示了使用 AWS S3 存储的示例配置。
# ...
DISTRIBUTED_STORAGE_CONFIG:
default:
- 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:
- default
# ...
3.6.6.1. AWS STS S3 存储 复制链接链接已复制到粘贴板!
以下 YAML 显示了在 OpenShift Container Platform 配置中使用 Amazon Web Services (AWS)安全令牌服务(STS)与 Red Hat Quay 搭配使用的示例配置。
# ...
DISTRIBUTED_STORAGE_CONFIG:
default:
- STSS3Storage
- sts_role_arn: <role_arn>
s3_bucket: <s3_bucket_name>
storage_path: <storage_path>
sts_user_access_key: <s3_user_access_key>
sts_user_secret_key: <s3_user_secret_key>
s3_region: <region>
DISTRIBUTED_STORAGE_DEFAULT_LOCATIONS: []
DISTRIBUTED_STORAGE_PREFERENCE:
- default
# ...
3.6.7. Google Cloud Storage 复制链接链接已复制到粘贴板!
以下 YAML 显示了使用 Google Cloud Storage 的示例配置:
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.6.8. Azure Storage 复制链接链接已复制到粘贴板!
以下 YAML 显示了使用 Azure Storage 的示例配置:
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
- Azure 存储的
endpoint_url参数是可选的,可用于 Microsoft Azure Government (MAG)端点。如果留空,则endpoint_url将连接到普通的 Azure 区域。从 Red Hat Quay 3.7 开始,您必须使用 MAG Blob 服务的主端点。使用 MAG Blob 服务的二级端点将导致以下错误:
AuthenticationErrorDetail:Cannot find the claimed account when trying the account whusc8-secondary。
3.6.9. Swift 存储 复制链接链接已复制到粘贴板!
以下 YAML 显示了使用 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.6.10. Nutanix 对象存储 复制链接链接已复制到粘贴板!
以下 YAML 显示了使用 Nutanix 对象存储的示例配置。
DISTRIBUTED_STORAGE_CONFIG:
nutanixStorage: #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
- nutanixStorage
3.6.11. IBM Cloud 对象存储 复制链接链接已复制到粘贴板!
以下 YAML 显示了使用 IBM Cloud 对象存储的示例配置。
DISTRIBUTED_STORAGE_CONFIG:
default:
- IBMCloudStorage #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
maximum_chunk_size_mb: 100mb
DISTRIBUTED_STORAGE_DEFAULT_LOCATIONS:
- default
DISTRIBUTED_STORAGE_PREFERENCE:
- default
- 1
- 可选。建议设置为
100mb。
3.6.12. NetApp ONTAP S3 对象存储 复制链接链接已复制到粘贴板!
以下 YAML 显示了使用 NetApp ONTAP S3 的示例配置。
DISTRIBUTED_STORAGE_CONFIG:
local_us:
- RadosGWStorage
- access_key: <access_key>
bucket_name: <bucket_name>
hostname: <host_url_address>
is_secure: true
port: <port>
secret_key: <secret_key>
storage_path: /datastorage/registry
signature_version: v4
DISTRIBUTED_STORAGE_DEFAULT_LOCATIONS:
- local_us
DISTRIBUTED_STORAGE_PREFERENCE:
- local_us