对于默认服务帐户,我使用以下kubectl命令为cluster role = cluster-admin创建了clusterrolebinding
kubectl create clusterrolebinding add-on-cluster-admin --clusterrole=cluster-admin --serviceaccount=rbac-test:default
cluster-admin角色绑定到默认服务帐户。
如何再次将其与服务帐户解除绑定?
答案 0 :(得分:3)
运行kubectl
命令时,它将创建以下对象:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
creationTimestamp: null
name: add-on-cluster-admin
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: default
namespace: rbac-test
您应该能够删除该对象:
kubectl delete clusterrolebinding add-on-cluster-admin