问题
I am a Kubernetes newbie. I am trying to setup a Kubernetes cluster on AWS using kops. I was successfully able to setup the cluster. However, I am not able to access the Dashboard UI. (https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/#accessing-the-dashboard-ui)
When I access the master node, I see the following error:
{
"kind": "Status",
"apiVersion": "v1",
"metadata": {},
"status": "Failure",
"message": "no endpoints available for service \"kubernetes-dashboard\"",
"reason": "ServiceUnavailable",
"code": 503
}
I see the status of the dashboard as CrashLoopBackOff. (Please note: I have removed the names of the other pods in the following log)
~$ kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system kubernetes-dashboard-4167803980-vnx3k 0/1 CrashLoopBackOff 6 6m
$ kubectl logs kubernetes-dashboard-4167803980-vnx3k --namespace=kube-system
2017/09/25 17:50:37 Using in-cluster config to connect to apiserver
2017/09/25 17:50:37 Using service account token for csrf signing
2017/09/25 17:50:37 No request provided. Skipping authorization
2017/09/25 17:50:37 Starting overwatch
2017/09/25 17:50:37 Successful initial request to the apiserver, version: v1.7.2
2017/09/25 17:50:37 New synchronizer has been registered: kubernetes-dashboard-key-holder-kube-system. Starting
2017/09/25 17:50:37 Starting secret synchronizer for kubernetes-dashboard-key-holder in namespace kube-system
2017/09/25 17:50:37 Initializing secret synchronizer synchronously using secret kubernetes-dashboard-key-holder from namespace kube-system
2017/09/25 17:50:37 Initializing JWE encryption key from synchronized object
2017/09/25 17:50:37 Creating in-cluster Heapster client
2017/09/25 17:50:37 Serving securely on HTTPS port: 8443
2017/09/25 17:50:37 open /certs/dashboard.crt: no such file or directory
I would sincerely appreciate any help/suggestions to get the dashboard running. Thanks in advance!
回答1:
Your using latest dashboard, looks like it required SSL certificate. try with 1.6.3 it will work with-out SSL cert.
I am running this version in my cluster.
kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/v1.6.3/src/deploy/kubernetes-dashboard.yaml
Helm command to install dashboard
kubectl create clusterrolebinding add-on-cluster-admin --clusterrole=cluster-admin --serviceaccount=kube-system:default
helm install stable/kubernetes-dashboard --name kubernetes-dashboard --namespace kube-system --debug
helm install stable/heapster --namespace kube-system
来源:https://stackoverflow.com/questions/46411598/kubernetes-dashboard-serviceunavailable-503-error