K8s 创建bootstrap角色赋予权限用于连接apiserver请求签名报错

错误集——k8s 创建bootstrap角色赋予权限用于连接apiserver请求签名报错

错误代码:Error from server (AlreadyExists): clusterrolebindings.rbac.authorization.k8s.io “kubelet-tstrap” already exists

[root@hellolic ~/k8s/kubeconfig] # kubectl create clusterrolebinding kubelet-bootstrap --cterrole=system:node-bootstrapper --user=kubelet-bootstrap
	Error from server (AlreadyExists): clusterrolebindings.rbac.authorization.k8s.io "kubelet-tstrap" already exists

原因:
因为之前已经创建过错误的签名,签名被占用,需要删除已经被占用的签名

解决方法:
删除原有签名,重新生成

删除: kubectl delete clusterrolebindings kubelet-bootstrap
clusterrolebinding.rbac.authorization.k8s.io “kubelet-bootstrap” deleted

重新生成:kubectl create clusterrolebinding kubelet-bootstrap --cterrole=system:node-bootstrapper --user=kubelet-bootstrap

[root@hellolic ~/k8s/kubeconfig] # kubectl delete clusterrolebindings kubelet-bootstrap
clusterrolebinding.rbac.authorization.k8s.io "kubelet-bootstrap" deleted

[root@hellolic ~/k8s/kubeconfig] # kubectl create clusterrolebinding kubelet-bootstrap --cterrole=system:node-bootstrapper --user=kubelet-bootstrap
clusterrolebinding.rbac.authorization.k8s.io/kubelet-bootstrap created


 

你可能感兴趣的:(kubernetes,错误集)