Failed to create SubnetManager error (flanneld) (kubernetes)

4/10/2018

I have installed etcd by executing below commands

systemctl start flanneld
etcdctl mkdir /kube-centos/network/
etcdctl mk /kube-centos/network/config "{ \"Network\": \"172.30.0.0/16\", \"SubnetLen\":24, \"Backend\": { \"Type\": \"vxlan\" } }"

Below is the conf file for flannel

 vim /etc/sysconfig/flanneld
  FLANNEL_ETCD="http://hostname:2379"
  FLANNEL_ETCD_PREFIX="/kube-centos/network"
  FLANNEL_OPTIONS="--iface=eth0"

while i executing the below command , i am getting error

systemctl start flanneld

The error is...

flanneld.service - Flanneld overlay address etcd agent
          Loaded: loaded (/usr/lib/systemd/system/flanneld.service; enabled; vendor preset: disabled)
          Active: failed (Result: exit-code) since Tue 2018-04-10 06:45:01 GMT; 73ms ago
          Main PID: 46327 (code=exited, status=2)

          Apr 10 06:44:56 LX01510L flanneld[46327]: E0410 06:44:56.407216   46327 main.go:151] Failed to create SubnetManager: 100: Key not found (/config) [143]
          Apr 10 06:44:57 LX01510L flanneld[46327]: E0410 06:44:57.407946   46327 main.go:151] Failed to create SubnetManager: 100: Key not found (/config) [143]
          Apr 10 06:44:58 LX01510L flanneld[46327]: E0410 06:44:58.408644   46327 main.go:151] Failed to create SubnetManager: 100: Key not found (/config) [143]
          Apr 10 06:44:59 LX01510L flanneld[46327]: E0410 06:44:59.409405   46327 main.go:151] Failed to create SubnetManager: 100: Key not found (/config) [143]
          Apr 10 06:45:00 LX01510L flanneld[46327]: E0410 06:45:00.410254   46327 main.go:151] Failed to create SubnetManager: 100: Key not found (/config) [143]
          Apr 10 06:45:01 LX01510L systemd[1]: flanneld.service start operation timed out. Terminating.
          Apr 10 06:45:01 LX01510L systemd[1]: flanneld.service: main process exited, code=exited, status=2/INVALIDARGUMENT
          Apr 10 06:45:01 LX01510L systemd[1]: Failed to start Flanneld overlay address etcd agent.
          Apr 10 06:45:01 LX01510L systemd[1]: Unit flanneld.service entered failed state.
          Apr 10 06:45:01 LX01510L systemd[1]: flanneld.service failed.
-- mahendra
etcd
flannel
kubernetes

1 Answer

4/10/2018

Just try to store your json in the file:

$ cat config_file.json
{
    "Network": "172.30.0.0/16",
    "SubnetLen": 24,
    "Backend": {
        "Type": "vxlan",
        "VNI": 1
    }
}

and then import it as the command:

etcdctl set /kube-centos/network/config <config_file.json 

probably you missed the key "VNI": 1

I used this docs as a howto for flannel overlay network

-- Nick Rak
Source: StackOverflow