K8S-API接口token配置成功秘籍

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


然后就成功

K8S-API接口token配置成功秘籍_第1张图片

你可能感兴趣的:(K8S)