kubeadm: kubadm init v1.6.1 fails -> api-server uses wrong interface
Is this a request for help? No
What keywords did you search in Kubernetes issues before filing this one? kubeadm init, api-server crash, 6443
Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG
Kubernetes version (use kubectl version): v1.6.1 and v1.6.0
Environment:
- Cloud provider or hardware configuration: Local (native & virtualbox)
- OS (e.g. from /etc/os-release): Ubuntu 16.04.2 LTS
- Kernel (e.g.
uname -a): Linux ubuntu 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux - Others: NAT + host only adapter
- Install tools: kubeadm
What happened:
I am experimenting with the best way to install Kubernetes. After a few days of trying to get Kubeadm work, I still was getting stuck with the error:
[apiclient] Temporarily unable to list nodes (will retry)
After a bit of searching, I found the api-server going up and down with Docker ps -a. I went looking for the logs but I couldn’t find a solution on the internet.
UPDATE -> I found out that the apiserver uses the wrong interface
OUTPUT of the log of the api-server
root@ubuntu:~# tail -n 500 /var/log/containers/kube-
kube-apiserver-ubuntu_kube-system_kube-apiserver-31989c0a06decf19ef99557658d1a07df8c5be12786e7029f3f549715e5b2452.log
kube-controller-manager-ubuntu_kube-system_kube-controller-manager-1c6bd5ecb13318145b031bef792b157458917a13432ba62c67ab48269622bf09.log
root@ubuntu:~# tail -n 500 /var/log/containers/kube-apiserver-ubuntu_kube-system_kube-apiserver-31989c0a06decf19ef99557658d1a07df8c5be12786e7029f3f549715e5b2452.log
{"log":"[restful] 2017/04/04 12:18:59 log.go:30: [restful/swagger] listing is available at https://192.168.57.111:6443/swaggerapi/\n","stream":"stderr","time":"2017-04-04T12:18:59.712716159Z"}
{"log":"[restful] 2017/04/04 12:18:59 log.go:30: [restful/swagger] https://192.168.57.111:6443/swaggerui/ is mapped to folder /swagger-ui/\n","stream":"stderr","time":"2017-04-04T12:18:59.71274958Z"}
{"log":"I0404 12:18:59.791426 1 serve.go:79] Serving securely on 0.0.0.0:6443\n","stream":"stderr","time":"2017-04-04T12:18:59.79177779Z"}
{"log":"E0404 12:19:02.698462 1 storage_rbac.go:140] unable to initialize clusterroles: Get https://localhost:6443/apis/rbac.authorization.k8s.io/v1beta1/clusterroles: dial tcp 10.0.2.150:6443: getsockopt: no route to host\n","stream":"stderr","time":"2017-04-04T12:19:02.703156447Z"}
{"log":"F0404 12:19:02.698519 1 controller.go:128] Unable to perform initial IP allocation check: unable to refresh the service IP block: Get https://localhost:6443/api/v1/services: dial tcp 10.0.2.150:6443: getsockopt: no route to host\n","stream":"stderr","time":"2017-04-04T12:19:02.703181402Z"}
root@ubuntu:~# nable to initialize clusterroles: Get https://localhost:6443/apis/rbac.authorization.k8s.io/v1beta1/clusterroles: dial tcp 10.0.2.150:6443: getsockopt: no route to host\n","stream":"stderr","time":"2017-04-04T12:19:02.703156447Z"}
Docker ps -a OUTPUT

docker logs api-server
unable to initialize clusterroles: Get https://localhost:6443/apis/rbac.authorization.k8s.io/v1beta1/clusterroles: dial tcp 10.0.2.150:6443: getsockopt: no route to host
What you expected to happen: Kubernetes cluster to be up.
How to reproduce it (as minimally and precisely as possible): follewed this guide: https://kubernetes.io/docs/getting-started-guides/kubeadm/
Anything else we need to know:
I did a few tries with Kubadm reset, service kubelet start, kubeadm init
kube init command
kubeadm init --apiserver-advertise-address 192.168.57.111 --pod-network-cidr 10.244.0.0/16 --kubernetes-version="v1.6.1"
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 3
- Comments: 23 (2 by maintainers)
I had the same problem in my environment. The problem was, that “localhost” had not been resolved to the loopback address 127.0.0.1 by the nameserver, but to a different one. This was checked with “nslookup localhost”. In my case, the root cause was a wrong “search” entry in my /etc/resolv.conf file. This added the wrong domainname to my localhost name entry (eg. localhost.powersrv.de) which results in the wrong address.
Perhaps this will help some of you.
Bump, this seems like a bug to me… curl localhost -v shows it trying to connect to 127.0.0.1 but kubernetes fails to start because localhost.mylocaldomain.com is mapped to a machine on the network. Maybe in the way that kubernetes opens sockets that’s using DNS server directly, ignoring prority in /etc/nsswitch.conf