没有可用于服务的终结点 [英] no endpoints available for service \"kubernetes-dashboard\"

查看:64
本文介绍了没有可用于服务的终结点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试遵循 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
$ 

日志:

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

描述:

$ kubectl describe pod kubernetes-dashboard-77fd78f978-g2hts -n kube-system
Name:               kubernetes-dashboard-77fd78f978-g2hts
Namespace:          kube-system
Priority:           0
PriorityClassName:  <none>
Node:               <none>
Labels:             k8s-app=kubernetes-dashboard
                    pod-template-hash=77fd78f978
Annotations:        <none>
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:  <none>
    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:  <none>
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.
$ 

推荐答案

您似乎正在尝试利用 kubeadm 部署Kubernetes,但跳过了

It would appear that you are attempting to deploy Kubernetes leveraging kubeadm but have skipped the step of Installing a pod network add-on (CNI). Notice the warning:

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

The network must be deployed before any applications. Also, CoreDNS will not start up before a network is installed. kubeadm only supports Container Network Interface (CNI) based networks (and does not support kubenet).

执行此操作后,CoreDNS吊舱将正常运行.可以通过以下方式验证: kubectl -n kube-system -l = k8s-app = kube-dns获取Pod

Once you do this, the CoreDNS pods should come up healthy. This can be verified with: kubectl -n kube-system -l=k8s-app=kube-dns get pods

然后, kubernetes-dashboard 窗格也应该正常运行.

Then the kubernetes-dashboard pod should come up healthy as well.

这篇关于没有可用于服务的终结点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆