Skip to content

Commit 6398cea

Browse files
authored
Merge pull request #48324 from EricPonvelle/OSDOCS-3691_NetworkingPort
OSDOCS-3691: Ported Network Polices to OSD/ROSA
2 parents 6cf600e + e1d200f commit 6398cea

16 files changed

+192
-18
lines changed

_topic_maps/_topic_map.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ Topics:
10411041
File: deleting-network-policy
10421042
- Name: Defining a default network policy for projects
10431043
File: default-network-policy
1044-
- Name: Configuring multitenant network policy
1044+
- Name: Configuring multitenant isolation with network policy
10451045
File: multitenant-network-policy
10461046
- Name: AWS Load Balancer Operator
10471047
Dir: aws_load_balancer_operator

_topic_maps/_topic_map_osd.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,19 @@ Topics:
208208
File: configuring-cluster-wide-proxy
209209
- Name: CIDR range definitions
210210
File: cidr-range-definitions
211+
- Name: Network policy
212+
Dir: network_policy
213+
Topics:
214+
- Name: About network policy
215+
File: about-network-policy
216+
- Name: Creating a network policy
217+
File: creating-network-policy
218+
- Name: Viewing a network policy
219+
File: viewing-network-policy
220+
- Name: Deleting a network policy
221+
File: deleting-network-policy
222+
- Name: Configuring multitenant isolation with network policy
223+
File: multitenant-network-policy
211224
---
212225
Name: Applications
213226
Dir: applications

_topic_maps/_topic_map_rosa.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,19 @@ Topics:
312312
File: configuring-cluster-wide-proxy
313313
- Name: CIDR range definitions
314314
File: cidr-range-definitions
315+
- Name: Network policy
316+
Dir: network_policy
317+
Topics:
318+
- Name: About network policy
319+
File: about-network-policy
320+
- Name: Creating a network policy
321+
File: creating-network-policy
322+
- Name: Viewing a network policy
323+
File: viewing-network-policy
324+
- Name: Deleting a network policy
325+
File: deleting-network-policy
326+
- Name: Configuring multitenant isolation with network policy
327+
File: multitenant-network-policy
315328
---
316329
Name: Application development
317330
Dir: applications

modules/nw-networkpolicy-create.adoc renamed to modules/nw-networkpolicy-create-cli.adoc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// Module included in the following assemblies:
22
//
3+
// * networking/multiple_networks/configuring-multi-network-policy.adoc
34
// * networking/network_policy/creating-network-policy.adoc
45
// * post_installation_configuration/network-configuration.adoc
56

@@ -15,8 +16,8 @@ ifeval::["{context}" == "configuring-multi-network-policy"]
1516
endif::[]
1617

1718
:_content-type: PROCEDURE
18-
[id="nw-networkpolicy-create_{context}"]
19-
= Creating a {name} policy
19+
[id="nw-networkpolicy-create-cli_{context}"]
20+
= Creating a {name} policy using the CLI
2021

2122
To define granular rules describing ingress or egress network traffic allowed for namespaces in your cluster, you can create a {name} policy.
2223

@@ -80,16 +81,16 @@ spec:
8081
podSelector:
8182
ingress: []
8283
----
83-
ifdef::multi[]
8484
+
85+
ifdef::multi[]
8586
--
8687
where
8788

8889
`<network_name>`:: Specifies the name of a network attachment definition.
8990
--
9091
endif::multi[]
91-
+
9292
.Allow ingress from all pods in the same namespace
93+
+
9394
[source,yaml]
9495
----
9596
ifndef::multi[]
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * networking/network_policy/creating-network-policy.adoc
4+
// * post_installation_configuration/network-configuration.adoc
5+
6+
:_content-type: PROCEDURE
7+
[id="nw-networkpolicy-create-ocm_{context}"]
8+
= Creating a network policy using {cluster-manager}
9+
10+
To define granular rules describing the ingress or egress network traffic allowed for namespaces in your cluster, you can create a network policy.
11+
12+
.Prerequisites
13+
14+
* You logged in to {cluster-manager-url}.
15+
* You created an {product-title} cluster.
16+
* You configured an identity provider for your cluster.
17+
* You added your user account to the configured identity provider.
18+
* You created a project within your {product-title} cluster.
19+
20+
.Procedure
21+
22+
. From {cluster-manager-url}, click on the cluster you want to access.
23+
24+
. Click *Open console* to navigate to the OpenShift web console.
25+
26+
. Click on your identity provider and provide your credentials to log in to the cluster.
27+
28+
. From the administrator perspective, under *Networking*, click *NetworkPolicies*.
29+
30+
. Click *Create NetworkPolicy*.
31+
32+
. Provide a name for the policy in the *Policy name* field.
33+
34+
. Optional: You can provide the label and selector for a specific pod if this policy applies only to one or more specific pods. If you do not select a specific pod, then this policy will be applicable to all pods on the cluster.
35+
36+
. Optional: You can block all ingress and egress traffic by using the *Deny all ingress traffic* or *Deny all egress traffic* checkboxes.
37+
38+
. You can also add any combination of ingress and egress rules, allowing you to specify the port, namespace, or IP blocks you want to approve.
39+
40+
. Add ingress rules to your policy:
41+
42+
.. Select *Add ingress rule* to configure a new rule. This action creates a new *Ingress rule* row with an *Add allowed source* drop-down menu that enables you to specify how you want to limit inbound traffic. The drop-down menu offers three options to limit your ingress traffic:
43+
+
44+
*** *Allow pods from the same namespace* limits traffic to pods within the same namespace. You can specify the pods in a namespace, but leaving this option blank allows all of the traffic from pods in the namespace.
45+
46+
*** *Allow pods from inside the cluster* limits traffic to pods within the same cluster as the policy. You can specify namespaces and pods from which you want to allow inbound traffic. Leaving this option blank allows inbound traffic from all namespaces and pods within this cluster.
47+
48+
*** *Allow peers by IP block* limits traffic from a specified Classless Inter-Domain Routing (CIDR) IP block. You can block certain IPs with the exceptions option. Leaving the CIDR field blank allows all inbound traffic from all external sources.
49+
50+
.. You can restrict all of your inbound traffic to a port. If you do not add any ports then all ports are accessible to traffic.
51+
52+
. Add egress rules to your network policy:
53+
54+
.. Select *Add egress rule* to configure a new rule. This action creates a new *Egress rule* row with an *Add allowed destination*"* drop-down menu that enables you to specify how you want to limit outbound traffic. The drop-down menu offers three options to limit your egress traffic:
55+
+
56+
*** *Allow pods from the same namespace* limits outbound traffic to pods within the same namespace. You can specify the pods in a namespace, but leaving this option blank allows all of the traffic from pods in the namespace.
57+
58+
*** *Allow pods from inside the cluster* limits traffic to pods within the same cluster as the policy. You can specify namespaces and pods from which you want to allow outbound traffic. Leaving this option blank allows outbound traffic from all namespaces and pods within this cluster.
59+
60+
*** *Allow peers by IP block* limits traffic from a specified CIDR IP block. You can block certain IPs with the exceptions option. Leaving the CIDR field blank allows all outbound traffic from all external sources.
61+
62+
.. You can restrict all of your outbound traffic to a port. If you do not add any ports then all ports are accessible to traffic.

modules/nw-networkpolicy-delete.adoc renamed to modules/nw-networkpolicy-delete-cli.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ ifeval::["{context}" == "configuring-multi-network-policy"]
1515
endif::[]
1616

1717
:_content-type: PROCEDURE
18-
[id="nw-networkpolicy-delete_{context}"]
19-
= Deleting a {name} policy
18+
[id="nw-networkpolicy-delete-cli_{context}"]
19+
= Deleting a {name} policy using the CLI
2020

2121
You can delete a {name} policy in a namespace.
2222

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * networking/network_policy/deleting-network-policy.adoc
4+
// * post_installation_configuration/network-configuration.adoc
5+
6+
:_content-type: PROCEDURE
7+
[id="nw-networkpolicy-delete-ocm_{context}"]
8+
= Deleting a network policy using {cluster-manager}
9+
10+
You can delete a network policy in a namespace.
11+
12+
.Prerequisites
13+
14+
* You logged in to {cluster-manager-url}.
15+
* You created an {product-title} cluster.
16+
* You configured an identity provider for your cluster.
17+
* You added your user account to the configured identity provider.
18+
19+
.Procedure
20+
21+
. From the *Administrator* perspective in the {cluster-manager} web console, under *Networking*, click *NetworkPolicies*.
22+
23+
. Use one of the following methods for deleting your network policy:
24+
25+
** Delete the policy from the *Network Policies* table:
26+
.. From the *Network Policies* table, select the stack menu on the row of the network policy you want to delete and then, click *Delete NetworkPolicy*.
27+
28+
** Delete the policy using the *Actions* drop-down menu from the individual network policy details:
29+
.. Click on *Actions* drop-down menu for your network policy.
30+
.. Select *Delete NetworkPolicy* from the menu.

modules/nw-networkpolicy-view.adoc renamed to modules/nw-networkpolicy-view-cli.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ ifeval::["{context}" == "configuring-multi-network-policy"]
1212
endif::[]
1313

1414
:_content-type: PROCEDURE
15-
[id="nw-networkpolicy-view_{context}"]
16-
= Viewing {name} policies
15+
[id="nw-networkpolicy-view-cli_{context}"]
16+
= Viewing {name} policies using the CLI
1717

1818
You can examine the {name} policies in a namespace.
1919

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * networking/network_policy/viewing-network-policy.adoc
4+
// * post_installation_configuration/network-configuration.adoc
5+
6+
:_content-type: PROCEDURE
7+
[id="nw-networkpolicy-view-ocm_{context}"]
8+
= Viewing network policies using {cluster-manager}
9+
10+
You can view the configuration details of your network policy in {cluster-manager-first}.
11+
12+
.Prerequisites
13+
14+
* You logged in to {cluster-manager-url}.
15+
* You created an {product-title} cluster.
16+
* You configured an identity provider for your cluster.
17+
* You added your user account to the configured identity provider.
18+
* You created a network policy.
19+
20+
.Procedure
21+
22+
. From the *Administrator* perspective in the {cluster-manager} web console, under *Networking*, click *NetworkPolicies*.
23+
. Select the desired network policy to view.
24+
. In the *Network Policy* details page, you can view all of the associated ingress and egress rules.
25+
. Select *YAML* on the network policy details to view the policy configuration in YAML format.
26+
ifdef::openshift-rosa,openshift-dedicated[]
27+
+
28+
[NOTE]
29+
====
30+
You can only view the details of these policies. You cannot edit these policies.
31+
====
32+
endif::[]

networking/multiple_networks/configuring-multi-network-policy.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ As a cluster administrator, you can create, edit, view, and delete multi-network
2727

2828
* You have enabled multi-network policy support for your cluster.
2929

30-
include::modules/nw-networkpolicy-create.adoc[leveloffset=+2]
30+
include::modules/nw-networkpolicy-create-cli.adoc[leveloffset=+2]
3131
include::modules/nw-networkpolicy-edit.adoc[leveloffset=+2]
32-
include::modules/nw-networkpolicy-view.adoc[leveloffset=+2]
33-
include::modules/nw-networkpolicy-delete.adoc[leveloffset=+2]
32+
include::modules/nw-networkpolicy-view-cli.adoc[leveloffset=+2]
33+
include::modules/nw-networkpolicy-delete-cli.adoc[leveloffset=+2]
3434

3535
[id="{context}_additional-resources"]
3636
[role="_additional-resources"]

0 commit comments

Comments
 (0)