Kubernetes dashboard showing Unauthorized

人盡茶涼 提交于 2019-12-06 19:32:33
Mohamed Ali

run kubectl proxy command with --accept-hosts option

 kubectl proxy --address="172.20.22.101" -p 8001  --accept-hosts="^*$"

and it will work fine.

Note: this is not recommended for production grade kubernetes clusters, since you're accessing the dashboard through plain http.

More secure alternative is to run access the dashboard through ssh tunnel like this.

in one terminal run:

kubectl proxy 

in another terminal run a ssh tunnel to localhost:8001 (the default kubernetes dashboard port)

ssh -NT -l SSH_USER -p SSH_PORT K8S_CONTROLLER_IP_ADDR -L 8001:localhost:8001
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!