|
| 1 | +// Module included in the following assemblies: |
| 2 | + |
| 3 | +// * networking/network_observability/network-observability-network-policy.adoc |
| 4 | + |
| 5 | + |
| 6 | +:_content-type: PROCEDURE |
| 7 | +[id="network-observability-network-policy_{context}"] |
| 8 | += Creating a network policy for Network Observability |
| 9 | +You might need to create a network policy to secure ingress traffic to the `netobserv` namespace. In the web console, you can create a network policy using the form view. |
| 10 | + |
| 11 | +.Procedure |
| 12 | +. Navigate to *Networking* -> *NetworkPolicies*. |
| 13 | +. Select the `netobserv` project from the *Project* dropdown menu. |
| 14 | +. Name the policy. For this example, the policy name is `allow-ingress`. |
| 15 | +. Click *Add ingress rule* three times to create three ingress rules. |
| 16 | +. Specify the following in the form: |
| 17 | +.. Make the following specifications for the first *Ingress rule*: |
| 18 | +... From the *Add allowed source* dropdown menu, select *Allow pods from the same namespace*. |
| 19 | +.. Make the following specifications for the second *Ingress rule*: |
| 20 | +... From the *Add allowed source* dropdown menu, select *Allow pods from inside the cluster*. |
| 21 | +... Click *+ Add namespace selector*. |
| 22 | +... Add the label, `kubernetes.io/metadata.name`, and the selector, `openshift-console`. |
| 23 | +.. Make the following specifications for the third *Ingress rule*: |
| 24 | +... From the *Add allowed source* dropdown menu, select *Allow pods from inside the cluster*. |
| 25 | +... Click *+ Add namespace selector*. |
| 26 | +... Add the label, `kubernetes.io/metadata.name`, and the selector, `openshift-monitoring`. |
| 27 | + |
| 28 | +.Verification |
| 29 | +. Navigate to *Observe* -> *Network Traffic*. |
| 30 | +. View the *Traffic Flows* tab, or any tab, to verify that the data is displayed. |
| 31 | +. Navigate to *Observe* -> *Dashboards*. In the NetObserv/Health selection, verify that the flows are being ingested and sent to Loki, which is represented in the first graph. |
0 commit comments