目前 KubeSphere 所有 3.x.x 版本,如果開啟了 DevOps 模塊并使用了鏡像構(gòu)建器功能(S2I)都會遇到證書過期問題。
解決方法
已開啟 DevOps 模塊
下載這個更新 S2I 服務證書壓縮包,上傳到任一可以訪問 K8s 集群的節(jié)點;
- 把上傳的壓縮包解壓
- 進入解壓后的目錄
- 執(zhí)行更新證書的腳本 ./update-s2i-cert.sh
# 上傳壓縮包到可訪問 k8s 集群的節(jié)點
...
# 解壓縮
$ tar -zxvf update-s2i-cert.tar.gz
update-s2i-cert/
update-s2i-cert/config/
update-s2i-cert/config/certs/
update-s2i-cert/config/certs/server.crt
update-s2i-cert/config/certs/ca.crt
update-s2i-cert/config/certs/server.key
update-s2i-cert/update-s2i-cert.sh
# 執(zhí)行更新證書腳本
$ cd update-s2i-cert
$ ./update-s2i-cert.sh
Update Secret: s2i-webhook-server-cert..
secret/s2i-webhook-server-cert patched
Update ValidatingWebhookConfiguration validating-webhook-configuration..
validatingwebhookconfiguration.admissionregistration.k8s.io/validating-webhook-configuration patched
Update MutatingWebhookConfiguration mutating-webhook-configuration..
mutatingwebhookconfiguration.admissionregistration.k8s.io/mutating-webhook-configuration patched
Restart s2ioperator server..
statefulset.apps/s2ioperator restarted
Done.
...
執(zhí)行完上面3步后,等待 pod s2ioperator-0 重啟成功就可以了。
未開啟 DevOps 模塊
在已經(jīng)創(chuàng)建的 KubeSphere 環(huán)境里,還未開啟 DevOps 模塊,如果需要開啟 DevOps 模塊,也會遇到由于 S2I 證書過期導致開啟 DevOps 模塊失敗的情況。
下面針對 KubeSphere 3.3.0、3.3.1、3.3.2、3.4.0、3.4.1 這幾個版本,可以使用下面的方式來解決此問題:
- 獲取 ks-installer 鏡像
- 更新 ks-installer 鏡像
# 執(zhí)行下面命令,獲取 ks-installer 鏡像
$ kubectl -n kubesphere-system get deployments ks-installer --no-headers -o custom-columns=:.spec.template.spec.containers[0].image
kubesphere/ks-installer:v3.3.0
# 基于獲取的鏡像,在鏡像最后加上 ‘-patch.0’ ,執(zhí)行下面命令更新 ks-installer 鏡像
$ kubectl -n kubesphere-system patch deployments ks-installer --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value": "kubesphere/ks-installer:v3.3.0-patch.0"}]'
更新鏡像后 ks-installer 會自動重啟并根據(jù) ClusterConfiguration 里的配置安裝各個開啟的未安裝的模塊。
如果上述方案未能解決您的問題,請移步論壇交流:https://ask.kubesphere.io/forum/。文章來源:http://www.zghlxwxcb.cn/news/detail-836243.html
本文由博客一文多發(fā)平臺 OpenWrite 發(fā)布!文章來源地址http://www.zghlxwxcb.cn/news/detail-836243.html
到了這里,關(guān)于KubeSphere 鏡像構(gòu)建器(S2I)服務證書過期解決方案的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!