kubernetes: Problems accessing the API server
Kubernetes version (use kubectl version
):
kubectl version
Client Version: version.Info{Major:"1", Minor:"3", GitVersion:"v1.3.6", GitCommit:"ae4550cc9c89a593bcda6678df201db1b208133b", GitTreeState:"clean", BuildDate:"2016-08-26T18:13:23Z", GoVersion:"go1.6.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"3", GitVersion:"v1.3.6", GitCommit:"ae4550cc9c89a593bcda6678df201db1b208133b", GitTreeState:"clean", BuildDate:"2016-08-26T18:06:06Z", GoVersion:"go1.6.2", Compiler:"gc", Platform:"linux/amd64"}
Environment:
- Cloud provider or hardware configuration: aws, custom provisioned, no cloud provider selected
- OS (e.g. from /etc/os-release):
cat /etc/os-release
NAME="Ubuntu"
VERSION="14.04.3 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.3 LTS"
VERSION_ID="14.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
- Kernel (e.g.
uname -a
):
Linux ip-172-32-194-167 3.13.0-74-generic #118-Ubuntu SMP Thu Dec 17 22:52:10 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
- Install tools: not sure
- Others: not sure
What happened:
kubectl --namespace="kube-system" logs kubernetes-dashboard-997876578-xq58k
Starting HTTP server on port 9090
Creating API server client for http://localhost:8080
Error while initializing connection to Kubernetes apiserver. This most likely means that the cluster is misconfigured (e.g., it has invalid apiserver certificates or service accounts configuration) or the --apiserver-host param points to a server that does not exist. Reason: Get http://localhost:8080/version: dial tcp [::1]:8080: getsockopt: connection refused
What you expected to happen: get the logs of the pod
How to reproduce it (as minimally and precisely as possible): the api server runs with:
kube-apiserver --service-cluster-ip-range="10.2.0.0/16" \
--etcd-servers="http://localhost:2379" \
--cloud-provider=""
# on master
kubectl create -f https://rawgit.com/kubernetes/dashboard/master/src/deploy/kubernetes-dashboard.yaml
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 17 (1 by maintainers)
If anyone comes across this issue, as I did, I was able to fix it by setting nodeSelector on kubernetes-dashboard.yaml file to look up the master’s label. Only by running dashboard on my master node was I able to get it working:
There is a fix that’s been put in kubernetes-dashboard.yaml but it only sets the toleration, which as I discovered doesn’t require that the pod runs on master, simply allows it.
Hopefully that’s helpful! Sorry for posting on a closed issue, but this is the #1 result in Google for that error message.