【问题标题】:Issue with Helm client certificateHelm 客户端证书问题
【发布时间】:2021-02-21 08:06:44
【问题描述】:
您好,我已经启动并运行了 IBM 云私有集群。
我尝试使用 cloudctl login https://icp-console.example.co.id登录
一切都很好,最后一行告诉我:
配置 helm:/root/.helm
确定
但是当我尝试检查 /root/.helm/cert.pem 中生成的证书时:
证书信息:
通用名称:管理员
有效期自:2020 年 11 月 9 日
有效期至:2021 年 2 月 7 日
发行人:www.ibm.com,IBM Cloud Private
它显示了我上面的信息。我想知道,如何扩展命令cloudctl login生成的证书,因为它的有效期只有3个月?
如果可能的话,我想让它 10 年,或者永远不会过期。
请帮忙..
【问题讨论】:
标签:
kubernetes-helm
ibm-cloud-private
helm-tls
【解决方案1】:
我自己解决了,
-
从 helm-tiller-secret 获取证书 cert.pem,
oc get secret -n kube-system helm-tiller-secret -o go-template --template="{{.data.crt|base64decode}}"
-
从 helm-tiller-secret 获取证书 key.pem,
oc get secret -n kube-system helm-tiller-secret -o go-template --template="{{.data.key|base64decode}}"
-
复制并粘贴到 /root/.helm/cert.pem 和 /root/.helm/key.pem
-
如果你愿意,你也可以创建新的秘密,如果需要某个命名空间,使用以下命令连接到 helm:
kubectl create secret generic apic-ent-helm-tls --from-file=cert.pem=/root/.helm/cert.pem --from-file=ca.pem=/root/.helm/ca.pem - -from-file=key.pem=/root/.helm/key.pem -n