Skip to content

Commit 222317c

Browse files
committed
Updated networking sections with changes in external Ip and OVN-K behaviour
1 parent c73b313 commit 222317c

File tree

3 files changed

+65
-0
lines changed

3 files changed

+65
-0
lines changed

Diff for: modules/nw-ne-changes-externalip-ovn.adoc

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Module included in the following assemblies:
2+
// * networking/understanding-networking.adoc
3+
4+
:_mod-docs-content-type: REFERENCE
5+
[id="nw-ne-changes-externalip-ovn_{context}"]
6+
== Understanding changes in external IP behavior with OVN-Kubernetes
7+
8+
When migrating from OpenShift SDN to OVN-Kubernetes (OVN-K), services that use external IPs might become inaccessible across namespaces due to `NetworkPolicy` enforcement.
9+
10+
In OpenShift SDN, external IPs were accessible across namespaces by default. However, in OVN-K, network policies strictly enforce multitenant isolation, preventing access to services exposed via external IPs from other namespaces.
11+
12+
To ensure accessibility, consider the following alternatives:
13+
14+
* Use an ingress or route: Instead of exposing services by using external IPs, configure an ingress or route to allow external access while maintaining security controls.
15+
16+
* Adjust `NetworkPolicies`: Modify `NetworkPolicy` rules to explicitly allow access from required namespaces and ensure that traffic is allowed to the designated service ports. Without allowing traffic to the required ports, access might still be blocked, even if the namespace is explicitly allowed.
17+
18+
* Use a `LoadBalancer` service: If applicable, deploy a `LoadBalancer` service instead of relying on external IPs.
19+
20+
For more information about configuring `NetworkPolicies`, see "Configuring NetworkPolicies".

Diff for: modules/nw-networkpolicy-optimize-ovn.adoc

+37
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,40 @@ spec:
102102
----
103103
+
104104
You can apply this optimization when only multiple selectors are expressed as one. In cases where selectors are based on different labels, it may not be possible to apply this optimization. In those cases, consider applying some new labels for network policy optimization specifically.
105+
106+
[id="nw-networkpolicy-external-ip-ovn_{context}"]
107+
== NetworkPolicies and external IPs in OVN-Kubernetes
108+
109+
In OVN-Kubernetes, `NetworkPolicies` enforce strict isolation rules. If a service is exposed using an external IP, `NetworkPolicies` can block access from other namespaces unless explicitly configured.
110+
111+
To allow access to external IPs across namespaces, create a `NetworkPolicy` that explicitly permits ingress from the required namespaces and ensures traffic is allowed to the designated service ports. Without allowing traffic to the required ports, access might still be restricted.
112+
113+
.Example output
114+
[source,yaml]
115+
----
116+
apiVersion: networking.k8s.io/v1
117+
kind: NetworkPolicy
118+
metadata:
119+
annotations:
120+
name: <policy_name> <1>
121+
namespace: openshift-ingress
122+
spec:
123+
ingress:
124+
- ports:
125+
- port: 80
126+
protocol: TCP
127+
- ports:
128+
- port: 443
129+
protocol: TCP
130+
- from:
131+
- namespaceSelector:
132+
matchLabels:
133+
kubernetes.io/metadata.name: <namespace_name> <2>
134+
podSelector: {}
135+
policyTypes:
136+
- Ingress
137+
----
138+
<1> Specify the policy name.
139+
<2> Specify the namespace name.
140+
141+
For more details, see "About network policy".

Diff for: networking/understanding-networking.adoc

+8
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,11 @@ include::modules/nw-ne-openshift-dns.adoc[leveloffset=+1]
2626
include::modules/nw-ne-openshift-ingress.adoc[leveloffset=+1]
2727
include::modules/nw-ne-comparing-ingress-route.adoc[leveloffset=+2]
2828
include::modules/nw-networking-glossary-terms.adoc[leveloffset=+1]
29+
30+
31+
include::modules/nw-ne-changes-externalip-ovn.adoc[leveloffset=+1]
32+
33+
[role="_additional-resources"]
34+
== Additional resources
35+
36+
* xref:../networking/index#network-policy[About network policy]

0 commit comments

Comments
 (0)