kubeovn / kube-ovn

A Bridge between SDN and Cloud Native (Project under CNCF)
https://kubeovn.github.io/docs/stable/en/
Apache License 2.0
1.93k stars 438 forks source link

[BUG] klog.go:10 "failed to initialize node gateway" #4009

Closed T0MASD closed 2 months ago

T0MASD commented 4 months ago

Kube-OVN Version

v1.13.0

Kubernetes Version

Client Version: v1.29.4 Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3 Server Version: v1.29.4

Operation-system/Kernel Version

$ uname -a
Linux study-pc-kube 6.8.7-300.fc40.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Apr 17 19:21:08 UTC 2024 x86_64 GNU/Linux

Description

kube-ovn-cni fails to start

$ kubectl get pod -n kube-system | grep ovn
kube-ovn-cni-7hk9p                      0/1     CrashLoopBackOff   6 (4m30s ago)   10m
kube-ovn-controller-58ffddf5f-j25wr     1/1     Running            0               46m
kube-ovn-monitor-fb759859f-nqtw9        1/1     Running            0               46m
kube-ovn-pinger-bs85b                   1/1     Running            0               46m
ovn-central-66f8b98fdf-lbtbq            1/1     Running            0               46m
ovs-ovn-bzqw8                           1/1     Running            0               46m

kube-system/kube-ovn-cni-7hk9p log:

ovsdb-server is running with pid 281403                                                                                                                                                        
ovs-vswitchd is running with pid 281465                                                                                                                                                        
iptables v1.8.7 (nf_tables)                                                                                                                                                                    
I0511 20:33:56.301448  387397 cniserver.go:35]                                                                                                                                                 
-------------------------------------------------------------------------------                                                                                                                
Kube-OVN:                                                                                                                                                                                      
  Version:       v1.13.0                                                                                                                                                                       
  Build:         2024-05-11_09:21:49                                                                                                                                                           
  Commit:        git-aaf5736                                                                                                                                                                   
  Go Version:    go1.22.3                                                                                                                                                                      
  Arch:          amd64                                                                                                                                                                         
-------------------------------------------------------------------------------                                                                                                                
I0511 20:33:56.307715  387397 config.go:170] node name not specified in command line parameters, fall back to the environment variable                                                         
I0511 20:33:56.307808  387397 config.go:350] no --kubeconfig, use in-cluster kubernetes config                                                                                                 
I0511 20:33:56.308574  387397 k8s.go:27] succeeded to dial apiserver "172.30.0.1:443"                                                                                                          
I0511 20:33:56.318451  387397 config.go:264] use 192.168.122.46 on enp1s0 as tunnel address                                                                                                    
I0511 20:33:56.324520  387397 config.go:190] daemon config: &{enp1s0 enp1s0 br-phy 1400 1360 false mirror0 /run/openvswitch/kube-ovn-daemon.sock /run/openvswitch/db.sock  0xc0002e1180 0xc0002
e4b60 study-pc-kube 172.30.0.0/16 ovn-cluster join true false false 10665 geneve /etc/cni/net.d /kube-ovn/01-kube-ovn.conflist 01-kube-ovn.conflist provider  kube-system external true true /v
ar/lib/kubelet false 8100 8101 false 100}                                                                                                                                                      
I0511 20:33:56.328037  387397 ovs.go:111] nic mirror0 exist, configure it                                                                                                                      
I0511 20:33:56.351266  387397 cniserver.go:56] init node gw                                                                                                                                    
E0511 20:33:56.355141  387397 klog.go:10] "failed to initialize node gateway" err="failed to parse mac  invalid MAC address"                                                                   
Stream closed EOF for kube-system/kube-ovn-cni-7hk9p (cni-server)  

ip

$ ip -br a
lo               UNKNOWN        127.0.0.1/8 ::1/128 
enp1s0           UP             192.168.122.46/24 fe80::5054:ff:fefc:e780/64 
cni0             UP             172.20.0.1/16 1100:200::1/24 fe80::4822:18ff:fe41:d39f/64 
veth19d2cdf1@if2 UP             fe80::a897:50ff:fe52:f425/64 
veth8238aa6c@if2 UP             fe80::f475:f7ff:febb:85f1/64 
veth0ec0641b@if2 UP             fe80::445a:82ff:feec:510a/64 
vethe2666e05@if2 UP             fe80::90c6:f7ff:feed:da9e/64 
veth61504723@if2 UP             fe80::607c:b7ff:fe2f:1936/64 
veth4bc2d763@if2 UP             fe80::7c94:3bff:fe77:63ef/64 
veth98e76d2a@if2 UP             fe80::6837:98ff:fece:86f/64 
veth35749414@if2 UP             fe80::6c32:4fff:fe23:598f/64 
veth0dc42ac0@if2 UP             fe80::a89e:e0ff:fe82:56f9/64 
veth3aa7877d@if2 UP             fe80::9020:86ff:fe08:2dde/64 
veth9b9ec7cd@if2 UP             fe80::8069:55ff:fe47:42c1/64 
vethc09393f6@if2 UP             fe80::c0:4eff:fe88:9653/64 
veth3fc1c958@if2 UP             fe80::a0f5:dfff:fe49:e784/64 
vethbd57f5f6@if2 UP             fe80::fc22:d7ff:fe84:bac9/64 
veth892f3364@if2 UP             fe80::b054:b4ff:fe4a:eac4/64 
veth9dd40458@if2 UP             fe80::78cc:38ff:fe7e:86af/64 
ovs-system       DOWN           
br-int           DOWN           
mirror0          UNKNOWN        fe80::d499:12ff:fe37:c677/64 

macs

$ arp -a
? (172.20.0.4) at 7a:72:98:6c:1c:34 [ether] on cni0
? (172.20.0.23) at ae:ba:3c:66:82:c1 [ether] on cni0
? (172.20.0.9) at 62:77:e0:fc:20:5a [ether] on cni0
? (172.20.0.24) at 1e:dd:88:86:31:59 [ether] on cni0
? (172.20.0.43) at 9a:57:dd:69:09:d9 [ether] on cni0
? (172.20.0.3) at 2a:7a:12:7f:b6:c5 [ether] on cni0
? (172.20.0.5) at 8a:44:dd:16:d3:6a [ether] on cni0
? (172.20.0.20) at 26:02:ca:6d:4d:ba [ether] on cni0
? (172.20.0.14) at 3e:65:49:40:cd:9a [ether] on cni0
? (172.20.0.25) at 02:0f:d8:1d:58:9e [ether] on cni0
? (172.20.0.21) at <incomplete> on cni0
? (172.20.0.36) at <incomplete> on cni0
? (172.20.0.15) at <incomplete> on cni0
? (172.20.0.30) at <incomplete> on cni0
? (172.20.0.16) at 0e:fd:e0:08:1b:41 [ether] on cni0
? (172.20.0.10) at 1e:41:ca:8a:a0:c8 [ether] on cni0
? (172.20.0.37) at c6:93:29:e3:79:6d [ether] on cni0
? (172.20.0.31) at e6:b5:cd:88:1f:8b [ether] on cni0
? (172.20.0.6) at 46:67:98:2a:67:44 [ether] on cni0
? (172.20.0.11) at f6:78:45:30:0e:ac [ether] on cni0
? (172.20.0.13) at <incomplete> on cni0
? (172.20.0.7) at ce:89:45:d2:36:77 [ether] on cni0
? (172.20.0.22) at d6:52:70:d8:2f:d5 [ether] on cni0
study-pc (192.168.122.1) at 52:54:00:60:c1:65 [ether] on enp1s0
? (172.20.0.8) at b2:b3:20:bf:e3:d2 [ether] on cni0
? (172.20.0.42) at 7a:b4:69:00:49:b1 [ether] on cni0
? (172.20.0.2) at fa:74:45:fb:e5:2a [ether] on cni0
? (172.20.0.44) at 3e:99:3e:01:fc:4a [ether] on cni0

/etc/cni/net.d/100-crio-bridge.conflist :

{
  "cniVersion": "1.0.0",
  "name": "crio",
  "plugins": [
    {
      "type": "bridge",
      "bridge": "cni0",
      "isGateway": true,
      "ipMasq": true,
      "hairpinMode": true,
      "ipam": {
        "type": "host-local",
        "routes": [
            { "dst": "0.0.0.0/0" },
            { "dst": "::/0" }
        ],
        "ranges": [
            [{ "subnet": "172.20.0.0/16" }],
            [{ "subnet": "1100:200::/24" }]
        ]
      }
    }
  ]
}

Steps To Reproduce

  1. Clone repo

  2. create values.yml

networking:
  IFACE: "enp1s0"

ipv4:
  POD_CIDR: "172.20.0.0/16"
  POD_GATEWAY: "172.20.0.1"
  SVC_CIDR: "172.30.0.0/16"
  JOIN_CIDR: "192.168.122.0/24"
  PINGER_EXTERNAL_ADDRESS: "192.168.122.1"
  PINGER_EXTERNAL_DOMAIN: "alauda.cn."

func:
  ENABLE_LB: true
  ENABLE_NP: true
  ENABLE_EIP_SNAT: true
  ENABLE_EXTERNAL_VPC: false
  HW_OFFLOAD: true
  ENABLE_LB_SVC: false
  ENABLE_KEEP_VM_IP: true
  LS_DNAT_MOD_DL_DST: true
  CHECK_GATEWAY: true
  LOGICAL_GATEWAY: false
  ENABLE_BIND_LOCAL_IP: true
  U2O_INTERCONNECTION: false
  ENABLE_TPROXY: false

install ovn

    kubectl label no -lbeta.kubernetes.io/os=linux kubernetes.io/os=linux --overwrite
    kubectl label no -lnode-role.kubernetes.io/control-plane  kube-ovn/role=master --overwrite
    kubectl label no -lovn.kubernetes.io/ovs_dp_type!=userspace ovn.kubernetes.io/ovs_dp_type=kernel  --overwrite
    kubectl annotate node study-pc-kube ovn.kubernetes.io/ip_address='192.168.122.46'

    helm install kubeovn ./charts/kube-ovn  -f /tmp/ovn/values.yml --set MASTER_NODES=192.168.122.46,

Current Behavior

ovn fails to initialize

Expected Behavior

ovn initializes

zhangzujian commented 4 months ago

Why did you execute the following command?

kubectl annotate node study-pc-kube ovn.kubernetes.io/ip_address='192.168.122.46'

Please remove the annotation and try again.

github-actions[bot] commented 2 months ago

Issues go stale after 60d of inactivity. Please comment or re-open the issue if you are still interested in getting this issue fixed.