AWS的ESK启用插件kubesphere Devops异常 namespaces "kubesphere-devops-worker" not found
**************************************************
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导航栏为空呢?
麻烦帮忙看下
YyudongK零S
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。
在此之前是有两个问题:
- 开启devops功能后,报错kubesphere-devops-worker not found,参照上面的解决方案替换helm包为ks-devops-0.2.1.tgz 并手动创建namespace后解决了
- monitoring 安装failed,参考 https://ask.kubesphere.io/forum/d/9338-kubesphere/17 基于ks-installer:v3.3.2镜像,修改了镜像配置后也解决了
接着就碰到了上面反馈的问题,安装均成功,但devops导航栏为空,namespace中也没有任何资源。
YyudongK零S
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仍然为空,麻烦再帮忙看看
YyudongK零S
laozhou333 KubeSphere 是什么版本的 ?执行下 helm ls -A
看下 DevOps release 有没有安装?
是3.3.2版本的
kubesphere/ks-installer:v3.3.2
hi,请问我该如何解决这个问题,期望得到回复
YyudongK零S
laozhou333 从上面截图发现 DevOps release 没有安装;可以参考 26楼 ,再尝试删掉 status.devops ,然后修改下 devops 下的任意配置触发下 DevOps 安装试试 ;
已经尝试很多次了,如果不手动创建namespace会报错 kubesphere-devops-worker not found,手动创建的情况下安装完成,但devops导航栏为空,实际并未安装
YyudongK零S
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版本可以解决吗?