netscaler / netscaler-k8s-node-controller

Integrates the hardware/virtualized NetScaler with the Kubernetes overlay / underlay
40 stars 9 forks source link

Calico not decteted on kube-cnc-router pods cni_name undefined #31

Closed mickael-decastro closed 8 months ago

mickael-decastro commented 2 years ago

Hello,

I deployed project on cluster kubernetes using Calico Network Provider. Confiug map is never updated with nodes IP ... When I check logs we have cni_name undified.

Pod kube-cnc-router-xxx logs:

CNI Name is undefined
determining cni
CNI Name is undefined
determining cni
CNI Name is undefined
determining cni
CNI Name is undefined
determining cni
CNI Name is undefined
determining cni
CNI Name is undefined
determining cni
CNI Name is undefined
determining cni
CNI Name is undefined
determining cni
...

On pod configuration we can see the setting for cni_name variable. Conditions for calico are not respected

ifconfigdata=`ifconfig`
cni_name=`if [[ ${ifconfigdata} =~ "cni" && ${ifconfigdata} =~ "flannel" && ${cni_type} == "flannel" ]]; then echo "flannel"
          elif [[ ${ifconfigdata} =~ "flannel" && ${cni_type} == "flannel" ]]; then echo "flanel"
          elif [[ ${ifconfigdata} =~ "cali" &&  ${ifconfigdata} =~ "flannel" && ${cni_type} == "canal" ]]; then echo "canal"
          elif [[ ${ifconfigdata} =~ "cali" &&  ${ifconfigdata} =~ "tun" && ${cni_type} == "calico" ]]; then echo "calico"
          elif [[ ${ifconfigdata} =~ "cali" &&  ${ifconfigdata} =~ "vxlan.calico" && ${cni_type} == "calico" ]]; then echo "calico"
          elif [[ ${ifconfigdata} =~ "cilium_host" && ${cni_type} == "cilium" ]]; then echo "cilium"
          elif [[ ${ifconfigdata} =~ "vethwe-bridge" && ${ifconfigdata} =~ "weave" && ${cni_type} == "weave" ]]; then echo "weave"
          elif [[ ${ifconfigdata} =~ "tun" && ${cni_type} == "ovs" ]];; then echo "ovs"
          elif [[ ${ifconfigdata} =~ "ovn-k8s" && ${cni_type}== "ovn" ]]; then echo "ovn"
          else echo "undefined"
fi`

echo "CNIName is ${cni_name} "

Pod network configuration:

# ifconfig
cali1xxxxxxxx: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1440
        inet6 fe80::ecee:eeff:feee:eeee  prefixlen 64  scopeid 0x20<link>
        ether ee:ee:ee:ee:ee:ee  txqueuelen 0  (Ethernet)
        RX packets 53574269  bytes 63731252719 (63.7 GB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 42955542  bytes 6955817049 (6.9 GB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

cali1xxxxxxxxv: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1440
        inet6 fe80::ecee:eeff:feee:eeee  prefixlen 64  scopeid 0x20<link>
        ether ee:ee:ee:ee:ee:ee  txqueuelen 0  (Ethernet)
        RX packets 2037795  bytes 440594029 (440.5 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1467056  bytes 771823955 (771.8 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

calixxxxxxxxc: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1440
        inet6 fe80::ecee:eeff:feee:eeee  prefixlen 64  scopeid 0x20<link>
        ether ee:ee:ee:ee:ee:ee  txqueuelen 0  (Ethernet)
        RX packets 745  bytes 107098 (107.0 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 750  bytes 964932 (964.9 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

calixxxxxxxxxxxxd: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1440
        inet6 fe80::ecee:eeff:feee:eeee  prefixlen 64  scopeid 0x20<link>
        ether ee:ee:ee:ee:ee:ee  txqueuelen 0  (Ethernet)
        RX packets 23010623  bytes 137353365367 (137.3 GB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 18827228  bytes 27784331597 (27.7 GB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

calixxxxxxxxxxxf: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1440
        inet6 fe80::ecee:eeff:feee:eeee  prefixlen 64  scopeid 0x20<link>
        ether ee:ee:ee:ee:ee:ee  txqueuelen 0  (Ethernet)
        RX packets 1125886  bytes 65663388 (65.6 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1450212  bytes 83177828 (83.1 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

calixxxxxxxxxxxs: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1440
        inet6 fe80::ecee:eeff:feee:eeee  prefixlen 64  scopeid 0x20<link>
        ether ee:ee:ee:ee:ee:ee  txqueuelen 0  (Ethernet)
        RX packets 1145801  bytes 66499518 (66.4 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1470186  bytes 84017192 (84.0 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

calixxxxxxxxxxxi: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1440
        inet6 fe80::ecee:eeff:feee:eeee  prefixlen 64  scopeid 0x20<link>
        ether ee:ee:ee:ee:ee:ee  txqueuelen 0  (Ethernet)
        RX packets 151548  bytes 68122891 (68.1 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 116372  bytes 91949818 (91.9 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

calixxxxxxxxxxxso: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1440
        inet6 fe80::ecee:eeff:feee:eeee  prefixlen 64  scopeid 0x20<link>
        ether ee:ee:ee:ee:ee:ee  txqueuelen 0  (Ethernet)
        RX packets 10195168  bytes 4459515846 (4.4 GB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 11386270  bytes 1784660362 (1.7 GB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

calixxxxxxxxxxxsk: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1440
        inet6 fe80::ecee:eeff:feee:eeee  prefixlen 64  scopeid 0x20<link>
        ether ee:ee:ee:ee:ee:ee  txqueuelen 0  (Ethernet)
        RX packets 509647  bytes 35204564 (35.2 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 469947  bytes 28614494 (28.6 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

calixxxxxxxxxxxsp: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1440
        inet6 fe80::ecee:eeff:feee:eeee  prefixlen 64  scopeid 0x20<link>
        ether ee:ee:ee:ee:ee:ee  txqueuelen 0  (Ethernet)
        RX packets 164820228  bytes 257940175875 (257.9 GB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 203939326  bytes 1350970546043 (1.3 TB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet xx.xx.xx.254 netmask 255.255.255.0  broadcast xx.xx.xx.xx.255
        inet6 fe80::526b:8dff:feda:60c7  prefixlen 64  scopeid 0x20<link>
        ether 50:6b:8d:da:60:c7  txqueuelen 1000  (Ethernet)
        RX packets 1372723519  bytes 2166210959965 (2.1 TB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1689144249  bytes 9429817042692 (9.4 TB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 47788233  bytes 14284737558 (14.2 GB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 47788233  bytes 14284737558 (14.2 GB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Thanks

aroraharsh23 commented 2 years ago

@mickael-decastro May i know which mode of calico are you using ? Vxlan or IPIP ? I guess you are using direct mode. As of now, CNC supports only Encapsulated modes.

mickael-decastro commented 2 years ago

I didn't set Calico to use VXLAN, be default it use IPIP :-( . Thanks for you quick reply.

aroraharsh23 commented 2 years ago

We do support IPIP encapsulated mode, please set IPIP mode to 'Always' instead of 'CrossSubnet'.