$ oc create secret generic image-registry-private-configuration-user --from-literal=REGISTRY_STORAGE_AZURE_ACCOUNTKEY=<accountkey> --namespace openshift-image-registry
除了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 Blob 存储,并且注册表操作符会自动配置存储。
在 Azure 上拥有用户预配基础设施的集群。
要为 Azure 配置注册表存储,请提供注册表操作符云凭据。
对于 Azure 存储,密钥应包含一个键
REGISTRY_STORAGE_AZURE_ACCOUNTKEY
创建一个Azure 存储容器。
在configs.imageregistry.operator.openshift.io/cluster
中填写存储配置
$ oc edit configs.imageregistry.operator.openshift.io/cluster
storage:
azure:
accountName: <storage-account-name>
container: <container-name>
在安装过程中,您的云凭据足以创建 Azure Blob 存储,并且注册表操作符会自动配置存储。
在政府区域中拥有用户预配基础设施的 Azure 上的集群。
要为 Azure 配置注册表存储,请提供注册表操作符云凭据。
对于 Azure 存储,密钥应包含一个键
REGISTRY_STORAGE_AZURE_ACCOUNTKEY
创建一个Azure 存储容器。
在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 设置为AzureUSGovernmentCloud 、AzureChinaCloud 或AzureGermanCloud ,前提是拥有足够的凭据。 |