Kubernetes仪表板UI不会在本地启动

时间:2019-02-24 01:07:04

标签: kubernetes

我正在遵循仪表板用户界面(https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/)的教程

我最初是这样安装仪表板的:

kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/master/aio/deploy/alternative/kubernetes-dashboard.yaml

有些东西已经安装,有些却给出了已经存在的错误。

当我运行kubectl proxy并尝试按照教程中的说明转到http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/时,它将给我以下消息:

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

  },
  "status": "Failure",
  "message": "no endpoints available for service \"https:kubernetes-dashboard:\"",
  "reason": "ServiceUnavailable",
  "code": 503
}

但是如果我去:http://127.0.0.1:8001/api/v1/namespaces/kube-system/services/kubernetes-dashboard

我得到以下输出:

{
  "kind": "Service",
  "apiVersion": "v1",
  "metadata": {
    "name": "kubernetes-dashboard",
    "namespace": "kube-system",
    "selfLink": "/api/v1/namespaces/kube-system/services/kubernetes-dashboard",
    "uid": "8f4cc6de-25d0-11e9-a10e-42c090e3c929",
    "resourceVersion": "224",
    "creationTimestamp": "2019-02-01T03:22:09Z",
    "labels": {
      "addonmanager.kubernetes.io/mode": "Reconcile",
      "k8s-app": "kubernetes-dashboard",
      "kubernetes.io/cluster-service": "true"
    },
    "annotations": {
      "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"v1\",\"kind\":\"Service\",\"metadata\":{\"annotations\":{},\"labels\":{\"addonmanager.kubernetes.io/mode\":\"Reconcile\",\"k8s-app\":\"kubernetes-dashboard\",\"kubernetes.io/cluster-service\":\"true\"},\"name\":\"kubernetes-dashboard\",\"namespace\":\"kube-system\"},\"spec\":{\"ports\":[{\"port\":80,\"targetPort\":\"http\"}],\"selector\":{\"k8s-app\":\"kubernetes-dashboard\"},\"type\":\"ClusterIP\"}}\n"
    }
  },
  "spec": {
    "ports": [
      {
        "protocol": "TCP",
        "port": 80,
        "targetPort": "http"
      }
    ],
    "selector": {
      "k8s-app": "kubernetes-dashboard"
    },
    "clusterIP": "10.0.221.121",
    "type": "ClusterIP",
    "sessionAffinity": "None"
  },
  "status": {
    "loadBalancer": {

    }
  }
}

我是kubernetes的新手,正在努力调试该问题(因此,我要学习基本教程)。

我找到了一条建议删除它的帖子,然后尝试再次安装,但实际上我不确定如何执行此操作。

看着命令,我试图看到如下资源:

λ kubectl get all
NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
service/kubernetes   ClusterIP   10.0.0.1     <none>        443/TCP   22d

似乎只是显示集群而不是仪表板ui。群集IP地址与上述端点数据中的群集IP不同,但是我不确定这是否有意义。我为Visual Studio安装了Azure CLI和AKS工具,我认为可能已经在本地kubernetes中进行了一些设置。

我在这里不知所措。如何调试此问题?

编辑:

我发现它需要--all-namespaces。我现在得到了这个输出:

λ kubectl get all --all-namespaces | grep dashboard
kube-system   pod/kubernetes-dashboard-dfbbfd8-kd5dv                                1/1       Running   0          22d
kube-system   service/kubernetes-dashboard                                  ClusterIP      10.0.221.121   <none>          80/TCP                       22d


kube-system   deployment.extensions/kubernetes-dashboard                                      1         1         1            0           22d

kube-system   replicaset.extensions/kubernetes-dashboard-dfbbfd8                                        1         1         0         22d

好像我在AKS节点上操作。我得到以下输出:

λ kubectl get node --all-namespaces
NAME                       STATUS     ROLES     AGE       VERSION
aks-agentpool-15575963-0   NotReady   agent     22d       v1.12.4

我如何在本地工作?我认为这是在安装Azure cli或VS工具时已设置的东西。

0 个答案:

没有答案