$ oc create secret generic image-registry-private-configuration-user --from-file=REGISTRY_STORAGE_GCS_KEYFILE=<path_to_keyfile> --namespace openshift-image-registry
除了configs.imageregistry.operator.openshift.io
和ConfigMap资源外,操作符的配置还通过位于openshift-image-registry
命名空间中的单独密钥资源提供。
image-registry-private-configuration-user
密钥提供存储访问和管理所需的凭据。如果找到默认凭据,它将覆盖操作符使用的默认凭据。
对于GCP存储上的GCS,密钥预计包含一个键,其值为GCP提供的凭据文件的内容。
REGISTRY_STORAGE_GCS_KEYFILE
创建一个包含所需密钥的OpenShift Container Platform密钥。
$ oc create secret generic image-registry-private-configuration-user --from-file=REGISTRY_STORAGE_GCS_KEYFILE=<path_to_keyfile> --namespace openshift-image-registry
如果注册表操作符无法创建Google Cloud Platform (GCP)存储桶,则必须手动设置存储介质并在注册表自定义资源 (CR) 中配置设置。
具有用户预配基础设施的GCP集群。
要配置GCP的注册表存储,您需要提供注册表操作符云凭据。
对于GCP存储上的GCS,密钥预计包含一个键,其值为GCP提供的凭据文件的内容。
REGISTRY_STORAGE_GCS_KEYFILE
设置一个对象生命周期管理策略来中止一天前未完成的多部分上传。
在configs.imageregistry.operator.openshift.io/cluster
中填写存储配置
$ oc edit configs.imageregistry.operator.openshift.io/cluster
# ...
storage:
gcs:
bucket: <bucket-name>
projectID: <project-id>
region: <region-name>
# ...
您可以通过设置公共访问权限预防来保护使用Google Cloud Storage存储桶的注册表镜像。 |