使用CA证书来提取S2I构建的构建器映像



我有一个BuildConfig,它有以下strategy块:

strategy:
sourceStrategy:
from:
kind: DockerImage
name: <insecure registry pullspec>
forcePull: true
incremental: true
type: Source

生成器映像来自使用自签名证书的注册表。我如何告诉构建配置A(为注册表使用CA证书或B(忽略证书错误?

我尝试将CA证书添加为不透明机密,然后使用pullSecret,但没有成功:

strategy:
sourceStrategy:
forcePull: true
from:
kind: DockerImage
name: <insecure registry pullspec>
incremental: true
pullSecret:
name: <name of opaque secret with ca cert>
type: Source

我在OpenShift 3.11集群中运行这个构建。

文档中实际描述了如何将自己的根CA添加为additionalTrustedCA:为生成设置其他受信任的证书颁发机构

以下是相关部分:

在openshift config命名空间中创建一个ConfigMap,其中包含使用自签名证书的注册表的受信任证书。对于每个CA文件,确保ConfigMap中的键是注册表的主机名,其格式为hostname[..port]:

$ oc create configmap registry-cas -n openshift-config 
--from-file=myregistry.corp.com..5000=/etc/docker/certs.d/myregistry.corp.com:5000/ca.crt 
--from-file=otherregistry.com=/etc/docker/certs.d/otherregistry.com/ca.crt

更新集群映像配置:

$ oc patch image.config.openshift.io/cluster --patch '{"spec":{"additionalTrustedCA":{"name":"registry-cas"}}}' --type=merge

最新更新