我已经通过执行以下命令
安装了etcdsystemctl start flanneld
etcdctl mkdir /kube-centos/network/
etcdctl mk /kube-centos/network/config "{ \"Network\": \"172.30.0.0/16\", \"SubnetLen\":24, \"Backend\": { \"Type\": \"vxlan\" } }"
下面是法兰绒的conf文件
vim /etc/sysconfig/flanneld
FLANNEL_ETCD="http://hostname:2379"
FLANNEL_ETCD_PREFIX="/kube-centos/network"
FLANNEL_OPTIONS="--iface=eth0"
当我执行以下命令时,我收到错误
systemctl start flanneld
错误是......
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.
答案 0 :(得分:0)
尝试将json存储在文件中:
$ cat config_file.json
{
"Network": "172.30.0.0/16",
"SubnetLen": 24,
"Backend": {
"Type": "vxlan",
"VNI": 1
}
}
然后将其导入为命令:
etcdctl set /kube-centos/network/config <config_file.json
可能你错过了关键&#34; VNI&#34;:1
我将此docs as a howto用于法兰绒覆盖网络