K8S-API接口token配置成功秘籍
kubectl get secret -n kube-system | grep adminkubectl describe secret admin-user-token-????-n kube-system |grep token复制秘钥到postmanurl是集群httpps://IP:6443header 是Token=秘钥如果 报错Error from ser...
·
kubectl get secret -n kube-system | grep admin
kubectl describe secret admin-user-token-???? -n kube-system |grep token
复制秘钥到postman
url是集群https://IP:6443
header 是Token=秘钥
如果 报错
Error from server (Forbidden): Forbidden (user=system:anonymous, verb=get, resource=nodes, subresource=proxy)
解决办法
绑定一个cluster-admin的权限
kubectl create clusterrolebinding system:anonymous --clusterrole=cluster-admin --user=system:anonymous
然后就成功
更多推荐
已为社区贡献11条内容
所有评论(0)