根据以下文件:https://kubernetes.io/docs/tasks/web-ui-dashboard/ 我跑了:
kubectl create -f https://rawgit.com/kubernetes/dashboard/master/src/deploy/kubernetes-dashboard.yaml
然后我尝试运行它来公开服务
cluster/kubectl.sh expose svc/kubernetes
但我一直收到错误:
error: couldn't retrieve selectors via --selector flag or introspection: the service has no pod selector set
See 'kubectl expose -h' for help and examples.
我看过这些例子,但无法理解我做错了什么。
kubernetes# cluster/kubectl.sh get all
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
svc/kubernetes 10.0.0.1 <none> 443/TCP 7h
kubernetes# cluster/kubectl.sh get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system kube-dns-806549836-r6wtk 0/3 Pending 0 7h
kube-system kubernetes-dashboard-2396447444-9675d 0/1 Pending 0 6h
答案 0 :(得分:1)
要访问仪表板,通常只需键入:
kubectl cluster-info
然后,它会为您提供访问群集所需的所有网址。