Flannel failed to start when installing kubernetes

1/26/2018

I'm installing kubernetes, but docker and kube-apiserver both failed to start. Through journal, finding that the reason is flannel. So I try to start flannel but it failed. Here is the output info:

Job for flanneld.service failed because a timeout was exceeded. See "systemctl status flanneld.service" and "journalctl -xe" for details.

Then I typed systemctl status flanneld.service, and here is the result:

flanneld.service - Flanneld overlay address etcd agent

Loaded: loaded (/usr/lib/systemd/system/flanneld.service; enabled; vendor preset: disabled)
Active: activating (start) since Fri 2018-01-26 03:28:08 EST; 51s ago
Main PID: 5870 (flanneld)
Memory: 6.5M

CGroup: /system.slice/flanneld.service

           └─5870 /usr/bin/flanneld -etcd-endpoints=http://127.0.0.1:2379 -etcd-prefix=/atomic.io/network


Jan 26 03:28:50 node-1 flanneld-start[5870]: E0126 03:28:50.755931    5870 network.go:102] failed to retrieve network config: 100: Key not found (/atomic.io) [23858]

Is there anyone can help me on this?

-- Guldo
docker
kubernetes

1 Answer

6/20/2018

Curl the endpoint you have defined. You may need to point flannel to your master node.

/etc/sysconfig/flanneld
FLANNEL_ETCD_ENDPOINTS="http://<master ip>:2379"
FLANNEL_ETCD_PREFIX="/kube-centos/network"

Try that and then restart flanneld.

-- ddtraveller
Source: StackOverflow