×

为镜像注册表操作符配置密钥

除了configs.imageregistry.operator.openshift.io和 ConfigMap 资源外,操作符的配置还通过位于openshift-image-registry命名空间中的单独密钥资源提供。

image-registry-private-configuration-user密钥提供了存储访问和管理所需的凭据。如果找到默认凭据,它将覆盖操作符使用的默认凭据。

对于 Azure 注册表存储,密钥应包含一个键,其值为 Azure 提供的凭据文件的内容。

  • REGISTRY_STORAGE_AZURE_ACCOUNTKEY

步骤
  • 创建一个包含所需密钥的 OpenShift Container Platform 密钥。

    $ oc create secret generic image-registry-private-configuration-user --from-literal=REGISTRY_STORAGE_AZURE_ACCOUNTKEY=<accountkey> --namespace openshift-image-registry

为 Azure 配置注册表存储

在安装过程中,您的云凭据足以创建 Azure Blob 存储,并且注册表操作符会自动配置存储。

先决条件
  • 在 Azure 上拥有用户预配基础设施的集群。

  • 要为 Azure 配置注册表存储,请提供注册表操作符云凭据。

  • 对于 Azure 存储,密钥应包含一个键

    • REGISTRY_STORAGE_AZURE_ACCOUNTKEY

步骤
  1. 创建一个Azure 存储容器

  2. configs.imageregistry.operator.openshift.io/cluster中填写存储配置

    $ oc edit configs.imageregistry.operator.openshift.io/cluster
    示例配置
    storage:
      azure:
        accountName: <storage-account-name>
        container: <container-name>

为 Azure Government 配置注册表存储

在安装过程中,您的云凭据足以创建 Azure Blob 存储,并且注册表操作符会自动配置存储。

先决条件
  • 在政府区域中拥有用户预配基础设施的 Azure 上的集群。

  • 要为 Azure 配置注册表存储,请提供注册表操作符云凭据。

  • 对于 Azure 存储,密钥应包含一个键

    • REGISTRY_STORAGE_AZURE_ACCOUNTKEY

步骤
  1. 创建一个Azure 存储容器

  2. configs.imageregistry.operator.openshift.io/cluster中填写存储配置

    $ oc edit configs.imageregistry.operator.openshift.io/cluster
    示例配置
    storage:
      azure:
        accountName: <storage-account-name>
        container: <container-name>
        cloudName: AzureUSGovernmentCloud (1)
    1 cloudName是 Azure 云环境的名称,可用于使用适当的 Azure API 端点配置 Azure SDK。默认为AzurePublicCloud。您还可以将cloudName设置为AzureUSGovernmentCloudAzureChinaCloudAzureGermanCloud,前提是拥有足够的凭据。