gpt4 book ai didi

jenkins - 用户无法在 API 组中获取资源 "services"- Jenkins 管道 EKS 部署

转载 作者:行者123 更新时间:2023-12-04 13:11:58 25 4
gpt4 key购买 nike

我正在尝试使用 Jenkins 将我的 docker 镜像部署到集群中。我的 Jenkins 应用程序在 EC2 ubuntu 服务器中运行。最初,当我尝试时,我收到了这个错误。
enter image description here
我指的是这个stack
并使用以下命令将 Jenkins 用户 IAM arn 添加到 Kube 配置文件中

kubectl edit configmap aws-auth -n kube-system
运行管道时更新配置文件后,出现此新错误
enter image description here
我的问题是,
  • 这个 Jenkins 用户是管理员用户,那么为什么我会收到这个访问控制错误?

  • 请在这件事上给予我帮助?

    最佳答案

    正如评论中提到的
    service account jenkins 没有列出 pod kube-system 的权限。您必须创建 ClusterRoleBindingClusterRole使其工作。
    你可以用 kubectl create 做到这一点就像上面@Gowtham Babu 的回答一样。
    有一个来自以下中等教程的示例

    Also when rbac is set to true, following have to be done in order to allow jenkins pod access to “kube-system” namespace of the kubernetes cluster.

    Create a clusterrolebinding with permissions “cluster-admin”,

    kubectl create clusterrolebinding jenkinsrolebinding - -clusterrole=cluster-admin - - group=system:serviceaccounts:jenkins
    其他资源:
  • https://medium.com/@pallavisengupta/jenkins-kubernetes-authentication-and-authorization-fa6966356c90
  • https://kubernetes.io/docs/reference/access-authn-authz/rbac/
  • 关于jenkins - 用户无法在 API 组中获取资源 "services"- Jenkins 管道 EKS 部署,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64160498/

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