Skip to content

RKE2 Cluster running Calico seemingly losing UDP traffic when transiting through service IP to remotely located pod #1541

Closed

Description

@aiyengar2

Environmental Info:
RKE2 Version: v1.21.3-rc3+rke2r2

Node(s) CPU architecture, OS, and Version:

Linux arvind-rke2-1 5.4.0-73-generic #82-Ubuntu SMP Wed Apr 14 17:39:42 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Cluster Configuration: 3 server nodes. Also reproducible on 3 etcd, 1 controlplane, and 3 worker nodes

Describe the bug:

Steps To Reproduce:

  • Installed RKE2: curl https://get.rke2.io | INSTALL_RKE2_CHANNEL=testing INSTALL_RKE2_METHOD=tar INSTALL_RKE2_VERSION=v1.21.3-rc3+rke2r2 sh -
  • Updated the config:
root@arvind-rke2-0:~# cat /etc/rancher/rke2/config.yaml
cni: calico

Other nodes are the same except with server + token fields

  • Run dig @10.43.0.10 google.com

Expected behavior:

All nodes should resolve the DNS

Actual behavior:

Only one node (the one that rke2-coredns is running on) resolves the DNS

Additional context / logs:

This issue was diagnosed in rancher/rancher#33052 but reproduced independently of Rancher using the above steps.

Activity

  1. changed the title [-]RKE2 cluster seems to have DNS issues[/-] [+]RKE2 cluster seems to have issues with pods communicating across nodes[/+] on Aug 5, 2021
  2. aiyengar2 commented on Aug 5, 2021

    @aiyengar2
    Author

    As noted in rancher/rancher#33052 (comment), it seems like this was a regression that was broken, fixed, and then broken once more, possibly due to different versions of RKE2

  3. Oats87 commented on Aug 5, 2021

    @Oats87
    Contributor

    I debugged this with Arvind and we found interesting behavior where UDP DNS queries are unable to be resolved when transiting via the service IP for CoreDNS i.e. 10.43.0.10. If we directly addressed the coredns pod, we could make our DNS queries with no issue. It did not matter whether we were in or out of a pod, i.e. on the node or not.

    The DNS service IP 10.43.0.10 worked when CoreDNS was located on the same node as we were testing on.

    This is when using the Calico CNI.

    This only occurs on Ubuntu 20.04 in our testing. On my CentOS 7 testing boxes, we did not run into this issue.

  4. Oats87 commented on Aug 5, 2021

    @Oats87
    Contributor

    ufw was on but

    # ufw status
    Status: inactive
    

    For good measure, systemctl disable ufw --now && reboot did not help either.

  5. changed the title [-]RKE2 cluster seems to have issues with pods communicating across nodes[/-] [+]RKE2 Cluster running Calico seemingly losing UDP traffic when transiting through service IP to remotely located pod[/+] on Aug 5, 2021
  6. brandond commented on Aug 5, 2021

    @brandond
    Member

    Does it make any difference if you switch the host iptables between legacy/nftables or uninstall the host iptables+nftables so that we use the embedded ones?

  7. aiyengar2 commented on Aug 5, 2021

    @aiyengar2
    Author

    Does it make any difference if you switch the host iptables between legacy/nftables or uninstall the host iptables+nftables so that we use the embedded ones?

    Not sure about this. cc: @Oats87

    However, I was able to test this on a v1.21.2+rke2r1 cluster and verify that this issue still exists in that version, so #1541 (comment) is not accurate.

  8. aiyengar2 commented on Aug 5, 2021

    @aiyengar2
    Author

    In a v1.21.3-rc3+rke2r2 cluster with two Ubuntu 18.04 nodes (as opposed to 20.04 listed above), I was able to reproduce this same behavior on the nodes.

    $ uname -a
    Linux arvind-ubuntu-1804-0 4.15.0-144-generic #148-Ubuntu SMP Sat May 8 02:33:43 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
    
  9. aiyengar2 commented on Aug 5, 2021

    @aiyengar2
    Author

    Without specifying cni: calico in the RKE2 cluster (v1.21.3-rc3+rke2r2), the dig call worked perfectly fine on all nodes.

    Seems like this is definitely related to Calico, as indicated on the ticket title.

  10. manuelbuil commented on Aug 6, 2021

    @manuelbuil
    Contributor

    Editing comment. Things seem to work when the pod is the client. The problem comes when the host tries to access the service. This is also happening on v1.21.3+rke2r1

  11. manuelbuil commented on Aug 6, 2021

    @manuelbuil
    Contributor

    When tracking the packet, I see it going through the correct iptables of kube-proxy:

    -A KUBE-SERVICES -d 10.43.0.10/32 -p udp -m comment --comment "kube-system/rke2-coredns-rke2-coredns:udp-53 cluster IP" -m udp --dport 53 -j KUBE-SVC-YFPH5LFNKP7E3G4L
    
    -A KUBE-SVC-YFPH5LFNKP7E3G4L -m comment --comment "kube-system/rke2-coredns-rke2-coredns:udp-53" -j KUBE-SEP-F54GWJZTXPXAPHRS
    
    -A KUBE-SEP-F54GWJZTXPXAPHRS -p udp -m comment --comment "kube-system/rke2-coredns-rke2-coredns:udp-53" -m udp -j DNAT --to-destination 10.42.182.4:53
    

    I can see the packet leaving the node:

    18:48:21.980669 IP 10.0.10.14.24169 > 10.0.10.10.4789: VXLAN, flags [I] (0x08), vni 4096
    IP 10.42.222.64.60066 > 10.42.182.4.53: 61063+ [1au] A? google.com. (51)
    

    And I can see the packet reaching to the other node (the one where coredns is):

    IP 10.42.222.64.55933 > 10.42.182.4.53: 5083+ [1au] A? google.com. (51)
    18:49:56.672731 IP 10.0.10.14.58192 > 10.0.10.10.4789: VXLAN, flags [I] (0x08), vni 4096
    

    Then the packet disappears

  12. manuelbuil commented on Aug 6, 2021

    @manuelbuil
    Contributor

    Sniffing a packet targeting the service. Node with coredns, interface eth0:

    19:04:16.499057 IP 10.0.10.14.49959 > 10.0.10.10.4789: VXLAN, flags [I] (0x08), vni 4096
    IP 10.42.222.64.51417 > 10.42.182.4.53: 29795+ [1au] A? google.com. (51)
    

    Sniffing a packet targeting the pod implementing the service. Node with coredns, interface eth0:

    19:04:11.194801 IP 10.0.10.14.34353 > 10.0.10.10.4789: VXLAN, flags [I] (0x08), vni 4096
    IP 10.42.222.64.46410 > 10.42.182.4.53: 14722+ [1au] A? google.com. (51)
    19:04:11.195126 IP 10.0.10.10.51238 > 10.0.10.14.4789: VXLAN, flags [I] (0x08), vni 4096
    IP 10.42.182.4.53 > 10.42.222.64.46410: 14722* 1/0/1 A 142.250.178.142 (77)
    

    Sniffing a packet targeting the service. Node with coredns, interface vxlan.calico: nothing
    Sniffing a packet targeting the pod implementing the service. Node with coredns, interface vxlan.calico:

    19:03:32.327538 IP 10.42.222.64.44687 > 10.42.182.4.53: 19939+ [1au] A? google.com. (51)
    19:03:32.328436 IP 10.42.182.4.53 > 10.42.222.64.44687: 19939 1/0/1 A 142.250.178.142 (65)
    
  13. 19 remaining items

  14. self-assigned this
    on Aug 20, 2021
  15. rancher-max commented on Aug 23, 2021

    @rancher-max
    Member

    Reopening for testing in rke2

  16. manuelbuil commented on Aug 23, 2021

    @manuelbuil
    Contributor

    @rancher-max apart from doing the dig @10.43.0.10 www.google.com in all nodes, verify that kubectl get felixconfigurations.crd.projectcalico.org default -o yaml gives you this spec:

    spec:
      bpfLogLevel: ""
      featureDetectOverride: ChecksumOffloadBroken=true
      logSeverityScreen: Info
      reportingInterval: 0s
      vxlanEnabled: true
    

    We are only passing featureDetectOverride: ChecksumOffloadBroken=true and the rest of parameters should be filled by the operator

  17. rancher-max commented on Aug 23, 2021

    @rancher-max
    Member

    Leaving this open to validate on 1.22 release line, but confirmed working in v1.21.3-rc7+rke2r2

    Validated the dig command works on all nodes, and felixconfigurations are set as mentioned above. Also confirmed running sudo ethtool -k vxlan.calico | grep tx-checksum-ip-generic on all nodes returns expected tx-checksum-ip-generic: off.

  18. galal-hussein commented on Sep 22, 2021

    @galal-hussein
    Contributor

    Validated on master commit 09bb5c2

    • Install rke2 server on three nodes
    • configure rke2 server to run calico as its cni
    • run the dig command on all nodes
    # dig @10.43.0.10 google.com
    
    ; <<>> DiG 9.16.1-Ubuntu <<>> @10.43.0.10 google.com
    ; (1 server found)
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 5294
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
    
    ;; OPT PSEUDOSECTION:
    ; EDNS: version: 0, flags:; udp: 4096
    ; COOKIE: 6c2344a672e1a9de (echoed)
    ;; QUESTION SECTION:
    ;google.com.			IN	A
    
    ;; ANSWER SECTION:
    google.com.		30	IN	A	142.250.69.206
    
    ;; Query time: 0 msec
    ;; SERVER: 10.43.0.10#53(10.43.0.10)
    ;; WHEN: Wed Sep 22 22:35:47 UTC 2021
    ;; MSG SIZE  rcvd: 77
    
    • make sure that calico is configured correctly
    # kubectl get felixconfigurations.crd.projectcalico.org default -o yaml
    apiVersion: crd.projectcalico.org/v1
    kind: FelixConfiguration
    metadata:
      annotations:
        meta.helm.sh/release-name: rke2-calico
        meta.helm.sh/release-namespace: kube-system
        projectcalico.org/metadata: '{"uid":"9f051b21-813b-475b-9615-c23692d89279","generation":1,"creationTimestamp":"2021-09-22T22:32:15Z","managedFields":[{"manager":"helm","operation":"Update","apiVersion":"crd.projectcalico.org/v1","time":"2021-09-22T22:32:15Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:annotations":{".":{},"f:meta.helm.sh/release-name":{},"f:meta.helm.sh/release-namespace":{}},"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:spec":{".":{},"f:featureDetectOverride":{}}}}]}'
      creationTimestamp: "2021-09-22T22:32:15Z"
      generation: 3
      labels:
        app.kubernetes.io/managed-by: Helm
      name: default
      resourceVersion: "968"
      uid: 9f051b21-813b-475b-9615-c23692d89279
    spec:
      bpfLogLevel: ""
      featureDetectOverride: ChecksumOffloadBroken=true
      logSeverityScreen: Info
      reportingInterval: 0s
      vxlanEnabled: true
    
  19. strelok899 commented on Feb 11, 2024

    @strelok899

    i have the opposite issue.
    the fix gone to the helm and i trying to disable it to have the hardware offload as i have limited resources and my kube-proxy crashing on lack of cpu issues.

    how can i make the offloading work?

  20. brandond commented on Feb 11, 2024

    @brandond
    Member

    Enabling hardware offload will not address issues with insufficient CPU resources. Also, please don't revive old resolved issues to ask unrelated questions, open a new issue or discussion.

  21. locked and limited conversation to collaborators on Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions