老师,我根据教程下载weave.yaml后修改,添加了环境变量 IPALLOC_RANGE(第175行左右)
...
spec:
minReadySeconds: 5
template:
metadata:
labels:
name: weave-net
spec:
containers:
- name: weave
command:
- /home/weave/launch.sh
env:
- name: HOSTNAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
- name: IPALLOC_RANGE
value: 192.168.16.0/20
安装插件
kubectl apply -f weave.yaml
查看运行状态时发现是CrashLoopBackOff
[root@node1 ~]# kubectl get pods -n kube-system -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE
coredns-576cbf47c7-5dgxp 0/1 Pending 0 7m37s <none> <none> <none>
coredns-576cbf47c7-lgw98 0/1 Pending 0 7m37s <none> <none> <none>
etcd-node1 1/1 Running 0 6m54s 10.0.2.92 node1 <none>
kube-apiserver-node1 1/1 Running 0 6m51s 10.0.2.92 node1 <none>
kube-controller-manager-node1 1/1 Running 0 6m46s 10.0.2.92 node1 <none>
kube-proxy-5lrxh 1/1 Running 0 7m37s 10.0.2.92 node1 <none>
kube-scheduler-node1 1/1 Running 0 6m55s 10.0.2.92 node1 <none>
weave-net-fgwgp 1/2 CrashLoopBackOff 1 4s 10.0.2.92 node1 <none>
[root@node1 ~]# kubectl describe pods weave-net-fgwgp -n kube-system
...
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 2m29s default-scheduler Successfully assigned kube-system/weave-net-fgwgp to node1
Normal Pulled 2m28s kubelet, node1 Container image "docker.io/weaveworks/weave-npc:2.4.1" already present on machine
Normal Created 2m28s kubelet, node1 Created container
Normal Started 2m28s kubelet, node1 Started container
Normal Pulled 97s (x4 over 2m28s) kubelet, node1 Container image "docker.io/weaveworks/weave-kube:2.4.1" already present on machine
Normal Created 97s (x4 over 2m28s) kubelet, node1 Created container
Normal Started 97s (x4 over 2m28s) kubelet, node1 Started container
Warning BackOff 70s (x10 over 2m27s) kubelet, node1 Back-off restarting failed container
日志信息为
[root@node1 ~]# kubectl logs weave-net-fgwgp -c weave --namespace=kube-system
Network 192.168.16.0/20 overlaps with existing route 128.0.0.0/1 on host
请问这个要怎么解决呢?谢谢。