在群集中使用GItLab CI/CD kubernetes executor运行作业时出错
错误:作业失败(系统故障):pods被禁止:用户“system:serviceaccount:gitlab:gitlab admin”无法在命名空间“gitlab”中的API组“”中创建资源“pods”,因为您没有提供足够的信息,我认为您的配置不正确。 我建议阅读以下关于和的Kubernetes文档 如果我没有弄错的话,这个命令应该可以修复它:在群集中使用GItLab CI/CD kubernetes executor运行作业时出错,kubernetes,gitlab,gitlab-ci,gitlab-ci-runner,rbac,Kubernetes,Gitlab,Gitlab Ci,Gitlab Ci Runner,Rbac,错误:作业失败(系统故障):pods被禁止:用户“system:serviceaccount:gitlab:gitlab admin”无法在命名空间“gitlab”中的API组“”中创建资源“pods”,因为您没有提供足够的信息,我认为您的配置不正确。 我建议阅读以下关于和的Kubernetes文档 如果我没有弄错的话,这个命令应该可以修复它: kubectl create clusterrolebinding gitlab-cluster-admin --clusterrole=cluster
kubectl create clusterrolebinding gitlab-cluster-admin --clusterrole=cluster-admin --group=system:serviceaccounts --namespace=gitlab
如果没有,则需要使用以下内容编辑您的文档:
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
namespace: gitlab
name: gitlab-admin
rules:
- apiGroups: [""] # "" indicates the core API group
resources: ["pods"]
verbs: ["create", "get", "watch", "list"]
这是一个例子,您应该进行更改以更好地满足您的需要
如果你能提供更多的细节,我会尽力帮助你