我在 kube-system
命名空间下创建了一个名为“test-sa”的 ServiceAccount,并创建了一个 ClusterRoleBinding 将该服务帐户绑定到 cluster-admin
角色:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: test-sa-binding
subjects:
- kind: ServiceAccount
name: test-sa
apiGroup: ""
namespace: kube-system
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: ""
尝试执行 helm install
命令时,使用此服务帐户时出现以下错误:
无法继续安装:无法获取有关资源的信息:serviceaccounts“test-sa-ns1”被禁止:用户“test-sa”无法获取命名空间“ns1”中API组“”中的资源“serviceaccounts” "
我在这里错过了什么?据我所知 ClusterRoleBinding 应该适用于所有命名空间