Skip to content

Commit 55d1059

Browse files
authored
Merge pull request #89209 from JoeAldinger/OCPBUGS-42758
OCPBUGS-42758:updates NetworkPolicy warning
2 parents 2b9ba03 + bd6001f commit 55d1059

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

modules/nw-networkpolicy-deny-all-allowed.adoc

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@ endif::[]
1616
[id="nw-networkpolicy-deny-all-multi-network-policy_{context}"]
1717
= Creating a default deny all {name} policy
1818

19-
This is a fundamental policy, blocking all cross-pod networking other than network traffic allowed by the configuration of other deployed network policies. This procedure enforces a default `deny-by-default` policy.
19+
This policy blocks all cross-pod networking other than network traffic allowed by the configuration of other deployed network policies and traffic between host-networked pods. This procedure enforces a strong deny policy by applying a `deny-by-default` policy in the `my-project` namespace.
2020

21-
ifndef::microshift[]
22-
[NOTE]
21+
[WARNING]
2322
====
24-
If you log in with a user with the `cluster-admin` role, then you can create a network policy in any namespace in the cluster.
23+
Without configuring a `NetworkPolicy` custom resource (CR) that allows traffic communication, the following policy might cause communication problems across your cluster.
2524
====
26-
endif::microshift[]
2725

2826
.Prerequisites
2927
ifndef::microshift[]
@@ -46,7 +44,7 @@ apiVersion: k8s.cni.cncf.io/v1beta1
4644
kind: MultiNetworkPolicy
4745
metadata:
4846
name: deny-by-default
49-
namespace: default <1>
47+
namespace: my-project <1>
5048
annotations:
5149
k8s.v1.cni.cncf.io/policy-for: <namespace_name>/<network_name> <2>
5250
spec:
@@ -60,23 +58,23 @@ kind: NetworkPolicy
6058
apiVersion: networking.k8s.io/v1
6159
metadata:
6260
name: deny-by-default
63-
namespace: default <1>
61+
namespace: my-project <1>
6462
spec:
6563
podSelector: {} <2>
6664
ingress: [] <3>
6765
endif::multi[]
6866
----
6967
ifdef::multi[]
70-
<1> `namespace: default` deploys this policy to the `default` namespace.
71-
<2> `network_name`: specifies the name of a network attachment definition.
72-
<3> `podSelector:` is empty, this means it matches all the pods. Therefore, the policy applies to all pods in the default namespace.
73-
<4> `policyTypes:` a list of rule types that the `NetworkPolicy` relates to.
74-
<5> Specifies as `Ingress` only `policyType`.
75-
<6> There are no `ingress` rules specified. This causes incoming traffic to be dropped to all pods.
68+
<1> Specifies the namespace in which to deploy the policy. For example, the `my-project` namespace.
69+
<2> Specifies the name of a network attachment definition.
70+
<3> If this field is empty, the configuration matches all the pods. Therefore, the policy applies to all pods in the `my-project` namespace.
71+
<4> Specifies a list of rule types that the `NetworkPolicy` relates to.
72+
<5> Specifies `Ingress` only `policyTypes`.
73+
<6> Specifies `ingress` rules. If not specified, all incoming traffic is dropped to all pods.
7674
endif::multi[]
7775
ifndef::multi[]
78-
<1> `namespace: default` deploys this policy to the `default` namespace.
79-
<2> `podSelector:` is empty, this means it matches all the pods. Therefore, the policy applies to all pods in the default namespace.
76+
<1> `Specifies the namespace in which to deploy the policy. For example, the `my-project` namespace.
77+
<2> If this field is empty, the configuration matches all the pods. Therefore, the policy applies to all pods in the `my-project` namespace.
8078
<3> There are no `ingress` rules specified. This causes incoming traffic to be dropped to all pods.
8179
endif::multi[]
8280
+

0 commit comments

Comments
 (0)