【发布时间】:2019-03-08 11:47:05
【问题描述】:
我正在尝试在 Jenkins 中配置 kubernetes 插件。以下是我要输入的详细信息:
现在,当我单击测试连接时,出现以下错误:
Error testing connection https://xx.xx.xx.xx:8001: Failure executing: GET at: https://xx.xx.xx.xx:8001/api/v1/namespaces/default/pods. Message: Unauthorized! Configured service account doesn't have access. Service account may have been revoked. Unauthorized.
在google了一番后,我意识到可能是因为角色绑定,所以我为我的default服务帐户创建了一个角色绑定:
# kubectl describe rolebinding jenkins
Name: jenkins
Labels: <none>
Annotations: <none>
Role:
Kind: ClusterRole
Name: pod-reader
Subjects:
Kind Name Namespace
---- ---- ---------
ServiceAccount default default
这里是 pod-reader 角色:
# kubectl describe role pod-reader
Name: pod-reader
Labels: <none>
Annotations: <none>
PolicyRule:
Resources Non-Resource URLs Resource Names Verbs
--------- ----------------- -------------- -----
pods [] [] [get watch list]
但我仍然遇到同样的错误。这里还有什么需要做的吗? TIA。
【问题讨论】:
标签: jenkins kubernetes jenkins-plugins