当前位置:  开发笔记 > 运维 > 正文

没有可用于服务\“ kubernetes-dashboard \”的端点

如何解决《没有可用于服务\“kubernetes-dashboard\”的端点》经验,为你挑选了1个好方法。

我正在尝试遵循GitHub-kubernetes / dashboard:Kubernetes集群的通用Web UI。

部署/访问:

# export KUBECONFIG=/etc/kubernetes/admin.conf
# kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/recommended/kubernetes-dashboard.yaml
secret/kubernetes-dashboard-certs created
serviceaccount/kubernetes-dashboard created
role.rbac.authorization.k8s.io/kubernetes-dashboard-minimal created
rolebinding.rbac.authorization.k8s.io/kubernetes-dashboard-minimal created
deployment.apps/kubernetes-dashboard created
service/kubernetes-dashboard created
# kubectl proxy
Starting to serve on 127.0.0.1:8001

卷曲:

# curl 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 \"kubernetes-dashboard\"",
  "reason": "ServiceUnavailable",
  "code": 503
}# 

请指教。

每个@VKR

$ kubectl get pods --all-namespaces 
NAMESPACE     NAME                                              READY   STATUS              RESTARTS   AGE
kube-system   coredns-576cbf47c7-56vg7                          0/1     ContainerCreating   0          57m
kube-system   coredns-576cbf47c7-sn2fk                          0/1     ContainerCreating   0          57m
kube-system   etcd-wcmisdlin02.uftwf.local                      1/1     Running             0          56m
kube-system   kube-apiserver-wcmisdlin02.uftwf.local            1/1     Running             0          56m
kube-system   kube-controller-manager-wcmisdlin02.uftwf.local   1/1     Running             0          56m
kube-system   kube-proxy-2hhf7                                  1/1     Running             0          6m57s
kube-system   kube-proxy-lzfcx                                  1/1     Running             0          7m35s
kube-system   kube-proxy-rndhm                                  1/1     Running             0          57m
kube-system   kube-scheduler-wcmisdlin02.uftwf.local            1/1     Running             0          56m
kube-system   kubernetes-dashboard-77fd78f978-g2hts             0/1     Pending             0          2m38s
$ 

logs

$ kubectl logs kubernetes-dashboard-77fd78f978-g2hts -n kube-system
$ 

describe

$ kubectl describe pod kubernetes-dashboard-77fd78f978-g2hts -n kube-system
Name:               kubernetes-dashboard-77fd78f978-g2hts
Namespace:          kube-system
Priority:           0
PriorityClassName:  
Node:               
Labels:             k8s-app=kubernetes-dashboard
                    pod-template-hash=77fd78f978
Annotations:        
Status:             Pending
IP:                 
Controlled By:      ReplicaSet/kubernetes-dashboard-77fd78f978
Containers:
  kubernetes-dashboard:
    Image:      k8s.gcr.io/kubernetes-dashboard-amd64:v1.10.0
    Port:       8443/TCP
    Host Port:  0/TCP
    Args:
      --auto-generate-certificates
    Liveness:     http-get https://:8443/ delay=30s timeout=30s period=10s #success=1 #failure=3
    Environment:  
    Mounts:
      /certs from kubernetes-dashboard-certs (rw)
      /tmp from tmp-volume (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kubernetes-dashboard-token-gp4l7 (ro)
Conditions:
  Type           Status
  PodScheduled   False 
Volumes:
  kubernetes-dashboard-certs:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  kubernetes-dashboard-certs
    Optional:    false
  tmp-volume:
    Type:    EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:  
  kubernetes-dashboard-token-gp4l7:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  kubernetes-dashboard-token-gp4l7
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  
Tolerations:     node-role.kubernetes.io/master:NoSchedule
                 node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type     Reason            Age                      From               Message
  ----     ------            ----                     ----               -------
  Warning  FailedScheduling  4m39s (x21689 over 20h)  default-scheduler  0/3 nodes are available: 3 node(s) had taints that the pod didn't tolerate.
$ 

小智.. 8

看来您是在尝试利用Kubernetes进行部署,kubeadm但是已经跳过了安装Pod Network Add-on(CNI)的步骤。注意警告:

必须在任何应用程序之前部署网络。另外,在安装网络之前,CoreDNS将不会启动。kubeadm仅支持基于容器网络接口(CNI)的网络(不支持kubenet)。

完成此操作后,CoreDNS Pod应该会正常运行。可以通过以下方式验证: kubectl -n kube-system -l=k8s-app=kube-dns get pods

然后,kubernetes-dashboard豆荚也应该健康。



1> 小智..:

看来您是在尝试利用Kubernetes进行部署,kubeadm但是已经跳过了安装Pod Network Add-on(CNI)的步骤。注意警告:

必须在任何应用程序之前部署网络。另外,在安装网络之前,CoreDNS将不会启动。kubeadm仅支持基于容器网络接口(CNI)的网络(不支持kubenet)。

完成此操作后,CoreDNS Pod应该会正常运行。可以通过以下方式验证: kubectl -n kube-system -l=k8s-app=kube-dns get pods

然后,kubernetes-dashboard豆荚也应该健康。

推荐阅读
手机用户2402852307
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有