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


然后就成功

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐