Open juissi-t opened 6 years ago
For any host networked pods, perhaps Calico could also add network policy rules which match the overlay network interface?
Unfortunately this isn't quite so simple. There may be multiple host-networked services with different policy requirements on the same host, all of these share the same IPs and interfaces, and so it's hard to isolate them simply by applying rules to an interface.
There is a related issue here which might help implement something like this: https://github.com/projectcalico/calico/issues/1302
We see this issue with operators, the kube-apiserver
tries to call a webhook that runs in the namespace of (in our case) the mariadb-operator. Because the vxlan.calico
interface ip address (used as src ip by the kube-apiserver
) is not included in the generated ipset, the kube-apiserver
is unable to call the webhook.
I imagine this could be a problem for many operators that rely on validating admission webhooks.
We're using Calico 3.1.1 as our NPC along with flannel+wireguard for our basic networking.
We have an issue where one of our teams makes use of
kubectl proxy
as part of their deployment process.They can add a policy the allows traffic from the
kube-system
namespace, and I can seecalico-nod does what makes sense on the node. There are ipset entries for each pod in
kube-system`, including for the kube-apiservers, which run in the host network namespace, and are therefore included with the host IP from the primary NIC.Unfortunately, traffic from pods in the host network namespace instead enters via the
flannel.wg
interface, and so appears instead to come from the IP address on this interface (always10.1.x.0
in our case).I can add
cidrBlock
rules for every possible10.1.x.0/32
address, but this feels like quite a kludge.Is this something that could be addressed by Calico?
Expected Behavior
Create a new network policy to a service in the
default
namespace which allows access fromkube-system
namespace (wherekube-apiserver
lives). When connecting to the cluster usingkubectl proxy
, the service in thedefault
namespace is accessible.Current Behavior
The service in
default
namespace is not accessible.Possible Solution
For any host networked pods, perhaps Calico could also add network policy rules which match the overlay network interface?
Steps to Reproduce (for bugs)
Using Canal (Flannel 0.10.0 + wireguard for networking, Calico 3.1.1 as NPC), create a new network policy to a service in the
default
namespace. Allow access to this service fromkube-system
namespace, wherekube-apiserver
resides:Run
kubectl proxy
.Try to connect to the service:
Context
One of our development teams uses proxy access as part of their deployment process and this blocks their work in implementing network policies.
Your Environment