3.3. 为 Azure 用户置备的基础架构配置 registry

3.3.1. 为 Image Registry Operator 配置一个 secret

除了configs.imageregistry.operator.openshift.io及 ConfigMap 资源外,还可以通过openshift-image-registry命名空间中的独立的 secret 资源为 Operator 提供其他配置。

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

对于 Azure registry 存储,secret 应该包含这个键,其值是 Azure 提供的凭据文件的内容:

  • REGISTRY_STORAGE_AZURE_ACCOUNTKEY

流程

  • 创建一个包括了所需键的 OpenShift Container Platform secret。

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

3.3.2. 为 Azure 配置 registry 存储

在安装过程中,使用您的云凭据就可以创建 Azure Blob Storage,Registry Operator 将会自动配置存储。

先决条件

  • 用户置备的 Azure 中的集群。
  • 要为 Azure 配置 registry 存储,您需要提供 Registry Operator 云凭据。
  • 对于Azure 存储,secret 应该包含以下键:

    • 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>