Flannel and docker don't start
Today's christmas but I spent the whole day trying to get this to work :) This is what I did:
#1 FLANNEL
As mentioned I'd set the flannel etcd key on the master with:
etcdctl mk /coreos.com/network/config '{"Network":"172.17.0.0/16"}'
but I got this error when trying to start flannel on the minion:
Failed to retrieve network config: 100: Key not found (/atomic.io)
So I edited the /etc/sysconfig/flanneld
file on the minion from:
# Flanneld configuration options # etcd url location. Point this to the server where etcd runsFLANNEL_ETCD="http://master:2379"# etcd config key. This is the configuration key that flannel queries# For address range assignmentFLANNEL_ETCD_KEY="/coreos.com/network"# Any additional options that you want to pass#FLANNEL_OPTIONS=""to:# Flanneld configuration options # etcd url location. Point this to the server where etcd runsFLANNEL_ETCD="http://master:2379"# etcd config key. This is the configuration key that flannel queries# For address range assignmentFLANNEL_ETCD_KEY="/atomic.io/network"# Any additional options that you want to pass#FLANNEL_OPTIONS=""
i.e. changed the FLANNEL_ETCD key.
After this systemctl start flanneld
worked.
#2 DOCKER
I didn't find a way to make the version installed as a dependency by kubernetes work so I uninstalled it and following the docker docs for Centos installed docker-engine and manually created a docker.service file for systemctl.
cd /usr/lib/systemd/system
and the contents of the docker.service:
[Unit]Description=Docker Application Container EngineDocumentation=https://docs.docker.comAfter=network.target docker.socketRequires=docker.socketRequires=flanneld.serviceAfter=flanneld.service[Service]EnvironmentFile=/etc/sysconfig/flanneldExecStart=/usr/bin/docker daemon -H fd:// --bip=${FLANNEL_SUBNET}Restart=on-failureRestartSec=5[Install]WantedBy=multi-user.target
then start and enable the daemon with systemctl as well as query the status.
systemctl restart dockersystemctl enable dockersystemctl status docker