When using ServiceLB in CIS profile, only traffic coming on node external ip is reaching the ServiceLB service. #6528
Labels
kind/documentation
Improvements or additions to documentation
Milestone
Environmental Info:
RKE2 Version:
rke2 version v1.28.12+rke2r1 (27989db)
go version go1.22.5 X:boringcrypto
Node(s) CPU architecture, OS, and Version:
RHEL 8.9
Linux lattice.local 4.18.0-513.24.1.el8_9.x86_64 #1 SMP Thu Mar 14 14:20:09 EDT 2024 x86_64 x86_64 x86_64 GNU/Linux
Cluster Configuration:
Describe the bug:
When you enable CIS profile, and create a ServiceLB-backed LoadBalancer (which should effectively just be a Host Port), only traffic that connects to the external node ip is able to reach the service. No other node's addresses work, including
127.0.0.1
. This works just fine on non-CIS RKE2, I can hit my service on any interface.Steps To Reproduce:
Expected behavior:
I can reach my
echo
LoadBalancer on10.0.2.15:4444
and on127.0.0.1:4444
Actual behavior:
I can only reach it on the external IP:
Additional context / logs:
The cause of this behavior is NetworkPolicies set up by CIS profile. When I connect to the service on the external IP, it appears to be coming from the external IP, but when I connect to it using
127.0.0.1
, the traffic appears to be coming from the corresponding ServiceLB pod running in a differentkube-system
namespace, and as such gets rejected by CIS profile NetworkPolicy.I can work around this behavior by adding extra NetworkPolicies, e.g.:
but I feel that it's ServiceLB that should be adding these policies in addition to setting up iptables rules. I don't want to add these NetworkPolicies, because if I add them when it's not necessary (in non-CIS mode), it will break other things (as adding a first network policy to the cluster has an effect of blocking everything that's not in that network policy). This is additionally made extra confusing by the fact that you have to add a rule to target container port, not the Load Balancer service port.
The text was updated successfully, but these errors were encountered: