KubeSphere 镜像构建器(S2I)服务证书过期解决方案

目前 KubeSphere 所有 3.x.x 版本,如果开启了 DevOps 模块并使用了镜像构建器功能(S2I)都会遇到证书过期问题。

file

解决方法

已开启 DevOps 模块

下载这个更新 S2I 服务证书压缩包,上传到任一可以访问 K8s 集群的节点;

  1. 把上传的压缩包解压
  2. 进入解压后的目录
  3. 执行更新证书的脚本 ./update-s2i-cert.sh
# 上传压缩包到可访问 k8s 集群的节点
...
# 解压缩
$ 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

# 执行更新证书脚本
$ 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.
...

执行完上面3步后,等待 pod s2ioperator-0 重启成功就可以了。

未开启 DevOps 模块

在已经创建的 KubeSphere 环境里,还未开启 DevOps 模块,如果需要开启 DevOps 模块,也会遇到由于 S2I 证书过期导致开启 DevOps 模块失败的情况。

下面针对 KubeSphere 3.3.0、3.3.1、3.3.2、3.4.0、3.4.1 这几个版本,可以使用下面的方式来解决此问题:

  1. 获取 ks-installer 镜像
  2. 更新 ks-installer 镜像
# 执行下面命令,获取 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’ ,执行下面命令更新 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 会自动重启并根据 ClusterConfiguration 里的配置安装各个开启的未安装的模块。

如果上述方案未能解决您的问题,请移步论坛交流:https://ask.kubesphere.io/forum/。

本文由博客一文多发平台 OpenWrite 发布!

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-02-22 06:50:04       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-02-22 06:50:04       106 阅读
  3. 在Django里面运行非项目文件

    2024-02-22 06:50:04       87 阅读
  4. Python语言-面向对象

    2024-02-22 06:50:04       96 阅读

热门阅读

  1. 构建一个待办事项列表(To-Do List)应用程序

    2024-02-22 06:50:04       47 阅读
  2. Top-N 泛型工具类

    2024-02-22 06:50:04       49 阅读
  3. MySQL、Redis、Nginx配置优化

    2024-02-22 06:50:04       54 阅读
  4. C++知识点总结(18):排序算法汇总

    2024-02-22 06:50:04       43 阅读
  5. 【笔记】flutter 日历年月日自定义国际化显示

    2024-02-22 06:50:04       47 阅读
  6. 图片数据增强

    2024-02-22 06:50:04       43 阅读
  7. xlua源码分析(六) C#与lua的交互总结

    2024-02-22 06:50:04       59 阅读
  8. Unity3D xLua开发环境搭建详解

    2024-02-22 06:50:04       59 阅读
  9. 雪花算法生成分布式主键ID

    2024-02-22 06:50:04       42 阅读
  10. db-gpt docker部署进坑

    2024-02-22 06:50:04       56 阅读
  11. FastGPT配置文件及OneAPI程序:

    2024-02-22 06:50:04       49 阅读