-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
部署以后查看namespace报”You must be logged in to the server (Unauthorized)“错误 #2
Comments
我可能解的图,不对,我后面手动refresh了token,然后又获取新的id_token。 |
那我现在用kubeconfig里面的id_token能访问吗(能自动刷新吗),还是说需要重写获取。 |
另外为什么会报"you must be logged in to the server"错误 |
用 Kubelogin 插件可以自动获取 |
关键是我刚获取的id-token都不行 |
应该是 RBAC 的问题,看下 ClusterRole 和 ClusterRoleBinding |
调整了 |
执行看下是不是有获取 node 的权限:kubectl auth can-i list nodes --as tom |
kubectl get namespace --user tom --token=<id_token> 这样应该就不行了,没指定 --user |
你可以看下 apiserver 的日志,看下有啥异常 |
E1205 08:02:39.410489 1 authentication.go:63] "Unable to authenticate the request" err="invalid bearer token" token不对,新获取的idtoken,而且是重新set crenditial |
环境:
k8s版本是1.23.9,按照你的文档部署keycloak后,修改了kube-apiserver文件,创建clusterrolebinding,同时也配置了credential和context:
报如下错误:
请帮忙看下,谢谢!
The text was updated successfully, but these errors were encountered: