• DevOps
  • KubeSphere+DevOps部署到K8S问题

  • kubectl apply -f bctech-auth/dev-deploy.yaml Error from server (Forbidden): error when retrieving current configuration of: Resource: “apps/v1, Resource=deployments”, GroupVersionKind: “apps/v1, Kind=Deployment” Name: “bctech-auth”, Namespace: “dev-rzt” from server for: “bctech-auth/dev-deploy.yaml”: deployments.apps “bctech-auth” is forbidden: User “system:serviceaccount:kubesphere-devops-worker:default” cannot get resource “deployments” in API group “apps” in the namespace “dev-rzt” Error from server (Forbidden): error when retrieving current configuration of: Resource: “/v1, Resource=services”, GroupVersionKind: “/v1, Kind=Service” Name: “bctech-auth”, Namespace: “dev-rzt” from server for: “bctech-auth/dev-deploy.yaml”: services “bctech-auth” is forbidden: User “system:serviceaccount:kubesphere-devops-worker:default” cannot get resource “services” in API group "" in the namespace “dev-rzt” script returned exit code

[upl-image-preview url=

]

    236765966

    看报错只是权限问题:system:serviceaccount:kubesphere-devops-worker:default

    可以加一个下面的资源再执行看看

    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRoleBinding
    metadata:
      name: kubesphere-devops-worker-installer-binding
    roleRef:
      apiGroup: rbac.authorization.k8s.io
      kind: ClusterRole
      name: ks-installer
    subjects:
    - kind: ServiceAccount
      name: default
      namespace: kubesphere-devops-worker

      sigboom 在哪里加集群角色绑定?界面服务账号那里加不报未能识别资源

      2 年 后