消息:"services "kubernetes-dashboard“未找到”,

message: "services "kubernetes-dashboard" not found",

Kubernetes 仪表板文档 (https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/) 说: Kubectl will make Dashboard available at http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/. 但是我在使用 URL:

时得到了这个
{
kind: "Status",
apiVersion: "v1",
metadata: { },
status: "Failure",
message: "services "kubernetes-dashboard" not found",
reason: "NotFound",
details: {
name: "kubernetes-dashboard",
kind: "services"
},
code: 404
}

仅供参考

[vagrant@master ~]$ kubectl get all -n kube-system
NAME                                            READY   STATUS    RESTARTS   AGE
pod/coredns-54f8cbd98d-92d2m                    1/1     Running   0          19m
pod/coredns-54f8cbd98d-v487z                    1/1     Running   0          19m
pod/etcd-master.vagrant.vm                      1/1     Running   0          19m
pod/kube-apiserver-master.vagrant.vm            1/1     Running   0          18m
pod/kube-controller-manager-master.vagrant.vm   1/1     Running   1          19m
pod/kube-flannel-ds-2tr49                       1/1     Running   0          18m
pod/kube-flannel-ds-552d5                       1/1     Running   0          13m
pod/kube-flannel-ds-dbv5p                       1/1     Running   0          16m
pod/kube-proxy-29l59                            1/1     Running   0          13m
pod/kube-proxy-ctsnx                            1/1     Running   0          16m
pod/kube-proxy-swxhg                            1/1     Running   0          19m
pod/kube-scheduler-master.vagrant.vm            1/1     Running   1          19m
pod/kubernetes-dashboard-86b8d78468-6c52b       1/1     Running   0          19m
NAME                           TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)         AGE
service/kube-dns               ClusterIP   10.96.0.10      <none>        53/UDP,53/TCP   19m
service/kubernetes-dashboard   ClusterIP   10.103.110.54   <none>        443/TCP         19m
NAME                             DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR                   AGE
daemonset.apps/kube-flannel-ds   3         3         3       3            3           beta.kubernetes.io/arch=amd64   19m
daemonset.apps/kube-proxy        3         3         3       3            3           <none>                          19m
NAME                                   DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/coredns                2         2         2            2           19m
deployment.apps/kubernetes-dashboard   1         1         1            1           19m
NAME                                              DESIRED   CURRENT   READY   AGE
replicaset.apps/coredns-54f8cbd98d                2         2         2       19m
replicaset.apps/coredns-85d6cff8d8                0         0         0       19m
replicaset.apps/kubernetes-dashboard-86b8d78468   1         1         1       19m

文档可能没有更新。由于该服务是在 kube-system 命名空间中创建的,因此您可以在下面使用

http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/