Error message when trying to connect to cluster endpoint

社会主义新天地 提交于 2020-01-06 07:57:31

问题


When I try to connect to my Kubernetes cluster endpoint IP, I get this message. Does anybody knows where this comes from and would could be the problem here?

{
  "kind": "Status",
  "apiVersion": "v1",
  "metadata": {

  },
  "status": "Failure",
  "message": "forbidden: User \"system:anonymous\" cannot get path \"/\": No policy matched.",
  "reason": "Forbidden",
  "details": {

  },
  "code": 403
}

回答1:


You did not provide to many information on what you want to achieve. But as Konstantin already mentioned, this error is visible only when you try to access the API as unauthorized (anonymous) user. You have probably tried to curl the API server as an anonymous user.

You can find exact steps on how to explore the API server in this great article.

To interact with the Kubernetes API you need a ServiceAccount with the correct permissions, obtained through a (Cluster)Role and a RoleBinding. Authenticate by using the ServiceAccount’s token. Since all communication is over TLS you also need the self-signed certificate. Alternatively, allow insecure connections, but this is not recommended.

More about Kubernetes API and how to access it here.



来源:https://stackoverflow.com/questions/54252274/error-message-when-trying-to-connect-to-cluster-endpoint

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