Skip to content

Commit c05ab6d

Browse files
authored
Merge pull request #72976 from stevsmit/OCPBUGS-29069-nic-update
Updates deny by default policy in ocp docs
2 parents 5900648 + dac2447 commit c05ab6d

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

modules/nw-networkpolicy-create-cli.adoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,12 @@ metadata:
7171
name: deny-by-default
7272
ifdef::multi[]
7373
annotations:
74-
k8s.v1.cni.cncf.io/policy-for: <network_name>
74+
k8s.v1.cni.cncf.io/policy-for:<namespace_name>/<network_name>
7575
endif::multi[]
7676
spec:
77-
podSelector:
77+
podSelector: {}
78+
policyTypes:
79+
- Ingress
7880
ingress: []
7981
----
8082
+

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@ metadata:
4848
name: deny-by-default
4949
namespace: default <1>
5050
annotations:
51-
k8s.v1.cni.cncf.io/policy-for: <network_name> <2>
51+
k8s.v1.cni.cncf.io/policy-for: <namespace_name>/<network_name> <2>
5252
spec:
5353
podSelector: {} <3>
54-
ingress: [] <4>
54+
policyTypes: <4>
55+
- Ingress <5>
56+
ingress: [] <6>
5557
endif::multi[]
5658
ifndef::multi[]
5759
kind: NetworkPolicy
@@ -68,7 +70,9 @@ ifdef::multi[]
6870
<1> `namespace: default` deploys this policy to the `default` namespace.
6971
<2> `network_name`: specifies the name of a network attachment definition.
7072
<3> `podSelector:` is empty, this means it matches all the pods. Therefore, the policy applies to all pods in the default namespace.
71-
<4> There are no `ingress` rules specified. This causes incoming traffic to be dropped to all pods.
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.
7276
endif::multi[]
7377
ifndef::multi[]
7478
<1> `namespace: default` deploys this policy to the `default` namespace.

0 commit comments

Comments
 (0)