简体   繁体   English

Azure k8s 仪表板无法打开

[英]Azure k8s dashboard does not open

I have k8s cluster on Azure and can not access the dashboard.我在 Azure 上有 k8s 集群,无法访问仪表板。 To access it I was doing aks browse --resource-group <res_group> --name <cluster_name> It does not open after accidentally deleted the kube-dashboard pod.要访问它,我正在执行aks browse --resource-group <res_group> --name <cluster_name>在意外删除kube-dashboard pod 后它不会打开。

Error: Couldn't find the Kubernetes dashboard pod.错误: Couldn't find the Kubernetes dashboard pod.

Did try to enable-disbale dashboard add-on on Azure.尝试在 Azure 上启用-禁用仪表板插件。 Re-install k8s-dashboard.重新安装 k8s-dashboard。 (Azure did not allow) (Azure 不允许)

Any ideas on how to solve the issue and restart the dashboard?关于如何解决问题并重新启动仪表板的任何想法?

Did find the following solution that worked for me:确实找到了以下对我有用的解决方案:

  1. Created another Azure k8s cluster.创建了另一个 Azure k8s 集群。 For each cluster Azure makes a dashboard deployment.对于每个群集,Azure 都会进行仪表板部署。

  2. Copied the yaml files with the command: kubectl get deployment -n kube-system <kubernetes-dasboard-xxx> for each "deployment, replicaSet, service and pod related to dashboard"使用以下命令复制 yaml 文件: kubectl get deployment -n kube-system <kubernetes-dasboard-xxx>为每个“与仪表板相关的部署、副本集、服务和 pod”

  3. Recreated them into the old not working cluster.将它们重新创建到旧的不工作集群中。

  4. Upgraded-downgraded the cluster version to re-deploy the objects.升级-降级集群版本以重新部署对象。

Depends on your k8s version, AKS doesn't enable dashboard while creating a new cluster.根据您的 k8s 版本,AKS 在创建新集群时不会启用仪表板。 You can find details in below link.您可以在以下链接中找到详细信息。

https://docs.microsoft.com/en-us/azure/aks/kubernetes-dashboard https://docs.microsoft.com/en-us/azure/aks/kubernetes-dashboard

And I suggest you, can directly install dashboard from kubernetes dashboard page, it is installing dashboard another namespace(it it better actually) and you can create and RBAC account to see all resources as an admin privileges.我建议您,可以直接从 kubernetes 仪表板页面安装仪表板,它正在安装仪表板另一个命名空间(实际上更好),您可以创建和 RBAC 帐户以管理员权限查看所有资源。

https://github.com/kubernetes/dashboard https://github.com/kubernetes/dashboard/blob/master/docs/user/access-control/creating-sample-user.md https://github.com/kubernetes/dashboard https://github.com/kubernetes/dashboard/blob/master/docs/user/access-control/creating-sample-user.md

And also you can use --enable-addons你也可以使用--enable-addons
https://docs.microsoft.com/en-us/azure/aks/kubernetes-dashboard https://docs.microsoft.com/en-us/azure/aks/kubernetes-dashboard

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

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