Unable to bring up kubernetes API server

4/8/2019

Actual Issue:

Unable to start kubernetes API, due to which, unable to intite kube services like: kubectl version kubect get nodes

/home/ubuntu# kubectl version
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.0", GitCommit:"641856db18352033a0d96dbc99153fa3b27298e5", GitTreeState:"clean", BuildDate:"2019-03-25T15:53:57Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"}



   The connection to the server localhost:8080 was refused - did you specify the right host or port  ?

Background of the issue:

Docker is installed. Using below, kube components are installed:

apt-get update && apt-get install -y kubeadm kubelet kubectl

But, when executing kubeadm init --apiserver-advertise-address=$myip --ignore-preflight-errors=all:

I0408 09:09:07.316109       1 client.go:352] scheme "" not registered, fallback to default scheme
I0408 09:09:07.319904       1 asm_amd64.s:1337] ccResolverWrapper: sending new addresses to cc: [{127.0.0.1:2379 0  <nil>}]
I0408 09:09:07.323010       1 asm_amd64.s:1337] balancerWrapper: got update addr from Notify: [{127.0.0.1:2379 <nil>}]
W0408 09:09:07.332669       1 clientconn.go:1251] grpc: addrConn.createTransport failed to connect to {127.0.0.1:2379 0  <nil>}. Err :connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:2379: connect: connection refused". Reconnecting...
I0408 09:09:08.325625       1 client.go:352] parsed scheme: ""
I0408 09:09:08.325650       1 client.go:352] scheme "" not registered, fallback to default scheme
I0408 09:09:08.325707       1 asm_amd64.s:1337] ccResolverWrapper: sending new addresses to cc: [{127.0.0.1:2379 0  <nil>}]
I0408 09:09:08.325768       1 asm_amd64.s:1337] balancerWrapper: got update addr from Notify: [{127.0.0.1:2379 <nil>}]
W0408 09:09:08.326158       1 clientconn.go:1251] grpc: addrConn.createTransport failed to connect to {127.0.0.1:2379 0  <nil>}. Err :connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:2379: connect: connection refused". Reconnecting...

Getting the above in the kube api container logs. This is a fresh install .Also tried

sudo cp /etc/kubernetes/admin.conf $HOME/
sudo chown $(id -u):$(id -g) $HOME/admin.conf
export KUBECONFIG=$HOME/admin.conf

Expected Results:

kubectl version: should give only the version details without any connection issue message Kubectl get nodes: should give the details of Master node and status

-- Siva Malla
kubeadm
kubectl
kubernetes

1 Answer

4/10/2019

The below has actually fixed my issue, not sure if this is the actual found. I was installing docker.ce earlier as part of the kubernetes installation. Now I tried with docker.io which went good and no issues further. Its working as expected now

-- Siva Malla
Source: StackOverflow