Bug 1749844
| Summary: | Need a way to allow ingress from hostsubnet pods in netpol | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Juan Luis de Sousa-Valadas <jdesousa> |
| Component: | Networking | Assignee: | Dan Mace <dmace> |
| Networking sub component: | router | QA Contact: | Hongan Li <hongli> |
| Status: | CLOSED DUPLICATE | Docs Contact: | |
| Severity: | low | ||
| Priority: | unspecified | CC: | aos-bugs, danw, pbertera |
| Version: | 4.1.z | ||
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2019-11-28 14:49:32 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Juan Luis de Sousa-Valadas
2019-09-06 14:51:51 UTC
This is a pretty fundamental limitation of how k8s network policy works - you generally can't grant access to host network pods, because they generally don't source traffic from their PodIP. It's interesting to see that this worked in 3.x. In other words, that *all* hosts could access *all* endpoints. I'm not sure if this is as expected. Then again, perhaps it's a reasonable expansion. We already say that a host can access all of the pods running on that host. Dan, thoughts? NetworkPolicy-vs-hostNetwork worked exactly the same in 3.x as it does in 4.x.
The original problem, from the support case is:
> After creating an allow-from-openshift-ingress network policy object, the
> openshift router can't access the pod anymore. It seems that traffic coming
> from the openshift-ingress namespace is not considered coming from the
> openshift-ingress namespace but from the openshift node itself because the
> router uses the host network.
Routers are not hostNetwork by default in 4.1. This is an alternate mode. Our documented instructions for making routers work assume that you're not using that mode. So we should fix that.
After that, from what I can see, the customer reported that they had allowed traffic from VNID 0 and that *did* fix the problem for them (and then they closed the case).
Perhaps we should also label the default namespace with something like "network.openshift.io/policy-group: host-network" *** This bug has been marked as a duplicate of bug 1768608 *** |