简体   繁体   English

无法通过kubeconfig访问Kubernetes仪表板

[英]Unable to access Kubernetes Dashboard via kubeconfig

I'm trying to access Kubernetes Dashboard via a kubeconfig file but I don't know how to create a kubeconfig file to access it. 我正在尝试通过kubeconfig文件访问Kubernetes仪表板,但是我不知道如何创建kubeconfig文件来访问它。

I can access it by a token way but I want to access it by a kubeconfig file, too. 我可以通过令牌方式访问它,但是我也想通过kubeconfig文件访问它。

thanks 谢谢

Can you explain what you mean when you say you can access it by token but not through a kubeconfig? 当您说可以通过令牌但不能通过kubeconfig访问它时,您能否解释您的意思? Kubeconfigs simply store authentication information in them, which can include authentication via a token. Kubeconfigs只是在其中存储身份验证信息,其中可以包括通过令牌进行的身份验证。 Assuming the rest of your kubeconfig file is populated, you just need to modify it so that your user information contains the token, like so: 假设已填充其余的kubeconfig文件,则只需对其进行修改,以使用户信息包含令牌,如下所示:

users:
- name: my-user
  user:
    token: <token-here>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM