This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.2.3. 为 Image Registry Operator 配置一个 ConfigMap
除了configs.imageregistry.operator.openshift.io
及 secret 资源外,还可以通过openshift-image-registry
命名空间中的独立的 ConfigMap 资源为 Operator 提供其他配置。
先决条件
- CA必须经过PEM编码。
流程
您可以在openshift-config
命名空间中创建ConfigMap,并在image.config.openshift.io
资源中的AdditionalTrustedCA
中使用其名称,以提供与外部 registry 联系时可以被信任的额外CA。
其中的关键字是带有信任此CA端口的registry的主机名。
您可以按照以下过程配置其他CA。
配置其他CA:
oc create configmap registry-config --from-file=<external_registry_address>=ca.crt -n openshift-config oc edit image.config.openshift.io cluster
$ oc create configmap registry-config --from-file=<external_registry_address>=ca.crt -n openshift-config $ oc edit image.config.openshift.io cluster spec: additionalTrustedCA: name: registry-config
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 检查
image-registry
pod 中的镜像:oc rsh image-registry-xxxxx ls /etc/pki/ca-trust/source/anchors
$ oc rsh image-registry-xxxxx sh-4.2 $ ls /etc/pki/ca-trust/source/anchors <external_registry_address> image-registry.openshift-image-registry.svc..5000 image-registry.openshift-image-registry.svc.cluster.local..5000
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Image registry CA 示例
- 1
- 如果 registry 带有端口,如
registry-with-port.example.com:5000
,:
需要被..
替换。