MLOPS/kubernetes

Weave net CNI error

개발허재 2023. 11. 27. 10:35
root@BD1-L-KUBESPAWNER-MASTER-001:/home# k logs -n kube-system weave-net-rxfmb weave -f
DEBU: 2023/11/23 16:08:09.204629 [kube-peers] Checking peer "82:91:72:42:5a:a7" against list &{[{fe:e0:e6:ce:b5:32 bd1-l-kubespawner-master-001} {8a:bf:f3:33:54:40 c1-l-kubespawner-worker-020} {ea:fc:bf:75:e6:79 c1-l-kubespawner-worker-003} {32:a2:6b:a7:95:18 c1-l-kubespawner-worker-006} {ce:6c:75:6b:77:67 c1-l-kubespawner-worker-007} {86:fa:ed:3b:d0:d0 c1-l-kubespawner-worker-002} {a6:01:1f:66:f5:96 c1-l-kubespawner-worker-001} {42:8e:99:13:0e:fb c1-l-kubespawner-worker-019} {da:24:90:26:8e:f6 ds-dev-001} {26:f6:f1:fb:a7:71 ds-dev-002} {c6:63:66:d8:5d:1e ds-dev-003} {aa:d9:eb:e4:f8:65 c1-l-apollo-gpu-001} {da:b3:22:2f:e8:db op-l-apollo-gpu-006}]}
Peer not in list; removing persisted data
INFO: 2023/11/23 16:08:09.290001 Command line options: map[conn-limit:200 datapath:datapath db-prefix:/weavedb/weave-net docker-api: expect-npc:true http-addr:127.0.0.1:6784 ipalloc-init:consensus=13 ipalloc-range:10.32.0.0/12 metrics-addr:0.0.0.0:6782 name:82:91:72:42:5a:a7 nickname:op-l-apollo-gpu-007 no-dns:true no-masq-local:true port:6783]
INFO: 2023/11/23 16:08:09.290034 weave  2.8.1
FATA: 2023/11/23 16:08:09.511379 Inconsistent bridge state detected. Please do 'weave reset' and try again

특정 워커노드에 띄워진 에러 상태인 위브넷의 weave 컨테이너 로그입니다.

마지막 보면 weave reset 하고 재시도하라고 하는 것이 보입니다.

 

root@OP-L-APOLLO-GPU-007:/home# ifconfig -l
…
weave: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1376
        inet 10.xx.xx.0  netmask 255.240.0.0  broadcast 10.47.255.255
        inet6 xxxx::xxxx:xxxx:xxxx:xxxx  prefixlen 64  scopeid 0x20<link>
        ether xx:xx:xx:xx:xx:xx  txqueuelen 1000  (Ethernet)
        RX packets 9299  bytes 471252 (471.2 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 7246  bytes 310575 (310.5 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
…

먼저, 해당 워커노드에서 ifconfig 네트워크 인터페이스를 살펴봤습니다. 하지만 다른 노드들에 생성된 weave 네트워크 인터페이스가 생성되지 않은 것을 확인할 있었습니다.

 

root@OP-L-APOLLO-GPU-007:/home/jeawoo0594# ip route
…
10.32.0.0/12 dev weave proto kernel scope link src 10.46.192.0
…

ip route ip 라우팅테이블도 조회해봤습니다. 마찬가지로, 다른 노드들에 생성된 weave 네트워크 인터페이스의 라우팅 규칙이 적용되지 않은 것을 확인하였습니다.

 

Chain WEAVE (1 references)
target     prot opt source               destination
RETURN     all  --  anywhere             anywhere             match-set weaver-no-masq-local dst /* Prevent SNAT to locally running containers */
RETURN     all  --  10.32.0.0/12         base-address.mcast.net/4
MASQUERADE  all  -- !10.32.0.0/12         10.32.0.0/12
MASQUERADE  all  --  10.32.0.0/12        !10.32.0.0/12

iptables -t nat -L NAT 테이블 정보도 확인하였습니다. 다른 노드들에 생성된 Weave Net 관리하는 네트워크 트래픽에 대한 규칙인 WEAVE chain 역시 생성되지 않은 것을 확인할 있었습니다.

 

 

해결

그렇다면, 위브넷 pod의 weave 컨테이너 로그로 다시 가보겠습니다. 

weave reset 시도하라고 하는데, 기본적으로 노드에는 weave 설치되어 있지 않았습니다. 따라서, 해당 노드에 weave install 해줍니다. (weave install https://www.weave.works/docs/net/latest/install/installing-weave/)

 

$ sudo curl -L git.io/weave -o /usr/local/bin/weave
$ sudo chmod a+x /usr/local/bin/weave

 

이제 weave가 설치되었고, weave reset 명령어를 날려줍니다.

그다음 kubelet restart 해주고, 해당 워커노드 weave net pod delete 다시 생성하게 해주면 정상적으로 running 되는 것을 확인할 있습니다.