Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

calico pod cross-node access failed with ipv6 #6877

Closed
cyclinder opened this issue Oct 20, 2022 · 21 comments · Fixed by kubernetes-sigs/kubespray#9645
Closed

calico pod cross-node access failed with ipv6 #6877

cyclinder opened this issue Oct 20, 2022 · 21 comments · Fixed by kubernetes-sigs/kubespray#9645

Comments

@cyclinder
Copy link
Contributor

Expected Behavior

calico pod cross-node access works with ipv6, Regardless of the tunnel mode( vxlan always or crosseSubnet or never)

Current Behavior

calico pod cross-node access failed with ipv6, Regardless of the tunnel mode( vxlan always or crosseSubnet or never)

Possible Solution

Steps to Reproduce (for bugs)

  1. deploy calico by kubespray(v3.23.3)
  2. setting dual-stack IP family
  3. create two cross-node podA and podB
  4. podA failed to ping podB

Context

Your Environment

  • Calico version: v3.23.3
  • Orchestrator version (e.g. kubernetes, mesos, rkt):
  • Operating System and version:
  • Link to your project (optional):
@song-jiang
Copy link
Member

@coutinhop Could you help?

@coutinhop
Copy link
Contributor

@cyclinder I'll try to reproduce this later to investigate, but could you share some more details on your setup? Is this in a cloud, or on-prem, how do your ippool and felixconfig yamls look? I assume the failing ping is to the ipv6 addresses, right? Does IPv4 ping work? (If you could share the yamls from your pods that would be great too)

@cyclinder
Copy link
Contributor Author

Thanks for look this @coutinhop @song-jiang !

I built a k8s cluster via kubespray with dual-stack IP family. the version information is shown below:

[root@master ~]# kubectl version
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short.  Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.4", GitCommit:"95ee5ab382d64cfe6c28967f36b53970b8374491", GitTreeState:"clean", BuildDate:"2022-08-17T18:54:23Z", GoVersion:"go1.18.5", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.4
Server Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.4", GitCommit:"95ee5ab382d64cfe6c28967f36b53970b8374491", GitTreeState:"clean", BuildDate:"2022-08-17T18:47:37Z", GoVersion:"go1.18.5", Compiler:"gc", Platform:"linux/amd64"}
[root@master ~]# calicoctl version
Client Version:    v3.23.3
Git commit:        3a3559be1
Cluster Version:   v3.23.3
Cluster Type:      kubespray,kubeadm,kdd

calico ippool:

[root@master ~]# calicoctl get ippools -o yaml
apiVersion: projectcalico.org/v3
items:
- apiVersion: projectcalico.org/v3
  kind: IPPool
  metadata:
    creationTimestamp: "2022-09-26T03:42:51Z"
    name: default-pool
    resourceVersion: "689"
    uid: ca248dec-8973-4a1c-8b6e-db2841cba1b4
  spec:
    allowedUses:
    - Workload
    - Tunnel
    blockSize: 26
    cidr: 10.233.64.0/18
    ipipMode: Never
    natOutgoing: true
    nodeSelector: all()
    vxlanMode: Always
- apiVersion: projectcalico.org/v3
  kind: IPPool
  metadata:
    creationTimestamp: "2022-09-26T03:43:01Z"
    name: default-pool-ipv6
    resourceVersion: "554152"
    uid: 4dad544a-b517-40db-a4ef-b7a12646ffb4
  spec:
    allowedUses:
    - Workload
    - Tunnel
    blockSize: 122
    cidr: fd85:ee78:d8a6:8607::1:0/112
    ipipMode: Never
    nodeSelector: all()
    vxlanMode: CrossSubnet

I found cross-node pod failed to ping6 each other, but ipv4 works.

[root@master ~]# kubectl get po -o wide | grep test111
test111-7c9f87b884-p5jkm             1/1     Running   0             20d   10.233.97.150    master    <none>           <none>
test111-7c9f87b884-wqvxd             1/1     Running   0             20d   10.233.105.188   worker1   <none>           <none>
[root@master ~]# kubectl exec -it test111-7c9f87b884-p5jkm sh
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.
/ # ping fd85:ee78:d8a6:8607::1:ebbc
PING fd85:ee78:d8a6:8607::1:ebbc (fd85:ee78:d8a6:8607::1:ebbc): 56 data bytes
^C
--- fd85:ee78:d8a6:8607::1:ebbc ping statistics ---
16 packets transmitted, 0 packets received, 100% packet loss
/ # ^C
/ # ping 10.233.105.188
PING 10.233.105.188 (10.233.105.188): 56 data bytes
64 bytes from 10.233.105.188: seq=0 ttl=62 time=0.759 ms
64 bytes from 10.233.105.188: seq=1 ttl=62 time=0.550 ms
64 bytes from 10.233.105.188: seq=2 ttl=62 time=0.830 ms
64 bytes from 10.233.105.188: seq=3 ttl=62 time=0.639 ms
64 bytes from 10.233.105.188: seq=4 ttl=62 time=0.668 ms
^C
--- 10.233.105.188 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 0.550/0.689/0.830 ms

I try to change ipv6 tunnel mode from crossSubnet to Always, but it still doesn't work:

[root@master ~]# calicoctl patch ippools default-pool-ipv6 -p '{"spec": {"vxlanMode": "Always"}}'
Successfully patched 1 'IPPool' resource
[root@master ~]# kubectl exec -it test111-7c9f87b884-p5jkm sh
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.
/ # ping 10.233.105.188
PING 10.233.105.188 (10.233.105.188): 56 data bytes
64 bytes from 10.233.105.188: seq=0 ttl=62 time=1.260 ms
^C
--- 10.233.105.188 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 1.260/1.260/1.260 ms
/ # ping fd85:ee78:d8a6:8607::1:ebbc
PING fd85:ee78:d8a6:8607::1:ebbc (fd85:ee78:d8a6:8607::1:ebbc): 56 data bytes
^C
--- fd85:ee78:d8a6:8607::1:ebbc ping statistics ---
12 packets transmitted, 0 packets received, 100% packet loss

I try cross-node ping6 test pod and vxlan.calico-v6 on master node, but both failed:

[root@master ~]# ping6 fd85:ee78:d8a6:8607::1:ebbc
PING fd85:ee78:d8a6:8607::1:ebbc(fd85:ee78:d8a6:8607::1:ebbc) 56 data bytes
From fd00:6::10:6:168:131 icmp_seq=1 Destination unreachable: Address unreachable
From fd00:6::10:6:168:131 icmp_seq=2 Destination unreachable: Address unreachable
From fd00:6::10:6:168:131 icmp_seq=3 Destination unreachable: Address unreachable
--- fd85:ee78:d8a6:8607::1:ebbc ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 2999ms

[root@master ~]# calicoctl get nodes -o yaml | grep ipv6VXLANTunnelAddr
    ipv6VXLANTunnelAddr: fd85:ee78:d8a6:8607::1:db40
    ipv6VXLANTunnelAddr: fd85:ee78:d8a6:8607::1:eb80
[root@master ~]# ping6 fd85:ee78:d8a6:8607::1:eb80
PING fd85:ee78:d8a6:8607::1:eb80(fd85:ee78:d8a6:8607::1:eb80) 56 data bytes
^C
--- fd85:ee78:d8a6:8607::1:eb80 ping statistics ---
2 packets transmitted, 0 received, 100% packet loss, time 999ms

stange🤔,I noticed that the ipv6 tunnel routing seems to be out of order:

[root@master ~]# ip -6 r
fd00:6::/64 dev ens192 proto kernel metric 100 pref medium
fd85:ee78:d8a6:8607::1:db41 dev cali288c77059b1 metric 1024 pref medium
fd85:ee78:d8a6:8607::1:db42 dev calic8004afbecd metric 1024 pref medium
fd85:ee78:d8a6:8607::1:db46 dev calif11104d986c metric 1024 pref medium
fd85:ee78:d8a6:8607::1:db49 dev caliacee65198bd metric 1024 pref medium
fd85:ee78:d8a6:8607::1:db52 dev cali4fcad353bbb metric 1024 pref medium
fd85:ee78:d8a6:8607::1:db53 dev caliddc6a89ef1c metric 1024 pref medium
fd85:ee78:d8a6:8607::1:db54 dev calif646dcfc6c1 metric 1024 pref medium
fd85:ee78:d8a6:8607::1:db55 dev calie41f74cb471 metric 1024 pref medium
fd85:ee78:d8a6:8607::1:db56 dev cali6e0959520e3 metric 1024 pref medium
fd85:ee78:d8a6:8607::1:db57 dev calidc19f99beb7 metric 1024 pref medium
fd85:ee78:d8a6:8607::1:db58 dev calie3a5c2589c5 metric 1024 pref medium
fd85:ee78:d8a6:8607::1:db59 dev calicdf564a94e5 metric 1024 pref medium
fd85:ee78:d8a6:8607::1:db5a dev cali4deaf76d2ae metric 1024 pref medium
blackhole fd85:ee78:d8a6:8607::1:db40/122 dev lo proto 80 metric 1024 error -22 pref medium
fe80::/64 dev ens192 proto kernel metric 100 pref medium
fe80::/64 dev vxlan.calico proto kernel metric 256 pref medium
fe80::/64 dev cali288c77059b1 proto kernel metric 256 pref medium
fe80::/64 dev calic8004afbecd proto kernel metric 256 pref medium
fe80::/64 dev calif11104d986c proto kernel metric 256 pref medium
fe80::/64 dev cali4fcad353bbb proto kernel metric 256 pref medium
fe80::/64 dev caliddc6a89ef1c proto kernel metric 256 pref medium
fe80::/64 dev calif646dcfc6c1 proto kernel metric 256 pref medium
fe80::/64 dev calie3a5c2589c5 proto kernel metric 256 pref medium
fe80::/64 dev cali6e0959520e3 proto kernel metric 256 pref medium
fe80::/64 dev caliacee65198bd proto kernel metric 256 pref medium
fe80::/64 dev vethf59e8725316 proto kernel metric 256 pref medium
fe80::/64 dev calie41f74cb471 proto kernel metric 256 pref medium
fe80::/64 dev calidc19f99beb7 proto kernel metric 256 pref medium
fe80::/64 dev calicdf564a94e5 proto kernel metric 256 pref medium
fe80::/64 dev cali4deaf76d2ae proto kernel metric 256 pref medium
default via fd00:6::1 dev ens192 proto static metric 100 pref medium
[root@master ~]# calicoctl ipam show --show-blocks
+----------+---------------------------------+-----------+------------+--------------+
| GROUPING |              CIDR               | IPS TOTAL | IPS IN USE |   IPS FREE   |
+----------+---------------------------------+-----------+------------+--------------+
| IP Pool  | 10.233.64.0/18                  |     16384 | 27 (0%)    | 16357 (100%) |
| Block    | 10.233.105.128/26               |        64 | 12 (19%)   | 52 (81%)     |
| Block    | 10.233.97.128/26                |        64 | 15 (23%)   | 49 (77%)     |
| IP Pool  | fd85:ee78:d8a6:8607::1:0/112    |     65536 | 27 (0%)    | 65509 (100%) |
| Block    | fd85:ee78:d8a6:8607::1:db40/122 |        64 | 15 (23%)   | 49 (77%)     |
| Block    | fd85:ee78:d8a6:8607::1:eb80/122 |        64 | 12 (19%)   | 52 (81%)     |
+----------+---------------------------------+-----------+------------+--------------+

calico-node logs are always complaining about failed to add route:

2022-11-02 07:54:38.048 [DEBUG][87] felix/route_table.go 769: Added or updated CIDR: fd85:ee78:d8a6:8607::1:db40/122
2022-11-02 07:54:38.048 [DEBUG][87] felix/route_table.go 789: Create L3 route for: routetable.Target{Type:"vxlan", CIDR:ip.V6CIDR{addr:ip.V6Addr{0xfd, 0x85, 0xee, 0x78, 0xd8, 0xa6, 0x86, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0xdb, 0x40}, prefix:0x7a}, GW:ip.V6Addr{0xfd, 0x85, 0xee, 0x78, 0xd8, 0xa6, 0x86, 0x7, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0xdb, 0x40}, DestMAC:net.HardwareAddr(nil)}
2022-11-02 07:54:38.049 [DEBUG][87] felix/route_table.go 720: Failed to add route on first attempt, retrying... error=no route to host ifaceName="vxlan-v6.calico" ifaceRegex="^vxlan-v6.calico$" ipVersion=0x6 tableIndex=0
2022-11-02 07:54:38.049 [DEBUG][87] felix/route_table.go 459: Trying to connect to netlink
2022-11-02 07:54:38.049 [DEBUG][87] felix/route_table.go 1174: Interface still exists error=netlink update operation failed ifaceName="vxlan-v6.calico" ifaceRegex="^vxlan-v6.calico$" ipVersion=0x6 link=&netlink.Vxlan{LinkAttrs:netlink.LinkAttrs{Index:91, MTU:1430, TxQLen:0, Name:"vxlan-v6.calico", HardwareAddr:net.HardwareAddr{0x66, 0xed, 0xa6, 0x2d, 0x2b, 0x8d}, Flags:0x13, RawFlags:0x11043, ParentIndex:0, MasterIndex:0, Namespace:interface {}(nil), Alias:"", Statistics:(*netlink.LinkStatistics)(0xc0004b86c0), Promisc:0, Allmulti:0, Multi:1, Xdp:(*netlink.LinkXdp)(nil), EncapType:"ether", Protinfo:(*netlink.Protinfo)(nil), OperState:0x0, PhysSwitchID:0, NetNsID:-1, NumTxQueues:1, NumRxQueues:1, GSOMaxSize:0x10000, GSOMaxSegs:0xffff, GROMaxSize:0x0, Vfs:[]netlink.VfInfo(nil), Group:0x0, Slave:netlink.LinkSlave(nil)}, VxlanId:4096, VtepDevIndex:2, SrcAddr:net.IP{0xfd, 0x0, 0x0, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x6, 0x1, 0x68, 0x1, 0x32}, Group:net.IP(nil), TTL:0, TOS:0, Learning:false, Proxy:false, RSC:false, L2miss:false, L3miss:false, UDPCSum:false, UDP6ZeroCSumTx:false, UDP6ZeroCSumRx:false, NoAge:false, GBP:false, FlowBased:false, Age:300, Limit:0, Port:4789, PortLow:0, PortHigh:0} tableIndex=0
2022-11-02 07:54:38.052 [DEBUG][87] felix/route_table.go 1178: Failed to access interface but it appears to be up; retrying... error=netlink update operation failed ifaceName="vxlan-v6.calico" ifaceRegex="^vxlan-v6.calico$" ipVersion=0x6 link=&netlink.Vxlan{LinkAttrs:netlink.LinkAttrs{Index:91, MTU:1430, TxQLen:0, Name:"vxlan-v6.calico", HardwareAddr:net.HardwareAddr{0x66, 0xed, 0xa6, 0x2d, 0x2b, 0x8d}, Flags:0x13, RawFlags:0x11043, ParentIndex:0, MasterIndex:0, Namespace:interface {}(nil), Alias:"", Statistics:(*netlink.LinkStatistics)(0xc0004b86c0), Promisc:0, Allmulti:0, Multi:1, Xdp:(*netlink.LinkXdp)(nil), EncapType:"ether", Protinfo:(*netlink.Protinfo)(nil), OperState:0x0, PhysSwitchID:0, NetNsID:-1, NumTxQueues:1, NumRxQueues:1, GSOMaxSize:0x10000, GSOMaxSegs:0xffff, GROMaxSize:0x0, Vfs:[]netlink.VfInfo(nil), Group:0x0, Slave:netlink.LinkSlave(nil)}, VxlanId:4096, VtepDevIndex:2, SrcAddr:net.IP{0xfd, 0x0, 0x0, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x0, 0x6, 0x1, 0x68, 0x1, 0x32}, Group:net.IP(nil), TTL:0, TOS:0, Learning:false, Proxy:false, RSC:false, L2miss:false, L3miss:false, UDPCSum:false, UDP6ZeroCSumTx:false, UDP6ZeroCSumRx:false, NoAge:false, GBP:false, FlowBased:false, Age:300, Limit:0, Port:4789, PortLow:0, PortHigh:0} tableIndex=0
2022-11-02 07:54:38.053 [DEBUG][87] felix/route_table.go 979: Syncing interface L2 routes ifaceName="vxlan-v6.calico" ifaceRegex="^vxlan-v6.calico$" ipVersion=0x6 tableIndex=0
2022-11-02 07:54:38.053 [DEBUG][87] felix/route_table.go 1084: Programmed ARP entry=fd85:ee78:d8a6:8607::1:db40 66:a1:f7:26:77:2d
2022-11-02 07:54:38.053 [DEBUG][87] felix/route_table.go 1098: Programmed FDB entry=fd00:6::10:6:168:131 66:a1:f7:26:77:2d
2022-11-02 07:54:38.053 [DEBUG][87] felix/route_table.go 630: Syncing interface routes ifaceName="vxlan-v6.calico" ifaceRegex="^vxlan-v6.calico$" ipVersion=0x6 tableIndex=0
2022-11-02 07:54:38.053 [DEBUG][87] felix/route_table.go 656: Reconcile against kernel programming ifaceName="vxlan-v6.calico" ifaceRegex="^vxlan-v6.calico$" ipVersion=0x6 tableIndex=0
2022-11-02 07:54:38.147 [INFO][87] felix/route_table.go 953: Deleting from expected targets cidr=fd85:ee78:d8a6:8607::1:db40/122 ifaceName="vxlan-v6.calico" ifaceRegex="^vxlan-v6.calico$" ipVersion=0x6 tableIndex=0
2022-11-02 07:54:38.147 [INFO][87] felix/route_table.go 959: No pending target update, adding back in as an update cidr=fd85:ee78:d8a6:8607::1:db40/122 ifaceName="vxlan-v6.calico" ifaceRegex="^vxlan-v6.calico$" ipVersion=0x6 tableIndex=0

@cyclinder
Copy link
Contributor Author

Finally, here are the environment variables for calico-node, which I don't see any problem:

 containers:
  - env:
    - name: DATASTORE_TYPE
      value: kubernetes
    - name: WAIT_FOR_DATASTORE
      value: "true"
    - name: FELIX_VXLANVNI
      value: "4096"
    - name: FELIX_VXLANPORT
      value: "4789"
    - name: CALICO_NETWORKING_BACKEND
      valueFrom:
        configMapKeyRef:
          key: calico_backend
          name: calico-config
    - name: CLUSTER_TYPE
      valueFrom:
        configMapKeyRef:
          key: cluster_type
          name: calico-config
    - name: CALICO_K8S_NODE_REF
      valueFrom:
        fieldRef:
          apiVersion: v1
          fieldPath: spec.nodeName
    - name: CALICO_DISABLE_FILE_LOGGING
      value: "true"
    - name: FELIX_DEFAULTENDPOINTTOHOSTACTION
      value: RETURN
    - name: FELIX_HEALTHHOST
      value: localhost
    - name: FELIX_IPTABLESBACKEND
      value: Legacy
    - name: FELIX_IPTABLESLOCKTIMEOUTSECS
      value: "10"
    - name: CALICO_IPV4POOL_IPIP
      value: "Off"
    - name: FELIX_IPV6SUPPORT
      value: "True"
    - name: FELIX_LOGSEVERITYSCREEN
      value: debug
    - name: CALICO_STARTUP_LOGLEVEL
      value: error
    - name: FELIX_USAGEREPORTINGENABLED
      value: "False"
    - name: FELIX_CHAININSERTMODE
      value: Insert
    - name: FELIX_PROMETHEUSMETRICSENABLED
      value: "False"
    - name: FELIX_PROMETHEUSMETRICSPORT
      value: "9091"
    - name: FELIX_PROMETHEUSGOMETRICSENABLED
      value: "True"
    - name: FELIX_PROMETHEUSPROCESSMETRICSENABLED
      value: "True"
    - name: IP_AUTODETECTION_METHOD
      value: interface=ens192
    - name: IP
      value: autodetect
    - name: IP6_AUTODETECTION_METHOD
      value: interface=ens192
    - name: IP6
      value: autodetect
    - name: NODENAME
      valueFrom:
        fieldRef:
          apiVersion: v1
          fieldPath: spec.nodeName
    - name: FELIX_HEALTHENABLED
      value: "true"
    - name: FELIX_IGNORELOOSERPF
      value: "False"
    - name: CALICO_MANAGE_CNI
      value: "true"
    envFrom:
    - configMapRef:
        name: kubernetes-services-endpoint
        optional: true
    image: quay.m.daocloud.io/calico/node:v3.23.3

@cyclinder
Copy link
Contributor Author

cyclinder commented Nov 7, 2022

friendly ping :) @coutinhop

could you look on this?

@coutinhop
Copy link
Contributor

@cyclinder sorry for the delay, I've been a bit busy lately... I'll try to look at this as soon as possible, but as a quick check, could you see if enabling natOutgoing for the IPv6 pool has any effect? (maybe a long shot, but it was the only difference between v4 and v6 that I could spot on your configs)

I'll try to reproduce it later this week and investigate

@cyclinder
Copy link
Contributor Author

oh..no sorry and thank you for reply!

I try to patch IPv6 pool( change natOutgoing to true), but it still doesn't work.

[root@master ~]# calicoctl get ippools default-pool-ipv6 -o yaml
apiVersion: projectcalico.org/v3
kind: IPPool
metadata:
  creationTimestamp: "2022-09-26T03:43:01Z"
  name: default-pool-ipv6
  resourceVersion: "17713807"
  uid: 4dad544a-b517-40db-a4ef-b7a12646ffb4
spec:
  allowedUses:
  - Workload
  - Tunnel
  blockSize: 122
  cidr: fd85:ee78:d8a6:8607::1:0/112
  ipipMode: Never
  natOutgoing: true
  nodeSelector: all()
  vxlanMode: Always
[root@master ~]# calicoctl get wep
WORKLOAD                                 NODE      NETWORKS                                            INTERFACE
dao-test-76f7b6c79b-6g6kt                master    10.233.97.152/32,fd85:ee78:d8a6:8607::1:db58/128    calie3a5c2589c5
helm-operation-install-tt1-n29dz-2flfk   worker1                                                       calif574fb834ae
helm-operation-upgrade-tt1-fvdz2-66mhk   worker1                                                       cali414afdb3143
helm-operation-upgrade-tt1-mll74-4cqmf   worker1                                                       cali42e364d121c
macvlan-standalone-dfdc8f794-2xgrf       worker1   10.6.168.197/32                                     caliebb9da7872c
macvlan-standalone-dfdc8f794-kxzp6       master    10.6.168.191/32                                     cali3b0604b6edc
test-659db9db89-gqgr7                    worker1   10.233.105.182/32,fd85:ee78:d8a6:8607::1:ebb6/128   cali4d9708baabf
test111-7c9f87b884-p5jkm                 master    10.233.97.150/32,fd85:ee78:d8a6:8607::1:db56/128    cali6e0959520e3
test111-7c9f87b884-wqvxd                 worker1   10.233.105.188/32,fd85:ee78:d8a6:8607::1:ebbc/128   califfecd70dc31
tt1-dao-2048-5fcd7f79b-blg4l             worker1   10.233.105.157/32,fd85:ee78:d8a6:8607::1:eb9d/128   calid19df0992f3
tt1-dao-2048-5fcd7f79b-qzbz4             master    10.233.97.157/32,fd85:ee78:d8a6:8607::1:db5d/128    calic678cc9d8bb

[root@master ~]# kubectl exec -it test111-7c9f87b884-p5jkm sh
kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.
/ # ping fd85:ee78:d8a6:8607::1:ebbc
PING fd85:ee78:d8a6:8607::1:ebbc (fd85:ee78:d8a6:8607::1:ebbc): 56 data bytes
^C
--- fd85:ee78:d8a6:8607::1:ebbc ping statistics ---
11 packets transmitted, 0 packets received, 100% packet loss

I think the root tone is that the ipv6 routing is not working properly:

[root@master ~]# ip -6 r
unreachable ::/96 dev lo metric 1024 error -113 pref medium
unreachable ::ffff:0.0.0.0/96 dev lo metric 1024 error -113 pref medium
unreachable 2002:a00::/24 dev lo metric 1024 error -113 pref medium
unreachable 2002:7f00::/24 dev lo metric 1024 error -113 pref medium
unreachable 2002:a9fe::/32 dev lo metric 1024 error -113 pref medium
unreachable 2002:ac10::/28 dev lo metric 1024 error -113 pref medium
unreachable 2002:c0a8::/32 dev lo metric 1024 error -113 pref medium
unreachable 2002:e000::/19 dev lo metric 1024 error -113 pref medium
unreachable 3ffe:ffff::/32 dev lo metric 1024 error -113 pref medium
fd00:6::/64 dev ens192 proto kernel metric 100 pref medium
fd85:ee78:d8a6:8607::1:db41 dev cali288c77059b1 metric 1024 pref medium
fd85:ee78:d8a6:8607::1:db42 dev calic8004afbecd metric 1024 pref medium
fd85:ee78:d8a6:8607::1:db46 dev calif11104d986c metric 1024 pref medium
fd85:ee78:d8a6:8607::1:db49 dev caliacee65198bd metric 1024 pref medium
fd85:ee78:d8a6:8607::1:db52 dev cali4fcad353bbb metric 1024 pref medium
fd85:ee78:d8a6:8607::1:db53 dev caliddc6a89ef1c metric 1024 pref medium
fd85:ee78:d8a6:8607::1:db54 dev calif646dcfc6c1 metric 1024 pref medium
fd85:ee78:d8a6:8607::1:db55 dev calie41f74cb471 metric 1024 pref medium
fd85:ee78:d8a6:8607::1:db56 dev cali6e0959520e3 metric 1024 pref medium
fd85:ee78:d8a6:8607::1:db58 dev calie3a5c2589c5 metric 1024 pref medium
fd85:ee78:d8a6:8607::1:db5d dev calic678cc9d8bb metric 1024 pref medium
fd85:ee78:d8a6:8607::1:db60 dev califbe05b07d37 metric 1024 pref medium
fd85:ee78:d8a6:8607::1:db61 dev calie16864cf088 metric 1024 pref medium
fd85:ee78:d8a6:8607::1:db62 dev cali5300cbaab07 metric 1024 pref medium
fd85:ee78:d8a6:8607::1:db66 dev calif90ee043610 metric 1024 pref medium
fd85:ee78:d8a6:8607::1:db6a dev cali474ddaf2ed3 metric 1024 pref medium
fd85:ee78:d8a6:8607::1:db71 dev cali7a048c20d42 metric 1024 pref medium
blackhole fd85:ee78:d8a6:8607::1:db40/122 dev lo proto 80 metric 1024 error -22 pref medium   # here
fe80::/64 dev ens192 proto kernel metric 100 pref medium
fe80::/64 dev vxlan.calico proto kernel metric 256 pref medium
fe80::/64 dev cali288c77059b1 proto kernel metric 256 pref medium
fe80::/64 dev calic8004afbecd proto kernel metric 256 pref medium
fe80::/64 dev calif11104d986c proto kernel metric 256 pref medium
fe80::/64 dev cali4fcad353bbb proto kernel metric 256 pref medium
fe80::/64 dev caliddc6a89ef1c proto kernel metric 256 pref medium
fe80::/64 dev calif646dcfc6c1 proto kernel metric 256 pref medium
fe80::/64 dev calie3a5c2589c5 proto kernel metric 256 pref medium
fe80::/64 dev cali6e0959520e3 proto kernel metric 256 pref medium
fe80::/64 dev caliacee65198bd proto kernel metric 256 pref medium
fe80::/64 dev vethf59e8725316 proto kernel metric 256 pref medium
fe80::/64 dev calie41f74cb471 proto kernel metric 256 pref medium
fe80::/64 dev calic678cc9d8bb proto kernel metric 256 pref medium
fe80::/64 dev califbe05b07d37 proto kernel metric 256 pref medium
fe80::/64 dev calie16864cf088 proto kernel metric 256 pref medium
fe80::/64 dev cali5300cbaab07 proto kernel metric 256 pref medium
fe80::/64 dev calif90ee043610 proto kernel metric 256 pref medium
fe80::/64 dev cali474ddaf2ed3 proto kernel metric 256 pref medium
fe80::/64 dev cali7a048c20d42 proto kernel metric 256 pref medium
default via fd00:6::1 dev ens192 proto static metric 100 pref medium

@cyclinder
Copy link
Contributor Author

Hi @coutinhop , Any update here? If you have free time, please help me. thanks :)

@coutinhop
Copy link
Contributor

@cyclinder sorry for the delay, I'm still having trouble reproducing it, in addition to not being familiar with kubespray. By chance, I came accross this issue #6273 where they were having a similar problem (2022-06-24 08:53:21.079 [WARNING][117] felix/route_table.go 722: Failed to add route error=no route to host ifaceName="vxlan-v6.calico" ifaceRegex="^vxlan-v6.calico$" ipVersion=0x6 tableIndex=0) with linux kernel 3.10, and it was solved by upgrading to 5.4... What kernel version, distro, etc are you running?

Also, would you have more basic instructions on how to get a setup similar to yours on kubespray?

Thanks!

@cyclinder
Copy link
Contributor Author

cyclinder commented Dec 14, 2022

@coutinhop thanks your reply! kernel version is shown following:

Linux master 3.10.0-957.27.2.el7.x86_64 #1 SMP Mon Jul 29 17:46:05 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

I'm trying to figure out why adding tunnel routes fail. I added the tunnel route manually on the node and netlink returned the same error: "No route to host"

[root@master ~]# calicoctl get nodes -o yaml | grep ipv6VXLANTunnelAddr
    ipv6VXLANTunnelAddr: fd85:ee78:d8a6:8607::1:db75
    ipv6VXLANTunnelAddr: fd85:ee78:d8a6:8607::1:eb86
[root@master ~]# calicoctl ipam show --show-blocks
+----------+---------------------------------+-----------+------------+--------------+
| GROUPING |              CIDR               | IPS TOTAL | IPS IN USE |   IPS FREE   |
+----------+---------------------------------+-----------+------------+--------------+
| IP Pool  | 10.233.64.0/18                  |     16384 | 56 (0%)    | 16328 (100%) |
| Block    | 10.233.105.128/26               |        64 | 33 (52%)   | 31 (48%)     |
| Block    | 10.233.97.128/26                |        64 | 23 (36%)   | 41 (64%)     |
| IP Pool  | fd85:ee78:d8a6:8607::1:0/112    |     65536 | 56 (0%)    | 65480 (100%) |
| Block    | fd85:ee78:d8a6:8607::1:db40/122 |        64 | 23 (36%)   | 41 (64%)     |
| Block    | fd85:ee78:d8a6:8607::1:eb80/122 |        64 | 33 (52%)   | 31 (48%)     |
+----------+---------------------------------+-----------+------------+--------------+
[root@master ~]#  ip -6 r add fd85:ee78:d8a6:8607::1:eb80/122 via fd85:ee78:d8a6:8607::1:eb86 dev vxlan-v6.calico metric 1024 onlink pref medium
RTNETLINK answers: No route to host

At first, I suspect a problem with the neighbor table of the vxlan tunnel interface. two entries appear here that are not expected

[root@master ~]# ip n | grep vxlan
fd85:ee78:d8a6:8607::1:eb86 dev vxlan-v6.calico lladdr 66:ed:a6:2d:2b:8d PERMANENT
fd85:ee78:d8a6:8607::1:eb80 dev vxlan-v6.calico lladdr 66:ed:a6:2d:2b:8d PERMANENT

Manually delete the wrong one or restart calico-node, leaving only the correct one. and I trying to add the tunnel route again returns the same error.

[root@master ~]# ip n | grep vxlan
fd85:ee78:d8a6:8607::1:eb86 dev vxlan-v6.calico lladdr 66:ed:a6:2d:2b:8d PERMANENT
[root@master ~]#
[root@master ~]#  ip -6 r add fd85:ee78:d8a6:8607::1:eb80/122 via fd85:ee78:d8a6:8607::1:eb86 dev vxlan-v6.calico metric 1024 onlink pref medium
RTNETLINK answers: No route to host

This is strange, I tried the same operation above on a node with 5.15 kernel and it works:

root@controller:~# uname -a
Linux controller 5.15.0-52-generic #58-Ubuntu SMP Thu Oct 13 08:03:55 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
root@controller:~# ip n | grep vxlan
10.233.105.129 dev vxlan.calico lladdr 66:3c:05:84:20:98 PERMANENT
fd85:ee78:d8a6:8607::1:eb81 dev vxlan-v6.calico lladdr 66:ed:a6:2d:2b:8d PERMANENT
root@controller:~# ip -6 r add fd85:ee78:d8a6:8607::1:eb80/122 via fd85:ee78:d8a6:8607::1:eb81 dev vxlan-v6.calico metric 1024 onlink pref medium

Other info:

Kernal 5.15:

root@controller:~# uname -a
Linux controller 5.15.0-52-generic #58-Ubuntu SMP Thu Oct 13 08:03:55 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
root@controller:~# ip --detail link show vxlan-v6.calico
14: vxlan-v6.calico: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1430 qdisc noqueue state UNKNOWN mode DEFAULT group default
    link/ether 66:ab:34:a1:af:2b brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535
    vxlan id 4096 local fd00:10:6::101 dev ens160 srcport 0 0 dstport 4789 nolearning ttl auto ageing 300 udpcsum noudp6zerocsumtx noudp6zerocsumrx addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535

Kernal 3.10:

[root@master ~]# uname -a
Linux master 3.10.0-957.27.2.el7.x86_64 #1 SMP Mon Jul 29 17:46:05 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
[root@master ~]# ip --detail link show vxlan-v6.calico
575225: vxlan-v6.calico: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1430 qdisc noqueue state UNKNOWN mode DEFAULT group default
    link/ether 66:a1:f7:26:77:2d brd ff:ff:ff:ff:ff:ff promiscuity 0
    vxlan id 4096 local fd00:6::10:6:168:131 dev ens192 srcport 0 0 dstport 4789 nolearning ageing 300 noudpcsum noudp6zerocsumtx noudp6zerocsumrx addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535

I don't think there's anything special here.

@coutinhop Can you take a look ? Looking forward to your reply!

Thanks a lot!

@cyclinder
Copy link
Contributor Author

@coutinhop Hi~ can you please take a look? Thank you for your help.

@coutinhop
Copy link
Contributor

@cyclinder sorry I haven't been having a lot of time to put into this... Can you confirm that this is: not working for kernel 3.10, and working for kernel 5.15? And if that is true, would upgrading to 5.15 be an acceptable fix/workaround?

@cyclinder
Copy link
Contributor Author

cyclinder commented Jan 6, 2023

No worry! @coutinhop

Can you confirm that this is: not working for kernel 3.10, and working for kernel 5.15? And if that is true, would upgrading to 5.15 be an acceptable fix/workaround?

Yes, I think it's a workaround. But it's not the best way to fix it. We should figure out why vxlan-ipv6 for kernel 3.10 doesn't work.

I suspect that the root cause of the problem is that kernel 3.10 does not have better support for ipv6 vxlan.

@cyclinder
Copy link
Contributor Author

I think my suspicions were correct, I looked through the source code of liunx and found: vxlan ipv6 is only supported from kernel 3.12 onwards.

https://github.com/torvalds/linux/blob/8bb495e3f02401ee6f76d1b1d77f3ac9f079e376/drivers/net/vxlan.c#L10

So we should specify the compatibility of vxlan-ipv6 with the kernel version in the documentation.

@coutinhop
Copy link
Contributor

Thanks @cyclinder for getting to the bottom of this!

Indeed, the 'TODO' is there up until v3.11:
https://github.com/torvalds/linux/blob/v3.11/drivers/net/vxlan.c

Then it goes away on v3.12 onwards:
https://github.com/torvalds/linux/blob/v3.12/drivers/net/vxlan.c

I see you also pushed a docs PR, thanks!

@meizhuhanxiang
Copy link

@cyclinder Do you have time to help check my issue?

uname -a 
Linux node1 4.14.81.bm.30-amd64 #1 SMP Debian 4.14.81.bm.30 Thu May 6 03:23:40 UTC 2021 x86_64 GNU/Linux

my kernel version is shown above but I still meet the same problem with you

root@node1:~# calicoctl version
Client Version:    v3.23.3
Git commit:        3a3559be1
Cluster Version:   v3.24.5
Cluster Type:      kubespray,kubeadm,kdd,k8s,bgp
root@node1:~# kubectl version
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short.  Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.6", GitCommit:"b39bf148cd654599a52e867485c02c4f9d28b312", GitTreeState:"clean", BuildDate:"2022-09-21T13:19:24Z", GoVersion:"go1.18.6", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.4
Server Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.6", GitCommit:"b39bf148cd654599a52e867485c02c4f9d28b312", GitTreeState:"clean", BuildDate:"2022-09-21T13:12:04Z", GoVersion:"go1.18.6", Compiler:"gc", Platform:"linux/amd64"}

@meizhuhanxiang
Copy link

tiger@node1:~$ ip -6 r
fd85:ee78:d8a6:8607::1:340/122 via fe80::ecff:ffff:feff:ffff dev eth0 proto bird metric 1024 pref medium
fd85:ee78:d8a6:8607::1:6800/122 via fe80::ecff:ffff:feff:ffff dev eth0 proto bird metric 1024 pref medium
fd85:ee78:d8a6:8607::1:8700/122 via fe80::ecff:ffff:feff:ffff dev eth0 proto bird metric 1024 pref medium
fd85:ee78:d8a6:8607::1:a680 dev cali42422d444cd metric 1024 pref medium
fd85:ee78:d8a6:8607::1:a681 dev cali9297077dc4e metric 1024 pref medium
fd85:ee78:d8a6:8607::1:a682 dev calia27f40be0a7 metric 1024 pref medium
fd85:ee78:d8a6:8607::1:a683 dev cali985a622e3a7 metric 1024 pref medium
fd85:ee78:d8a6:8607::1:a684 dev cali4a7df9abe22 metric 1024 pref medium
fd85:ee78:d8a6:8607::1:a685 dev cali76c1d79ff74 metric 1024 pref medium
fd85:ee78:d8a6:8607::1:a686 dev calib60248dba83 metric 1024 pref medium
fd85:ee78:d8a6:8607::1:a687 dev cali45882f3236f metric 1024 pref medium
fd85:ee78:d8a6:8607::1:a688 dev cali1fe515219b5 metric 1024 pref medium
fd85:ee78:d8a6:8607::1:a689 dev cali53fac88b70d metric 1024 pref medium
fd85:ee78:d8a6:8607::1:a68a dev cali5902942061e metric 1024 pref medium
fd85:ee78:d8a6:8607::1:a68b dev cali79646b1b3a5 metric 1024 pref medium
fd85:ee78:d8a6:8607::1:a68c dev calie0afc9fba60 metric 1024 pref medium
fd85:ee78:d8a6:8607::1:a68d dev cali7d20094c1c8 metric 1024 pref medium
fd85:ee78:d8a6:8607::1:a68e dev calib2caf0c9e9c metric 1024 pref medium
blackhole fd85:ee78:d8a6:8607::1:a680/122 dev lo proto bird metric 1024 error 4294967274 pref medium
fdbd:dc61:ff:200::1 dev eth0 proto kernel metric 256 pref medium
fdbd:dc61:ff:200:6f21:367d:67cb:4d57 dev eth0 proto kernel metric 256 pref medium
fe80::/64 dev eth0 proto kernel metric 256 pref medium
fe80::/64 dev vxlan.calico proto kernel metric 256 pref medium
fe80::/64 dev cali42422d444cd proto kernel metric 256 pref medium
fe80::/64 dev cali9297077dc4e proto kernel metric 256 pref medium
fe80::/64 dev calia27f40be0a7 proto kernel metric 256 pref medium
fe80::/64 dev cali985a622e3a7 proto kernel metric 256 pref medium
fe80::/64 dev cali4a7df9abe22 proto kernel metric 256 pref medium
fe80::/64 dev cali76c1d79ff74 proto kernel metric 256 pref medium
fe80::/64 dev calib60248dba83 proto kernel metric 256 pref medium
fe80::/64 dev cali45882f3236f proto kernel metric 256 pref medium
fe80::/64 dev cali1fe515219b5 proto kernel metric 256 pref medium
fe80::/64 dev cali53fac88b70d proto kernel metric 256 pref medium
fe80::/64 dev cali5902942061e proto kernel metric 256 pref medium
fe80::/64 dev cali79646b1b3a5 proto kernel metric 256 pref medium
fe80::/64 dev calie0afc9fba60 proto kernel metric 256 pref medium
fe80::/64 dev cali7d20094c1c8 proto kernel metric 256 pref medium
fe80::/64 dev calib2caf0c9e9c proto kernel metric 256 pref medium
default via fe80::ecff:ffff:feff:ffff dev eth0 proto ra metric 1024 expires 8964sec hoplimit 64 pref medium
tiger@node1:~$ calicoctl ipam show --show-blocks --allow-version-mismatch
+----------+---------------------------------+-----------+------------+--------------+
| GROUPING |              CIDR               | IPS TOTAL | IPS IN USE |   IPS FREE   |
+----------+---------------------------------+-----------+------------+--------------+
| IP Pool  | 10.233.64.0/18                  |     16384 | 30 (0%)    | 16354 (100%) |
| Block    | 10.233.102.128/26               |        64 | 16 (25%)   | 48 (75%)     |
| Block    | 10.233.71.0/26                  |        64 | 6 (9%)     | 58 (91%)     |
| Block    | 10.233.74.64/26                 |        64 | 3 (5%)     | 61 (95%)     |
| Block    | 10.233.75.0/26                  |        64 | 5 (8%)     | 59 (92%)     |
| IP Pool  | fd85:ee78:d8a6:8607::1:0/112    |     65536 | 26 (0%)    | 65510 (100%) |
| Block    | fd85:ee78:d8a6:8607::1:340/122  |        64 | 2 (3%)     | 62 (97%)     |
| Block    | fd85:ee78:d8a6:8607::1:6800/122 |        64 | 4 (6%)     | 60 (94%)     |
| Block    | fd85:ee78:d8a6:8607::1:8700/122 |        64 | 5 (8%)     | 59 (92%)     |
| Block    | fd85:ee78:d8a6:8607::1:a680/122 |        64 | 15 (23%)   | 49 (77%)     |
+----------+---------------------------------+-----------+------------+--------------+

@cyclinder
Copy link
Contributor Author

@meizhuhanxiang It looks like you are not using ipv6 vxlan mode, can you show the output of calicoctl get ippools -o wide?

@LDTips
Copy link

LDTips commented Dec 6, 2023

I am having the same problem as meizhuhanxiang. However I have ipv6 vxlan enabled, nat enabled, kernel version 5.10+. Any ideas. One thing I suspect is that autodetect from calico bound to ips of a bridge interface, but it works for IPv4 so I am not sure

@meizhuhanxiang
Copy link

@meizhuhanxiang It looks like you are not using ipv6 vxlan mode, can you show the output of calicoctl get ippools -o wide?

NAME CIDR NAT IPIPMODE VXLANMODE DISABLED DISABLEBGPEXPORT SELECTOR
default-pool 10.233.64.0/18 true Never Always false false all()
default-pool-ipv6 fd85:ee78:d8a6:8607::1:0/112 true Never CrossSubnet false false all()

@meizhuhanxiang
Copy link

meizhuhanxiang commented Oct 25, 2024

My issue still exists. However, I have another cluster where the Linux kernel is exactly the same as the machines in this cluster, and that cluster does not have this problem, so it should not be caused by the kernel version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants