gpt4 book ai didi

Jenkins Kubernetes Serviceaccount 无法列出 Pod

转载 作者:行者123 更新时间:2023-12-02 11:49:13 26 4
gpt4 key购买 nike

使用以下命令为 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 似乎尝试使用默认服务帐户。

如何解决这个问题?

最佳答案

这个对我有用kubectl 创建 clusterrolebinding jenkins --clusterrole cluster-admin --serviceaccount=jenkins:default

关于Jenkins Kubernetes Serviceaccount 无法列出 Pod,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46519922/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com