-
Notifications
You must be signed in to change notification settings - Fork 49
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
[libnetwork] Default Profile for a new IPPool generates ipset with no members. Ingress packet to a workload always matches no profile and gets dropped by iptables. #190
Comments
I don't think this sort of thing works out of the box - rule selectors match workload endpoints, not IP pools. So, unless your workload endpoints or NetworkSets are labeled with that particular label then that rule won't select anything. You can check what labels are applied to your workload endpoints with |
Thanks for your prompt reply @caseydavenport ! Actually what I meant was... The When I run the
It seems the default selector expects the name of the network ( Thanks again! |
@Syraxius Ah, right I see what you mean.
I noticed in your example command uses This seems to be the only code which is setting labels currently: https://github.com/projectcalico/libnetwork-plugin/blob/master/driver/network_driver.go#L648-L667 From a quick read, I don't see it setting the network name as a label, which I would assume is the root cause here. As you pointed out, the profile expects a A simple fix, I think, would be to add the label at this point: https://github.com/projectcalico/libnetwork-plugin/blob/master/driver/network_driver.go#L300 |
Expected Behavior
The default profile generated should allow all egress traffic, and allow ingress traffic from the same network as specified in the documentation page here.
Current Behavior
All egress traffic are permitted, but no ingress traffic is permitted other than from the node itself to its own workload. This is caused by an empty ipset which is supposed to match the IPPool's subnet.
In summary:
Possible Solution
The issue I was having was fixed when changing the Profile from:
To:
(The name of my IPPool resource and Profile are both calico-pool-0)
Of course, the above will now allow everything which is not in the spirit of the default profile.
I will find time soon to determine from code the actual reason why
has(calico-pool-0)
causes an empty ipset.Steps to Reproduce (for bugs)
Here is the tcpdump (from
tcpdump -enni any icmp
):It seems it's getting dropped by iptables because it's not getting marked in
cali-pro-calico-pool-0
chain:From
iptables-save -c
we can see that the ipset (cali40s:Gcr-rptUOZhd-mtexAmjwZt
) is used to match the packets to be marked:And it seems like the ipset
cali40s:Gcr-rptUOZhd-mtexAmjwZt
is empty:I've tried enabling
--use-docker-networking-container-labels
but it still does not work.Context
Trying to run Calico 3.4 with plain Docker. I've compiled libnetwork-plugin and added it to the calico/node image.
Your Environment
calico-felix --version
):flag: v3.4.0 (from calico-node -v)calico/node
container version (if running Felix in a container): release-v3.4The text was updated successfully, but these errors were encountered: