小工具知识网

当前位置: 首页 > 行业知识 > kubesphere jenkins 流水线 未运行(解决方案)

行业知识

kubesphere jenkins 流水线 未运行(解决方案)

2026-11-03 02:21:14 来源:互联网转载

场���: 

在kubesphere 中运行 流水线 devops 结果,显示未运行

但是用 admin 账户是可以运行成功的。

问题解决

 

1- 查日志: 

然后

Caused: org.acegisecurity.userdetails.UsernameNotFoundException: org.springframework.security.core.userdetails.UsernameNotFoundException: org.acegisecurity.userdetails.UsernameNotFoundException: User project-admin not found in directory.; nested exception is org.springframework.security.core.userdetails.UsernameNotFoundException: org.acegisecurity.userdetails.UsernameNotFoundException: User project-admin not found in directory.

我们发现:

User project-admin not found in directory

这个错误 原因是

Jenkins 使用的是openldap,不会直接创建用户。在安装时会对 openldap 初始化创建 project-admin 用户,看project admin 用户没写到 OpenLDAP

2-怎么解决呢?

在启用 devops 组件的集群上执行:

kubectl patch users project-admin -p '{"spec":{"password":"P@88w0rd"}}' --type='merge' && kubectl annotate users admin iam.kubesphere.io/password-encrypted-

同步一下就可以了。

再返回 流水线, 用 project-admin 账户 (这是我后期建立的账户) 来跑就可以了

如果还不行, 需要我们登录 jenkis后台,添加用户角色

kubesphere中 登录jenkins,可以参考: k8s jenkins-kubesphere  登录: 连接

登录后: 

找到“系统管理”

往下拉找打到“manage  and  assign roles ”

点击 分配角色

(1)添加用户

(2) 对刚添加的用户分配角色

希望能帮助到你。

上一篇:圣歌怎么连上服务器?

下一篇:Flutter - 环境配置提示 cmdline-tools component is missing