Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

no endpoints available for service \"kubernetes-dashboard\"

Tags:

I'm trying to follow GitHub - kubernetes/dashboard: General-purpose web UI for Kubernetes clusters.

deploy/access:

# 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:

# 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
}# 

Please advise.

per @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:  <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.
$ 
like image 647
alexus Avatar asked Oct 19 '18 03:10

alexus


People also ask

How do I get Kubernetes dashboard tokens?

To access the dashboard endpoint, open the following link with a web browser: http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/#!/login . Choose Token, paste the authentication-token output from the previous command into the Token field, and choose SIGN IN.

What is image pull back off?

The ImagePullBackOff error occurs when the image path is incorrect, the network fails, or the kubelet does not succeed in authenticating with the container registry. Kubernetes initially throws the ErrImagePull error, and then after retrying a few times, “pulls back” and schedules another download attempt.


2 Answers

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:

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).

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

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

like image 194
user10520276 Avatar answered Sep 19 '22 15:09

user10520276


you could refer to https://github.com/kubernetes/dashboard#getting-started

Also, I see "https" in your link Please try this link instead http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/

like image 42
ayman.mostafa Avatar answered Sep 16 '22 15:09

ayman.mostafa