- 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
]
KubeSphere+DevOps部署到K8S问题
- 已编辑
看报错只是权限问题: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
已解决,在控制台执行上面集群角色绑定后。