calico: KubeSpray - Cannot access local node services when using eBPF
I have one cluster and also install Prometheus in it. So, each node has a service (HostIP:9100) to export node information. However, if I run one Pod on Node1(Node1 Host IP: 172.21.149.119), I cannot access 172.21.149.119:9100 in the Pod. But I can access other services on the other nodes, such as 172.21.149.xx:9100 .
Expected Behavior
All local serivces on every node can be accessed in the Pod.
Current Behavior
Now, only local services run on different nodes with my Pod can be accessed in my Pod.
Possible Solution
https://github.com/projectcalico/calico/issues/6065
Steps to Reproduce (for bugs)
- Install Calico v3.23.1 or v3.22.3
- Install Prometheus
- Run a Pod on any node
- In the Pod, use curl to access HostIP:9100 (HostIP is the node IP where the Pod runs on.)
Context
I also can see the following log messages in calico-node Pod.
libbpf: prog 'calico_connect_v4': failed to attach to cgroup: Invalid argument
2023-01-30 12:01:50.409 [INFO][129] felix/connecttime.go 146: Loaded cgroup program cgroup="/run/calico/cgroup" program="calico_connect_v4"
libbpf: prog 'calico_sendmsg_v4': failed to attach to cgroup: Invalid argument
2023-01-30 12:01:50.499 [INFO][129] felix/connecttime.go 146: Loaded cgroup program cgroup="/run/calico/cgroup" program="calico_sendmsg_v4"
libbpf: prog 'calico_recvmsg_v4': failed to attach to cgroup: Invalid argument
2023-01-30 12:01:50.501 [INFO][129] felix/connecttime.go 146: Loaded cgroup program cgroup="/run/calico/cgroup" program="calico_recvmsg_v4"
libbpf: prog 'calico_sendmsg_v6': failed to attach to cgroup: Invalid argument
2023-01-30 12:01:50.502 [INFO][129] felix/connecttime.go 146: Loaded cgroup program cgroup="/run/calico/cgroup" program="calico_sendmsg_v6"
libbpf: prog 'calico_recvmsg_v6': failed to attach to cgroup: Invalid argument
I think this problem is very similar as #6065. However, the problem still exists after upgrading Calico to v3.23.1.
Your Environment
- Calico version: v3.25.1
- Orchestrator version (e.g. kubernetes, mesos, rkt): kubernetes 1.26.5
- Operating System and version: Ubuntu 22.04 LTS
Someone can help me?
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 46 (21 by maintainers)
Commits related to this issue
- [BPF] pods in nat-outgoing shoul dnot SNAT to local host When a pod is accessing a local host, it should not get SNATed as the host when it is in a nat-outgoing ippool. (a) it is unnecessary as the l... — committed to tomastigera/project-calico-calico by tomastigera 3 years ago
- [BPF] suppress normal HEP policy on WEP if there is no wildcard HostEndpoint If there is no wildcard HEP, there is no policy that should be applied. But without skipping, empty list of profiles would... — committed to tomastigera/project-calico-calico by tomastigera 3 years ago
- [BPF] suppress normal HEP policy on WEP if there is no wildcard HostEndpoint If there is no wildcard HEP, there is no policy that should be applied. But without skipping, empty list of profiles would... — committed to tomastigera/project-calico-calico by tomastigera 3 years ago
- [BPF] suppress normal HEP policy on WEP if there is no wildcard HostEndpoint If there is no wildcard HEP, there is no policy that should be applied. But without skipping, empty list of profiles would... — committed to tomastigera/project-calico-calico by tomastigera 3 years ago
- pods in nat-outgoing shoul dnot SNAT to local host When a pod is accessing a local host, it should not get SNATed as the host when it is in a nat-outgoing ippool. (a) it is unnecessary as the local n... — committed to tomastigera/project-calico-calico by tomastigera 3 years ago
- suppress normal HEP policy on WEP if there is no wildcard HostEndpoint If there is no wildcard HEP, there is no policy that should be applied. But without skipping, empty list of profiles would creat... — committed to tomastigera/project-calico-calico by tomastigera 3 years ago
- pods in nat-outgoing shoul dnot SNAT to local host When a pod is accessing a local host, it should not get SNATed as the host when it is in a nat-outgoing ippool. (a) it is unnecessary as the local n... — committed to tomastigera/project-calico-calico by tomastigera 3 years ago
- [BPF] suppress normal HEP policy on WEP if there is no wildcard HostEndpoint If there is no wildcard HEP, there is no policy that should be applied. But without skipping, empty list of profiles would... — committed to mazdakn/calico by tomastigera 3 years ago
It will be part of the upcoming 3.27.1 - soon!
So in one of my dev k8s clusters I’ve switched to RKE2… guess which version of Calico it’s feeding me? ;P v3.27.2! So I’m likely to try Calico in eBPF mode again, but with RKE2 I can actually properly disable kube-proxy for it.
@BloodyIron the fix is released, it is actually 3.27.2
I modified it and it still not works. Here is my Felix config
@tomastigera Here are the output from my environment
Above information are dumped from calico-node pod which is running on Host 172.21.147.156. And I run a nginx pod on Host 172.21.147.156, too. Last, my http server is running on Host 172.21.147.156 and listening Port 9999 natively. (not pod)
Could you see anything wrong here?
@tomastigera Upstream kubernetes (1.27.5) installed with kubespray. Will try to gather some logs according to your guide and get back to you.