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.4.2.2. 创建凭证和 CA 证书以添加 Helm Chart 仓库
有些 Helm Chart 仓库需要凭证和自定义证书颁发机构(CA)证书才能与其连接。您可以使用 Web 控制台和 CLI 添加凭证和证书。
流程
配置凭证和证书,然后使用 CLI 添加 Helm Chart 仓库:
在
openshift-config
命名空间中,使用 PEM 编码格式的自定义 CA 证书创建一个configmap
,并将它存储在配置映射中的ca-bundle.crt
键下:oc create configmap helm-ca-cert \ --from-file=ca-bundle.crt=/path/to/certs/ca.crt \ -n openshift-config
$ oc create configmap helm-ca-cert \ --from-file=ca-bundle.crt=/path/to/certs/ca.crt \ -n openshift-config
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 在
openshift-config
命名空间中,创建一个Secret
对象来添加客户端 TLS 配置:oc create secret generic helm-tls-configs \ --from-file=tls.crt=/path/to/certs/client.crt \ --from-file=tls.key=/path/to/certs//client.key \ -n openshift-config
$ oc create secret generic helm-tls-configs \ --from-file=tls.crt=/path/to/certs/client.crt \ --from-file=tls.key=/path/to/certs//client.key \ -n openshift-config
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 请注意:客户端证书和密钥必须采用 PEM 编码格式,并分别保存在
tls.crt
和tls.key
密钥中。按如下所示添加 Helm 仓库:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow ConfigMap
和Secret
使用tlsConfig
和ca
字段在 HelmChartRepository CR 中消耗。这些证书用于连接 Helm 仓库 URL。默认情况下,所有经过身份验证的用户都可以访问所有配置的 chart。但是,对于需要证书的 Chart 仓库,您必须为用户提供对
openshift-config
命名空间中helm-ca-cert
配置映射和helm-tls-configs
secret 的读取访问权限,如下所示:Copy to Clipboard Copied! Toggle word wrap Toggle overflow