kubernetes failing to connect on fresh installation of CoreOS

9/9/2014

I'm running (from Windows 8.1) a Vagrant VM for CoreOS (yungsang/coreos).

I installed kubernetes according to the guide I found here and created the json for the pod using my images.

When I execute sudo ./kubecfg list /pods I get the following error:

F0909 06:03:04.626251 01933 kubecfg.go:182] Got request error: Get http://localhost:8080/api/v1beta1/pods?labels=: dial tcp 127.0.0.1:8080: connection refused

Same goes for sudo ./kubecfg -h http://127.0.0.1:8080 -c /vagrant/app.json create /pods

EDIT: Update

Instead of running the commands myself I integrated into the vagrant file (as such) .

This makes kubernetes work fine. HOWEVER after some time my vagrant ssh connection gets closed off. I reconnect and any kubernetes commands I specify result in the same error as above.

EDIT 2: Update

I managed to get it to run again, however I am unsure if it will run smoothly

I had to re-execute the following commands.

sudo systemctl start etcd
sudo systemctl start download-kubernetes
sudo systemctl start apiserver
sudo systemctl start controller-manager
sudo systemctl start kubelet
sudo systemctl start proxy

I believe it is in fact the apiserver that needs restarting

What is the source of this "timeout"? (Where are any logs I can find for this matter)

-- mangusbrother
coreos
docker
json
kubernetes
vagrant

3 Answers

4/9/2015

Based on errordevelopers advice, my recent installation ran against a similar problem.

Using systemctl status apiserver and sudo systemctl start apiserver I managed to get the environment up and running again.

-- PJong
Source: StackOverflow

11/1/2014

On CoreOS you should look at the logs using journalctl.

For example, if you wish to see etcd logs, which Kubernetes relies on for storing the state of it's minions, run journalctl _COMM=etcd, and similarly journalctl _COMM=apiserver will show you the logs from the apiserver, one of key components in Kubernetes.

You also get last few log entries if you run systemctl status apiserver.

-- errordeveloper
Source: StackOverflow

12/16/2014

Kubernetes development is moving insanely fast right now so this could be out of date by tomorrow. With that in mind, the kubernetes folks recommend following one of their official installation guides. The best advice would be to start over fresh with one of the new installation guides but there are a few tips that I have learned doing this myself.

The first thing to note is that Kubecfg is being deprecated in favor of kubectl. So for future reference if you want to get info about a pod you would run something like:

./kubectl get pods.

With kubectl you will also need to set an env variable so kubectl know how to talk to the apiserver:

KUBERNETES_MASTER=http://IPADDRESS:8080.

The easiest way to debug exactly what is going on if you are using CoreOS is to tail the logs for the service you are interested in. So if you have a kube-apiserver unit you can look at what's goin on by running:

journalctl -f -u kube-apiserver

from the node that is running the apiserver. If that service isn't running, which may be the case, you can start it with:

systemctl start kube-apiserver

-- jmreicha
Source: StackOverflow