使用以下命令为Jenkins创建服务帐户后:
kubectl -n jenkins create sa jenkins
kubectl create clusterrolebinding jenkins --clusterrole cluster-admin --serviceaccount=jenkins:jenkins
并在Jenkins中添加证书(管理Jenkins - >配置系统 - >添加云)我收到错误消息
Error connecting to https://169.46.7.238:21769:
Failure executing: GET at:
https://169.46.7.238:21769/api/v1/namespaces/jenkins/pods.
Message: Forbidden!Configured service account doesn't have access.
Service account may have been revoked.
User "system:serviceaccount:jenkins:default" cannot list pods in the namespace "jenkins"..
Jenkins似乎试图使用default
Serviceaccount。
如何解决这个问题?
答案 0 :(得分:0)
以防万一,您是否可以尝试创建服务帐户system:serviceaccount:jenkins:default
而不是jenkins
?