Coder Social home page Coder Social logo

Comments (11)

oilbeater avatar oilbeater commented on July 18, 2024 2

应该是个 bug,需要再加一个 default-gw 的参数,可以先修改一下 kube-ovn namespace 里面 ovn.kubernetes.io/gateway 对应的值,改成你想要的cidr内的地址,等下一次事件处理的时候应该就会更新

from kube-ovn.

oilbeater avatar oilbeater commented on July 18, 2024

@gjmzj 使用的是哪个版本的 kube-ovn?
看一下对应节点上 kube-ovn-cni 有没有什么错误日志。
另外看一下 对应的 pod 有没有自动生成对应的 ip/mac 的 annotation,如果没有的话需要看 controller 的日志

from kube-ovn.

oilbeater avatar oilbeater commented on July 18, 2024

这个问题是 node 节点的 cniserver 没有给 cni 返回正确的 podResponse 对象,一般是分配 ip 或者操作 ovs 的时候出现了异常

from kube-ovn.

gjmzj avatar gjmzj commented on July 18, 2024

1.kube-ovn v0.4.0
2.对应 kube-ovn-cni日志比较多,部分如下

$ kubectl logs -n kube-ovn kube-ovn-cni-99qzt cni-server
I0521 03:20:55.429826    3425 config.go:84] no --kubeconfig, use in-cluster kubernetes config
I0521 03:20:55.433393    3425 config.go:75] bind socket: /run/openvswitch/kube-ovn-daemon.sock
I0521 03:20:55.433423    3425 config.go:76] ovs socket at /run/openvswitch/db.sock
I0521 03:21:05.495577    3425 ovs.go:216] ping gw result is:
 PING 100.64.0.1 (100.64.0.1) 56(84) bytes of data.
64 bytes from 100.64.0.1: icmp_seq=1 ttl=254 time=77.0 ms
64 bytes from 100.64.0.1: icmp_seq=2 ttl=254 time=0.314 ms
64 bytes from 100.64.0.1: icmp_seq=3 ttl=254 time=60.3 ms
64 bytes from 100.64.0.1: icmp_seq=4 ttl=254 time=0.297 ms
64 bytes from 100.64.0.1: icmp_seq=5 ttl=254 time=0.292 ms
64 bytes from 100.64.0.1: icmp_seq=6 ttl=254 time=0.384 ms
64 bytes from 100.64.0.1: icmp_seq=7 ttl=254 time=0.334 ms
64 bytes from 100.64.0.1: icmp_seq=8 ttl=254 time=0.275 ms
64 bytes from 100.64.0.1: icmp_seq=9 ttl=254 time=0.287 ms
64 bytes from 100.64.0.1: icmp_seq=10 ttl=254 time=24.3 ms

--- 100.64.0.1 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9151ms
rtt min/avg/max/mdev = 0.275/16.390/77.091/27.363 ms
I0521 03:21:05.501615    3425 server.go:29] start listen on /run/openvswitch/kube-ovn-daemon.sock
I0521 03:21:05.501690    3425 controller.go:332] start watching namespace changes
I0521 03:21:05.601968    3425 controller.go:341] Started workers
I0521 03:21:05.602030    3425 gateway.go:39] start gateway
I0521 03:21:05.606651    3425 controller.go:225] route to add [172.20.0.0/16]
I0521 05:50:29.043179    3425 server.go:60] [2019-05-21T05:50:29Z] Incoming HTTP/1.1 POST /api/v1/add request
I0521 05:50:29.043589    3425 handler.go:34] add port request {coredns-55f46dd959-d2r2l kube-system e7a8dfe0a875bd42938996a2f92978cf6dccd8a72d7325f7eb2197a2dce757b8 /proc/14012/ns/net}
I0521 05:50:43.239319    3425 server.go:60] [2019-05-21T05:50:43Z] Incoming HTTP/1.1 POST /api/v1/add request
I0521 05:50:43.239449    3425 handler.go:34] add port request {kubernetes-dashboard-68ddcc97fc-r2g66 kube-system f305fdde7222127f5d5d7540fb1d517fc29c13766a2b173e1cad9ca3a1faa0fe /proc/15180/ns/net}
E0521 05:50:49.219887    3425 handler.go:59] no available ip for pod kube-system/coredns-55f46dd959-d2r2l
I0521 05:50:49.222563    3425 server.go:64] [2019-05-21T05:50:49Z] Outcoming response POST /api/v1/add with 500 status code in 20179ms
I0521 05:50:49.233807    3425 server.go:60] [2019-05-21T05:50:49Z] Incoming HTTP/1.1 POST /api/v1/del request
I0521 05:50:49.233923    3425 handler.go:82] delete port request {coredns-55f46dd959-d2r2l kube-system e7a8dfe0a875bd42938996a2f92978cf6dccd8a72d7325f7eb2197a2dce757b8 /proc/14012/ns/net}
I0521 05:50:49.272392    3425 server.go:64] [2019-05-21T05:50:49Z] Outcoming response POST /api/v1/del with 204 status code in 38ms
I0521 05:50:50.325416    3425 server.go:60] [2019-05-21T05:50:50Z] Incoming HTTP/1.1 POST /api/v1/del request
I0521 05:50:50.325475    3425 handler.go:82] delete port request {coredns-55f46dd959-d2r2l kube-system e7a8dfe0a875bd42938996a2f92978cf6dccd8a72d7325f7eb2197a2dce757b8 }
I0521 05:50:50.371444    3425 server.go:64] [2019-05-21T05:50:50Z] Outcoming response POST /api/v1/del with 204 status code in 45ms
I0521 05:50:50.716638    3425 server.go:60] [2019-05-21T05:50:50Z] Incoming HTTP/1.1 POST /api/v1/add request
I0521 05:50:50.716761    3425 handler.go:34] add port request {coredns-55f46dd959-d2r2l kube-system e417c6579190d974387976cde4f983063d4b4d500101d8baf37418e261fb9275 /proc/15841/ns/net}
E0521 05:51:03.283079    3425 handler.go:59] no available ip for pod kube-system/kubernetes-dashboard-68ddcc97fc-r2g66
I0521 05:51:03.284682    3425 server.go:64] [2019-05-21T05:51:03Z] Outcoming response POST /api/v1/add with 500 status code in 20045ms
I0521 05:51:03.292560    3425 server.go:60] [2019-05-21T05:51:03Z] Incoming HTTP/1.1 POST /api/v1/del request
I0521 05:51:03.292824    3425 handler.go:82] delete port request {kubernetes-dashboard-68ddcc97fc-r2g66 kube-system f305fdde7222127f5d5d7540fb1d517fc29c13766a2b173e1cad9ca3a1faa0fe /proc/15180/ns/net}
I0521 05:51:03.372124    3425 server.go:64] [2019-05-21T05:51:03Z] Outcoming response POST /api/v1/del with 204 status code in 79ms
I0521 05:51:04.485615    3425 server.go:60] [2019-05-21T05:51:04Z] Incoming HTTP/1.1 POST /api/v1/del request
I0521 05:51:04.485843    3425 handler.go:82] delete port request {kubernetes-dashboard-68ddcc97fc-r2g66 kube-system f305fdde7222127f5d5d7540fb1d517fc29c13766a2b173e1cad9ca3a1faa0fe }
I0521 05:51:04.508191    3425 server.go:64] [2019-05-21T05:51:04Z] Outcoming response POST /api/v1/del with 204 status code in 22ms
I0521 05:51:04.891172    3425 server.go:60] [2019-05-21T05:51:04Z] Incoming HTTP/1.1 POST /api/v1/add request
I0521 05:51:04.891268    3425 handler.go:34] add port request {kubernetes-dashboard-68ddcc97fc-r2g66 kube-system dda174779a31b49ef1824af0c653b7166b3d289fb56bf2cceff495471a644cd3 /proc/16819/ns/net}
E0521 05:51:10.762357    3425 handler.go:59] no available ip for pod kube-system/coredns-55f46dd959-d2r2l
I0521 05:51:10.763814    3425 server.go:64] [2019-05-21T05:51:10Z] Outcoming response POST /api/v1/add with 500 status code in 20047ms
I0521 05:51:10.771194    3425 server.go:60] [2019-05-21T05:51:10Z] Incoming HTTP/1.1 POST /api/v1/del request
I0521 05:51:10.771286    3425 handler.go:82] delete port request {coredns-55f46dd959-d2r2l kube-system e417c6579190d974387976cde4f983063d4b4d500101d8baf37418e261fb9275 /proc/15841/ns/net}
I0521 05:51:10.785259    3425 server.go:64] [2019-05-21T05:51:10Z] Outcoming response POST /api/v1/del with 204 status code in 14ms
I0521 05:51:11.579780    3425 server.go:60] [2019-05-21T05:51:11Z] Incoming HTTP/1.1 POST /api/v1/del request
I0521 05:51:11.579842    3425 handler.go:82] delete port request {coredns-55f46dd959-d2r2l kube-system e417c6579190d974387976cde4f983063d4b4d500101d8baf37418e261fb9275 }
I0521 05:51:11.596065    3425 server.go:64] [2019-05-21T05:51:11Z] Outcoming response POST /api/v1/del with 204 status code in 16ms
I0521 05:51:11.950963    3425 server.go:60] [2019-05-21T05:51:11Z] Incoming HTTP/1.1 POST /api/v1/add request
I0521 05:51:11.951042    3425 handler.go:34] add port request {coredns-55f46dd959-d2r2l kube-system 207ddc00e70e754da8a901635f80f23bb4836759f701afbd63039478c8598878 /proc/17419/ns/net}
E0521 05:51:24.938702    3425 handler.go:59] no available ip for pod kube-system/kubernetes-dashboard-68ddcc97fc-r2g66
I0521 05:51:24.944426    3425 server.go:64] [2019-05-21T05:51:24Z] Outcoming response POST /api/v1/add with 500 status code in 20053ms
I0521 05:51:24.960837    3425 server.go:60] [2019-05-21T05:51:24Z] Incoming HTTP/1.1 POST /api/v1/del request
I0521 05:51:24.961032    3425 handler.go:82] delete port request {kubernetes-dashboard-68ddcc97fc-r2g66 kube-system dda174779a31b49ef1824af0c653b7166b3d289fb56bf2cceff495471a644cd3 /proc/16819/ns/net}
I0521 05:51:25.073155    3425 server.go:64] [2019-05-21T05:51:25Z] Outcoming response POST /api/v1/del with 204 status code in 112ms
I0521 05:51:25.752649    3425 server.go:60] [2019-05-21T05:51:25Z] Incoming HTTP/1.1 POST /api/v1/del request
I0521 05:51:25.752727    3425 handler.go:82] delete port request {kubernetes-dashboard-68ddcc97fc-r2g66 kube-system dda174779a31b49ef1824af0c653b7166b3d289fb56bf2cceff495471a644cd3 }
I0521 05:51:25.767260    3425 server.go:64] [2019-05-21T05:51:25Z] Outcoming response POST /api/v1/del with 204 status code in 14ms
I0521 05:51:26.157559    3425 server.go:60] [2019-05-21T05:51:26Z] Incoming HTTP/1.1 POST /api/v1/add request
I0521 05:51:26.157678    3425 handler.go:34] add port request {kubernetes-dashboard-68ddcc97fc-r2g66 kube-system 52a4ae0fa25b54f3e502f1559883ae0369710f3c627ac7e921ef4c8937b4cd9d /proc/18476/ns/net}
E0521 05:51:31.996244    3425 handler.go:59] no available ip for pod kube-system/coredns-55f46dd959-d2r2l
I0521 05:51:31.996396    3425 server.go:64] [2019-05-21T05:51:31Z] Outcoming response POST /api/v1/add with 500 status code in 20045ms
I0521 05:51:32.005556    3425 server.go:60] [2019-05-21T05:51:32Z] Incoming HTTP/1.1 POST /api/v1/del request
I0521 05:51:32.005647    3425 handler.go:82] delete port request {coredns-55f46dd959-d2r2l kube-system 207ddc00e70e754da8a901635f80f23bb4836759f701afbd63039478c8598878 /proc/17419/ns/net}
I0521 05:51:32.072226    3425 server.go:64] [2019-05-21T05:51:32Z] Outcoming response POST /api/v1/del with 204 status code in 66ms
I0521 05:51:32.866605    3425 server.go:60] [2019-05-21T05:51:32Z] Incoming HTTP/1.1 POST /api/v1/del request
I0521 05:51:32.866684    3425 handler.go:82] delete port request {coredns-55f46dd959-d2r2l kube-system 207ddc00e70e754da8a901635f80f23bb4836759f701afbd63039478c8598878 }
I0521 05:51:32.974042    3425 server.go:64] [2019-05-21T05:51:32Z] Outcoming response POST /api/v1/del with 204 status code in 107ms
I0521 05:51:33.321732    3425 server.go:60] [2019-05-21T05:51:33Z] Incoming HTTP/1.1 POST /api/v1/add request
I0521 05:51:33.321790    3425 handler.go:34] add port request {coredns-55f46dd959-d2r2l kube-system af45cec9ee879cdcfd867f0b8bef44621653334d99eee8893fd21293dc1d7dd1 /proc/18964/ns/net}
E0521 05:51:46.209615    3425 handler.go:59] no available ip for pod kube-system/kubernetes-dashboard-68ddcc97fc-r2g66
I0521 05:51:46.211179    3425 server.go:64] [2019-05-21T05:51:46Z] Outcoming response POST /api/v1/add with 500 status code in 20053ms
I0521 05:51:46.219566    3425 server.go:60] [2019-05-21T05:51:46Z] Incoming HTTP/1.1 POST /api/v1/del request
I0521 05:51:46.219647    3425 handler.go:82] delete port request {kubernetes-dashboard-68ddcc97fc-r2g66 kube-system 52a4ae0fa25b54f3e502f1559883ae0369710f3c627ac7e921ef4c8937b4cd9d /proc/18476/ns/net}
I0521 05:51:46.273041    3425 server.go:64] [2019-05-21T05:51:46Z] Outcoming response POST /api/v1/del with 204 status code in 53ms
I0521 05:51:47.045836    3425 server.go:60] [2019-05-21T05:51:47Z] Incoming HTTP/1.1 POST /api/v1/del request
I0521 05:51:47.045902    3425 handler.go:82] delete port request {kubernetes-dashboard-68ddcc97fc-r2g66 kube-system 52a4ae0fa25b54f3e502f1559883ae0369710f3c627ac7e921ef4c8937b4cd9d }
I0521 05:51:47.072173    3425 server.go:64] [2019-05-21T05:51:47Z] Outcoming response POST /api/v1/del with 204 status code in 26ms
I0521 05:51:47.437060    3425 server.go:60] [2019-05-21T05:51:47Z] Incoming HTTP/1.1 POST /api/v1/add request
I0521 05:51:47.437135    3425 handler.go:34] add port request {kubernetes-dashboard-68ddcc97fc-r2g66 kube-system fbdc5017dedb438c9ce49e9aafc47cda1adc74c3693efa219fc397f0a2b5f540 /proc/20057/ns/net}
E0521 05:51:53.364630    3425 handler.go:59] no available ip for pod kube-system/coredns-55f46dd959-d2r2l
I0521 05:51:53.367506    3425 server.go:64] [2019-05-21T05:51:53Z] Outcoming response POST /api/v1/add with 500 status code in 20045ms
I0521 05:51:53.377341    3425 server.go:60] [2019-05-21T05:51:53Z] Incoming HTTP/1.1 POST /api/v1/del request
I0521 05:51:53.377638    3425 handler.go:82] delete port request {coredns-55f46dd959-d2r2l kube-system af45cec9ee879cdcfd867f0b8bef44621653334d99eee8893fd21293dc1d7dd1 /proc/18964/ns/net}
I0521 05:51:53.471354    3425 server.go:64] [2019-05-21T05:51:53Z] Outcoming response POST /api/v1/del with 204 status code in 93ms
I0521 05:51:54.142912    3425 server.go:60] [2019-05-21T05:51:54Z] Incoming HTTP/1.1 POST /api/v1/del request

from kube-ovn.

oilbeater avatar oilbeater commented on July 18, 2024

看上去是 controller 没有给 pod 分配 ip, 可以看一下 kube-ovn-controller 的日志,我看 pod 重启过怀疑是中间丢了一些消息

from kube-ovn.

gjmzj avatar gjmzj commented on July 18, 2024

controller 日志

I0521 03:20:44.786111       1 config.go:118] no --kubeconfig, use in-cluster kubernetes config
I0521 03:20:44.792794       1 config.go:109] config is  &{  10.68.73.165 6641  0xc00031e120 ovn-default 172.20.0.0/16 10.16.0.1 10.16.0.0..10.16.0.10 ovn-cluster join 100.64.0.0/16 100.64.0.1 cluster-tcp-loadbalancer cluster-udp-loadbalancer kube-ovn-controller-db57b48c
b-cvrz4 kube-ovn 3}
I0521 03:20:44.802401       1 ovn-nbctl.go:18] ovn-nbctl command lr-list in 9ms
I0521 03:20:44.802740       1 init.go:81] exists routers [ovn-cluster]
I0521 03:20:44.808235       1 ovn-nbctl.go:18] ovn-nbctl command --data=bare --no-heading --columns=_uuid find load_balancer name=cluster-tcp-loadbalancer in 5ms
I0521 03:20:44.808459       1 init.go:105] tcp load balancer 69b8b6f1-4bfe-4366-867f-7375cf45551b exists
I0521 03:20:44.813190       1 ovn-nbctl.go:18] ovn-nbctl command --data=bare --no-heading --columns=_uuid find load_balancer name=cluster-udp-loadbalancer in 4ms
I0521 03:20:44.813247       1 init.go:120] udp load balancer 0ea96123-94eb-4a11-9222-7628576bf447 exists
I0521 03:20:44.817698       1 ovn-nbctl.go:18] ovn-nbctl command ls-list in 4ms
I0521 03:20:44.817731       1 init.go:60] exists switches [join]
I0521 03:20:44.840769       1 controller.go:189] Starting OVN controller
I0521 03:20:44.840830       1 controller.go:200] waiting for becoming a leader
I0521 03:20:44.840897       1 leaderelection.go:205] attempting to acquire leader lease  kube-ovn/ovn-config...
I0521 03:20:44.850430       1 leaderelection.go:214] successfully acquired lease kube-ovn/ovn-config
I0521 03:20:44.850702       1 election.go:74] new leader elected: kube-ovn-controller-db57b48cb-cvrz4
I0521 03:20:44.850726       1 election.go:52] I am the new leader
I0521 03:20:45.840989       1 controller.go:200] waiting for becoming a leader
I0521 03:20:45.841125       1 controller.go:209] Waiting for informer caches to sync
I0521 03:20:45.941360       1 controller.go:214] Starting workers
I0521 03:20:45.941518       1 controller.go:238] Started workers
I0521 03:20:45.941649       1 endpoint.go:94] update endpoint default/kubernetes
I0521 03:20:45.941721       1 pod.go:335] add pod kube-ovn/ovs-ovn-2t48n
I0521 03:20:45.941991       1 pod.go:337] pod kube-ovn/ovs-ovn-2t48n in host network mode no need for ovn process
I0521 03:20:45.942053       1 pod.go:335] add pod kube-ovn/ovs-ovn-4fmh6
I0521 03:20:45.942200       1 namespace.go:191] namespace default use default logical switch ovn-default
I0521 03:20:45.942223       1 namespace.go:191] namespace kube-node-lease use default logical switch ovn-default
I0521 03:20:45.942330       1 pod.go:335] add pod kube-ovn/ovs-ovn-qvp2w
I0521 03:20:45.942350       1 pod.go:337] pod kube-ovn/ovs-ovn-qvp2w in host network mode no need for ovn process
I0521 03:20:45.942465       1 pod.go:335] add pod kube-ovn/kube-ovn-cni-57q94
I0521 03:20:45.942482       1 pod.go:337] pod kube-ovn/kube-ovn-cni-57q94 in host network mode no need for ovn process
I0521 03:20:45.942525       1 pod.go:335] add pod kube-ovn/kube-ovn-cni-99qzt
I0521 03:20:45.942540       1 pod.go:337] pod kube-ovn/kube-ovn-cni-99qzt in host network mode no need for ovn process
I0521 03:20:45.942554       1 pod.go:335] add pod kube-ovn/ovn-central-8658697f7f-2ngrx
I0521 03:20:45.942690       1 pod.go:337] pod kube-ovn/ovn-central-8658697f7f-2ngrx in host network mode no need for ovn process
I0521 03:20:45.942207       1 pod.go:337] pod kube-ovn/ovs-ovn-4fmh6 in host network mode no need for ovn process
I0521 03:20:45.942799       1 pod.go:335] add pod kube-ovn/kube-ovn-controller-db57b48cb-cvrz4
I0521 03:20:45.942816       1 pod.go:337] pod kube-ovn/kube-ovn-controller-db57b48cb-cvrz4 in host network mode no need for ovn process
I0521 03:20:45.942847       1 pod.go:335] add pod kube-ovn/kube-ovn-cni-2n5n5
I0521 03:20:45.942862       1 pod.go:337] pod kube-ovn/kube-ovn-cni-2n5n5 in host network mode no need for ovn process
I0521 03:20:45.942138       1 endpoint.go:94] update endpoint kube-ovn/ovn-nb
I0521 03:20:45.942979       1 pod.go:335] add pod kube-ovn/kube-ovn-controller-db57b48cb-n9lf5
I0521 03:20:45.942996       1 pod.go:337] pod kube-ovn/kube-ovn-controller-db57b48cb-n9lf5 in host network mode no need for ovn process
I0521 03:20:45.943248       1 endpoint.go:94] update endpoint kube-ovn/ovn-sb
I0521 03:20:45.979659       1 ovn-nbctl.go:18] ovn-nbctl command --wait=sb --may-exist lb-add cluster-tcp-loadbalancer 10.68.0.1:443 10.100.97.41:6443 in 37ms
I0521 03:20:45.979864       1 endpoint.go:94] update endpoint kube-system/kube-controller-manager
I0521 03:20:45.979946       1 ovn-nbctl.go:18] ovn-nbctl command --wait=sb --may-exist lsp-add join node-10.100.97.41 -- lsp-set-addresses node-10.100.97.41 0a:00:00:40:00:03 100.64.0.2 in 38ms
I0521 03:20:45.979958       1 endpoint.go:94] update endpoint kube-system/kube-scheduler
I0521 03:20:45.981837       1 ovn-nbctl.go:18] ovn-nbctl command --wait=sb --may-exist lsp-add join node-10.100.97.43 -- lsp-set-addresses node-10.100.97.43 0a:00:00:40:00:05 100.64.0.4 in 38ms
I0521 03:20:45.983628       1 ovn-nbctl.go:18] ovn-nbctl command --wait=sb --may-exist lb-add cluster-tcp-loadbalancer 10.68.73.165:6641 10.100.97.42:6641 in 40ms
I0521 03:20:45.984108       1 ovn-nbctl.go:18] ovn-nbctl command --wait=sb --may-exist lsp-add join node-10.100.97.42 -- lsp-set-addresses node-10.100.97.42 0a:00:00:40:00:04 100.64.0.3 in 41ms
I0521 03:20:45.985222       1 ovn-nbctl.go:18] ovn-nbctl command get logical_switch join other_config:subnet other_config:gateway in 5ms
I0521 03:20:45.985656       1 ovn-nbctl.go:18] ovn-nbctl command --wait=sb --may-exist lb-add cluster-tcp-loadbalancer 10.68.235.174:6642 10.100.97.42:6642 in 42ms
I0521 03:20:45.986768       1 ovn-nbctl.go:18] ovn-nbctl command ls-list in 44ms
E0521 03:20:45.986906       1 namespace.go:209] validate namespace kube-ovn failed, gateway address 10.16.0.1 not in cidr range
E0521 03:20:45.987069       1 namespace.go:107] error syncing 'kube-ovn': gateway address 10.16.0.1 not in cidr range, requeuing
I0521 03:20:45.987188       1 namespace.go:191] namespace kube-public use default logical switch ovn-default
I0521 03:20:45.987239       1 namespace.go:191] namespace kube-system use default logical switch ovn-default
I0521 03:20:45.987332       1 event.go:221] Event(v1.ObjectReference{Kind:"Namespace", Namespace:"", Name:"kube-ovn", UID:"458a6b5f-7b6e-11e9-985f-525400cecc16", APIVersion:"v1", ResourceVersion:"5301", FieldPath:""}): type: 'Warning' reason: 'ValidateLogicalSwitchFaile
d' gateway address 10.16.0.1 not in cidr range
I0521 03:20:45.988765       1 ovn-nbctl.go:18] ovn-nbctl command get logical_switch join other_config:subnet other_config:gateway in 6ms
I0521 03:20:45.991363       1 ovn-nbctl.go:18] ovn-nbctl command --wait=sb --may-exist --policy=dst-ip lr-route-add ovn-cluster 10.100.97.41 100.64.0.2 in 6ms
I0521 03:20:45.993724       1 ovn-nbctl.go:18] ovn-nbctl command --wait=sb --may-exist --policy=dst-ip lr-route-add ovn-cluster 10.100.97.43 100.64.0.4 in 4ms
I0521 03:20:46.003525       1 ovn-nbctl.go:18] ovn-nbctl command get logical_switch join other_config:subnet other_config:gateway in 19ms
I0521 03:20:46.004669       1 ovn-nbctl.go:18] ovn-nbctl command ls-list in 7ms
E0521 03:20:46.004726       1 namespace.go:209] validate namespace kube-ovn failed, gateway address 10.16.0.1 not in cidr range
E0521 03:20:46.004913       1 namespace.go:107] error syncing 'kube-ovn': gateway address 10.16.0.1 not in cidr range, requeuing
I0521 03:20:46.005031       1 event.go:221] Event(v1.ObjectReference{Kind:"Namespace", Namespace:"", Name:"kube-ovn", UID:"458a6b5f-7b6e-11e9-985f-525400cecc16", APIVersion:"v1", ResourceVersion:"5301", FieldPath:""}): type: 'Warning' reason: 'ValidateLogicalSwitchFaile
d' gateway address 10.16.0.1 not in cidr range
I0521 03:20:46.008949       1 ovn-nbctl.go:18] ovn-nbctl command --wait=sb --may-exist --policy=dst-ip lr-route-add ovn-cluster 10.100.97.42 100.64.0.3 in 5ms
I0521 03:20:46.030879       1 ovn-nbctl.go:18] ovn-nbctl command ls-list in 5ms
E0521 03:20:46.030968       1 namespace.go:209] validate namespace kube-ovn failed, gateway address 10.16.0.1 not in cidr range
E0521 03:20:46.031154       1 namespace.go:107] error syncing 'kube-ovn': gateway address 10.16.0.1 not in cidr range, requeuing
I0521 03:20:46.031274       1 event.go:221] Event(v1.ObjectReference{Kind:"Namespace", Namespace:"", Name:"kube-ovn", UID:"458a6b5f-7b6e-11e9-985f-525400cecc16", APIVersion:"v1", ResourceVersion:"5301", FieldPath:""}): type: 'Warning' reason: 'ValidateLogicalSwitchFaile
d' gateway address 10.16.0.1 not in cidr range
I0521 03:20:46.077081       1 ovn-nbctl.go:18] ovn-nbctl command ls-list in 5ms
E0521 03:20:46.077215       1 namespace.go:209] validate namespace kube-ovn failed, gateway address 10.16.0.1 not in cidr range
E0521 03:20:46.077388       1 namespace.go:107] error syncing 'kube-ovn': gateway address 10.16.0.1 not in cidr range, requeuing
I0521 03:20:46.077516       1 event.go:221] Event(v1.ObjectReference{Kind:"Namespace", Namespace:"", Name:"kube-ovn", UID:"458a6b5f-7b6e-11e9-985f-525400cecc16", APIVersion:"v1", ResourceVersion:"5301", FieldPath:""}): type: 'Warning' reason: 'ValidateLogicalSwitchFaile
d' gateway address 10.16.0.1 not in cidr range
I0521 03:20:46.162081       1 ovn-nbctl.go:18] ovn-nbctl command ls-list in 4ms
E0521 03:20:46.162252       1 namespace.go:209] validate namespace kube-ovn failed, gateway address 10.16.0.1 not in cidr range
E0521 03:20:46.162445       1 namespace.go:107] error syncing 'kube-ovn': gateway address 10.16.0.1 not in cidr range, requeuing
I0521 03:20:46.162635       1 event.go:221] Event(v1.ObjectReference{Kind:"Namespace", Namespace:"", Name:"kube-ovn", UID:"458a6b5f-7b6e-11e9-985f-525400cecc16", APIVersion:"v1", ResourceVersion:"5301", FieldPath:""}): type: 'Warning' reason: 'ValidateLogicalSwitchFaile
d' gateway address 10.16.0.1 not in cidr range
I0521 03:20:46.331500       1 ovn-nbctl.go:18] ovn-nbctl command ls-list in 7ms
E0521 03:20:46.331552       1 namespace.go:209] validate namespace kube-ovn failed, gateway address 10.16.0.1 not in cidr range
E0521 03:20:46.331644       1 namespace.go:107] error syncing 'kube-ovn': gateway address 10.16.0.1 not in cidr range, requeuing
I0521 03:20:46.331708       1 event.go:221] Event(v1.ObjectReference{Kind:"Namespace", Namespace:"", Name:"kube-ovn", UID:"458a6b5f-7b6e-11e9-985f-525400cecc16", APIVersion:"v1", ResourceVersion:"5301", FieldPath:""}): type: 'Warning' reason: 'ValidateLogicalSwitchFaile
d' gateway address 10.16.0.1 not in cidr range

里面我看到错误提示了,是我改了 kube-ovn.yml里面的 cidr

         - /kube-ovn/start-controller.sh
          args:
          - --default-cidr=172.20.0.0/16
          - --node-switch-cidr=100.64.0.0/16
          env:

from kube-ovn.

gjmzj avatar gjmzj commented on July 18, 2024
E0521 03:20:46.030968       1 namespace.go:209] validate namespace kube-ovn failed, gateway address 10.16.0.1 not in cidr range
E0521 03:20:46.031154       1 namespace.go:107] error syncing 'kube-ovn': gateway address 10.16.0.1 not in cidr range, requeuing
I0521 03:20:46.031274       1 event.go:221] Event(v1.ObjectReference{Kind:"Namespace", Namespace:"", Name:"kube-ovn", UID:"458a6b5f-7b6e-11e9-985f-525400cecc16", APIVersion:"v1", ResourceVersion:"5301", FieldPath:""}): type: 'Warning' reason: 'ValidateLogicalSwitchFaile
d' gateway address 10.16.0.1 not in cidr range

因为我k8s集群安装时候,指定了

kube-controller-manager.service:  --cluster-cidr=172.20.0.0/16

from kube-ovn.

gjmzj avatar gjmzj commented on July 18, 2024
需要再加一个 default-gw 的参数,可以先修改一下 kube-ovn namespace 里面 ovn.kubernetes.io/gateway 对应的值;

请问这个怎么操作,不好意思。。。

from kube-ovn.

oilbeater avatar oilbeater commented on July 18, 2024

kubectl edit ns kube-ovn
把 annotation 里的 ovn.kubernetes.io/gateway 和 ovn.kubernetes.io/exclude_ips 修改成172.20.0.1

from kube-ovn.

halfcrazy avatar halfcrazy commented on July 18, 2024

@oilbeater json: cannot unmarshal string into Go value of type request.PodResponse这个报错我们是不是应该把cni里返回的异常包一下。

from kube-ovn.

oilbeater avatar oilbeater commented on July 18, 2024

@oilbeater json: cannot unmarshal string into Go value of type request.PodResponse这个报错我们是不是应该把cni里返回的异常包一下。

嗯,异常的时候需要把 cniserver 的 response 原样打印出来

from kube-ovn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.