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

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仍然为空,麻烦再帮忙看看

              laozhou333 KubeSphere 是什么版本的 ?执行下 helm ls -A 看下 DevOps release 有没有安装?

              hi,请问我该如何解决这个问题,期望得到回复

                laozhou333 从上面截图发现 DevOps release 没有安装;可以参考 26楼 ,再尝试删掉 status.devops ,然后修改下 devops 下的任意配置触发下 DevOps 安装试试 ;

                已经尝试很多次了,如果不手动创建namespace会报错 kubesphere-devops-worker not found,手动创建的情况下安装完成,但devops导航栏为空,实际并未安装

                  laozhou333 执行下面命令 kubectl -n kubesphere-system exec -it $(kubectl get pod -n kubesphere-system -l app=ks-installer -o jsonpath='{.items[0].metadata.name}') -- sh

                  进入 ks-installer 容器,然后进到目录 /kubesphere/results/devops/devops/job_events ,看下这里的 json 文件能不能找到原因,比如:cat 140-ad4ba4a6-7c1e-4fb3-b9a7-7eb558882df4.json | jq

                  是ks-install版本问题吗?我cp 2.1版本后是有两个tgz的包,曾怀疑是0.2.1的包未生效,尝试删除0.1.19但对0.1.19也有依赖

                  -rw-r–r– 1 root root 66841 May 25 2023 ks-devops-0.1.19.tgz
                  -rw-r–r– 1 501 dialout 71149 Mar 24 14:26 ks-devops-0.2.1.tgz

                    cat 140-364142e0-4652-4c30-ae36-addf046cffbd.json |jq

                    {

                    “uuid”: “364142e0-4652-4c30-ae36-addf046cffbd”,

                    “counter”: 140,

                    “stdout”: "",

                    “start_line”: 170,

                    “end_line”: 170,

                    “runner_ident”: “devops”,

                    “event”: “runner_on_start”,

                    “pid”: 30139,

                    “created”: “2024-03-25T03:57:49.481470”,

                    “parent_uuid”: “2eb11b1e-62d8-f385-6410-000000000042”,

                    “event_data”: {

                    "playbook": "/kubesphere/playbooks/devops.yaml",
                    
                    "playbook_uuid": "49c7852d-3774-498c-8c07-bd2a93617d4b",
                    
                    "play": "localhost",
                    
                    "play_uuid": "2eb11b1e-62d8-f385-6410-000000000005",
                    
                    "play_pattern": "localhost",
                    
                    "task": "ks-devops | Upgrading or installing ks-devops",
                    
                    "task_uuid": "2eb11b1e-62d8-f385-6410-000000000042",
                    
                    "task_action": "shell",
                    
                    "resolved_action": "shell",
                    
                    "task_args": "",
                    
                    "task_path": "/kubesphere/installer/roles/ks-devops/tasks/main.yaml:191",
                    
                    "role": "ks-devops",
                    
                    "host": "localhost",
                    
                    "uuid": "364142e0-4652-4c30-ae36-addf046cffbd"

                    }

                    }

                    查找了/kubesphere/results/devops/devops/job_events目录下所有包含"error"的文件,如图,只有Error from server (NotFound): namespaces \“kubesphere-devops-system\” not found"
                    升级kubesphere版本可以解决吗?

                    laozhou333 是的,你的怀疑是对的,ks 3.3.2 用的 0.1.19 版本的 ks-devops ; ks 3.4.0 用的 0.2.1 版本的;

                    你的环境是 ks 3.3.2 ,所以应该用 0.1.19 版本的:ks-devops-0.1.19.tgz

                    用这个 0.1.19 版本的应该就可以了。