Skip to content

Commit 232e8d2

Browse files
authored
Merge pull request #92866 from JoeAldinger/OCPBUGS-55471-4.17
[enteprise-4.17] OCPBUGS-55471:fixes OVN-K external IP docs
2 parents 4dace2e + 2a05eae commit 232e8d2

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

modules/nw-networkpolicy-optimize-ovn.adoc

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,42 @@ 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+
== NetworkPolicy CR and external IPs in OVN-Kubernetes
108+
109+
In OVN-Kubernetes, the `NetworkPolicy` custom resource (CR) enforces strict isolation rules. If a service is exposed using an external IP, a network policy can block access from other namespaces unless explicitly configured to allow traffic.
110+
111+
To allow access to external IPs across namespaces, create a `NetworkPolicy` CR 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>
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: <my_namespace>
134+
podSelector: {}
135+
policyTypes:
136+
- Ingress
137+
----
138+
where:
139+
140+
`<policy_name>`:: Specifies your name for the policy.
141+
`<my_namespace>`:: Specifies the name of the namespace where the policy is deployed.
142+
143+
For more details, see "About network policy".

0 commit comments

Comments
 (0)