plugins.go:71] No cloud provider specified.
controllermanager.go:
290] Failed to start service controller: ServiceController should not be run without a cloudprovider.
--proxy-mode="": Which proxy mode to use: 'userspace' (older, stable) or 'iptables' (experimental). If blank, look at the Node object on the Kubernetes API and respect the 'net.experimental.kubernetes.io/proxy-mode' annotation if provided. Otherwise use the best-available proxy (currently userspace, but may change in future versions). If the iptables proxy is selected, regardless of how, but the system's kernel or iptables versions are insufficient, this always falls back to the userspace proxy.
如果不支持 --proxy-mode=iptables 则会报类似如下错误:
W1119 21:00:12.187930 5595 server.go:200] Failed to start in resource-only container "/kube-proxy": write /sys/fs/cgroup/memory/kube-proxy/memory.swappiness: invalid argument
E1119
21:00:12.198572 5595 proxier.go:197] Error removing userspace rule: error checking rule: exit status 2: iptables v1.4.21: Couldn't load target `KUBE-PORTALS-HOST':No such file or directory
Try `iptables
-h' or 'iptables --help' for more information.
E1119 21:00:12.200286 5595 proxier.go:201] Error removing userspace rule: error checking rule: exit status 2: iptables v1.4.21: Couldn't load target `KUBE-PORTALS-CONTAINER':No such file or directory
Try `iptables -h' or 'iptables --help' for more information.
E1119 21:00:12.202162 5595 proxier.go:207] Error removing userspace rule: error checking rule: exit status 2: iptables v1.4.21: Couldn't load target `KUBE-NODEPORT-HOST':No such file or directory
Try `iptables -h' or 'iptables --help' for more information.
E1119 21:00:12.204058 5595 proxier.go:211] Error removing userspace rule: error checking rule: exit status 2: iptables v1.4.21: Couldn't load target `KUBE-NODEPORT-CONTAINER':No such file or directory
Try `iptables -h' or 'iptables --help' for more information.
E1119 21:00:12.205848 5595 proxier.go:220] Error flushing userspace chain: error flushing chain "KUBE-PORTALS-CONTAINER": exit status 1: iptables: No chain/target/match by that name.
E1119 21:00:12.207467 5595 proxier.go:220] Error flushing userspace chain: error flushing chain "KUBE-PORTALS-HOST": exit status 1: iptables: No chain/target/match by that name.
E1119 21:00:12.209000 5595 proxier.go:220] Error flushing userspace chain: error flushing chain "KUBE-NODEPORT-HOST": exit status 1: iptables: No chain/target/match by that name.
E1119 21:00:12.210580 5595 proxier.go:220] Error flushing userspace chain: error flushing chain "KUBE-NODEPORT-CONTAINER": exit status 1: iptables: No chain/target/match by that name.
View Code 六、测试
以上部署完成之后,在任意主机上执行以下命令查看结点状态:
./kubectl -s 10.16.42.200:8080 get nodes
如果返回类似如下内容则说明apiserver是正常服务的:
NAME LABELS STATUS AGE
bx
-42-198 kubernetes.io/hostname=bx-42-198 Ready 1d
bx
-42-199 kubernetes.io/hostname=bx-42-199 Ready 1d
NAME READY STATUS RESTARTS AGE
test
-1-a9dn3 1/1 Running 0 1d
test
-2-64urt 1/1 Running 0 1d
test
-3-edt2l 1/1 Running 0 1d
test
-4-l6egg 1/1 Running 0 1d
在198上通过 docker exec 进入test-2对应的容器,通过 ip addr show 查看IP;同样在199上进入test-4对应的容器查看IP。然后在 test-2和 test-4 容器中互相ping 对方的IP,如果ping通了,说明flannel也正常工作了。