• DevOps
  • AWS的ESK启用插件kubesphere Devops异常 namespaces "kubesphere-devops-worker" not found

panpan 你好,看起来是 cronjob 的问题。

麻烦执行下这两个命令看下输出。

# kubectl api-versions | grep batch/v1
batch/v1
batch/v1beta1

# kubectl version

    Youngo 后面这个问题,楼主你解决没有呢?我也是 EKS1.26+kubeshpere 3.4.0 实在没有法,我就准备降级了。

    Youngo 后面这个问题,楼主你解决没有呢?我也是 EKS1.26+kubeshpere 3.4.0 实在没有法,我就准备降级了。

    chilianyi # kubectl api-versions | grep batch/v1
    batch/v1
    batch/v1beta1

    kubectl version

    ks-installer-758d459599-592×9:/kubesphere$ kubectl api-versions | grep batch/v1

    batch/v1

    ks-installer-758d459599-592×9:/kubesphere$ kubectl version

    Client Version: version.Info{Major:“1”, Minor:“23”, GitVersion:“v1.23.7”, GitCommit:“42c05a547468804b2053ecf60a3bd15560362fc2”, GitTreeState:“clean”, BuildDate:“2022-05-24T12:30:55Z”, GoVersion:“go1.17.10”, Compiler:“gc”, Platform:“linux/amd64”}

    Server Version: version.Info{Major:“1”, Minor:“26+”, GitVersion:“v1.26.7-eks-2d98532”, GitCommit:“c9c3fc1fdf677f38b8d26568c10b921a1235fa43”, GitTreeState:“clean”, BuildDate:“2023-07-28T16:51:21Z”, GoVersion:“go1.20.6”, Compiler:“gc”, Platform:“linux/amd64”}

    WARNING: version difference between client (1.23) and server (1.26) exceeds the supported minor version skew of +/-1

    请大神抽空再帮看看,做最后的努力 了

      panpan

      kubesphere/ks-devops#998
      你好,是个 bug,错误的识别了 k8s 的版本,导致安装时,cronjob 用了 batch/v1beta1, 但 k8s 1.26 里已经只有 batch/v1 没有 batch/v1beta1 了, 导致安装失败。

      目前已经做了修复,在 helm chart 中,kubesphere-sigs/ks-devops-helm-chart#122/files
      晚些 会提供下 新的 helm chart,到时 更新下 ks-installer 中对应的 helm 包,就可以正常安装了。

        panpan 你好,经过我们测试发现是创建 cronjob 的 apiversion 有问题,在 chart 包里的比较当前 k8s 版本没有生效;针对 ks 3.4.0 麻烦先参考下面步骤,先临时手动修复下,后面会在新版本 3.4.1 修复此问题:

        1. 编辑 ks-installer deployment,修改 securityContext.runAsUser 为 0,以 root 用户运行 ks-installer:
          kubectl -n kubesphere-system edit deployments.apps ks-installer
        2. 下载更新后的 ke-devops helm 包 ks-devops-0.2.1.tgz
        3. 等待 ks-installer 重启完成之后,替换 helm 包:
          kubectl -n kubesphere-system cp ks-devops-0.2.1.tgz $(kubectl get pod -n kubesphere-system -l app=ks-installer -o jsonpath='{.items[0].metadata.name}'):/kubesphere/installer/roles/ks-devops/files/ks-devops/charts/
        4. 重新开启 ks-devops 组件
          kubectl -n kubesphere-system edit cc ks-installer

          如果 status.devops 存在,删除 status.devops,即删除截图中的三行;

          修改 spec.devops 配置里任意一项,如图中的 jenkinsCpuReq ,触发重新安装 DevOps 即可;

          chilianyi

          感谢大神,按照建议的方式,已安装devops成功,我明天再具体使用一下。

          拜谢

          chilianyi

          感谢大神,按照建议的方式,已安装devops成功,我明天再具体使用一下。

          拜谢

          yudong

          感谢大神,按照建议的方式,已安装devops成功,我明天再具体使用一下。

          拜谢

          yudong

          另外,3.4.0 还有一个 BUG,关于 HPA,如下图,

          请大神们,方便时也帮忙看看。 目前我是直接通过 kubectl 来命令行设置 HPA。

          感谢二位大神,祝国庆快乐!中秋快乐!

            5 天 后

            yudong
            你好,按照上面的操作
            查看安装日志也没有报错:kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l ‘app in (ks-install, ks-installer)’ -o jsonpath=‘{.items[0].metadata.name}’) -f

            但是系统组件-devops里面全是停止,这是怎么回事?

              4 天 后

              panpan 先检查下是不是没有开启 Metrics_Server 服务 ?或者看下 ks-apiserver 的日志信息,是否有相关报错信息。

                Youngo 看下 Kubesphere-devops-system 下的 pod 状态是不是正常的 ?是否做过卸载 DevOps 操作 ?

                  3 个月 后

                  yudong

                  目前发现3.4.1是的弹性扩缩(HPA)是正常的。

                  就是 3.4.0 有问题,如上面的截图,即使编辑 CC,把metric-server设置为true了,还是不行,后台还是一直在报错(即使将kube-state-metrics从 2.6.0 升级到 2.8.2 ,还是一样):

                  考虑到已经有很多业务正在3.4.0运行了,又不敢升级至 3.4.1。 请大神看看有没有在 3.4.0 上修复的办法?感谢

                  3 个月 后

                  **************************************************

                  Waiting for all tasks to be completed …

                  task network status is successful (⅕)

                  task multicluster status is successful (⅖)

                  task openpitrix status is successful (⅗)

                  task devops status is successful (⅘)

                  task monitoring status is successful (5/5)

                  **************************************************

                  我按照上面的方法把devops创建成功了,但是为什么kubesphere中的devops导航栏为空呢?
                  麻烦帮忙看下

                    laozhou333 执行下命令 kubectl -n kubesphere-devops-system get pod看下 devops 相关服务的状态 ?

                    kubectl -n kubesphere-devops-system get pod
                    No resources found in kubesphere-devops-system namespace.
                    是空的,环境是aws eks 1.28。
                    在此之前是有两个问题:

                    1. 开启devops功能后,报错kubesphere-devops-worker not found,参照上面的解决方案替换helm包为ks-devops-0.2.1.tgz 并手动创建namespace后解决了
                    2. monitoring 安装failed,参考 https://ask.kubesphere.io/forum/d/9338-kubesphere/17 基于ks-installer:v3.3.2镜像,修改了镜像配置后也解决了

                    接着就碰到了上面反馈的问题,安装均成功,但devops导航栏为空,namespace中也没有任何资源。

                      laozhou333 这个可能是之前安装 devops 失败了,但是 ClusterConfiguration status 里 DevOps 是 enabled ,ks-installer 认为已经安装了,所以没有再安装了;可以重新安装 DevOps :

                      执行下面命令编译 ClusterConfigurations ks-installer 文件,清理删除 status.devops

                      kubectl -n kubesphere-system edit clusterconfigurations.installer.kubesphere.io ks-installer

                      然后在重启下 ks-installer 服务就可以重新安装了。

                      删除ClusterConfigurations 中status.devops部分后,重启kubectl -n kubesphere-system rollout restart deploy ks-installer,cp ks-devops-0.2.1.tgz的包
                      kubectl -n kubesphere-system cp ks-devops-0.2.1.tgz $(kubectl get pod -n kubesphere-system -l app=ks-installer -o jsonpath=‘{.items[0].metadata.name}’):/kubesphere/installer/roles/ks-devops/files/ks-devops/charts/
                      安装完成:
                      Waiting for all tasks to be completed …
                      task network status is successful (⅕)
                      task multicluster status is successful (⅖)
                      task openpitrix status is successful (⅗)
                      task devops status is successful (⅘)
                      task monitoring status is successful (5/5)
                      但devops仍然为空,麻烦再帮忙看看