Skip to content

Commit 0e1ed34

Browse files
authored
Merge pull request #77716 from tssurya/anp-fix-yamls
Fix AdminNetworkPolicy yamls
2 parents a1c285a + d2cc1d3 commit 0e1ed34

File tree

3 files changed

+21
-28
lines changed

3 files changed

+21
-28
lines changed

modules/nw-ovn-k-adminnetwork-policy-action-rules.adoc

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,8 @@ spec:
3131
action: "Allow"
3232
from:
3333
- namespaces:
34-
namespaceSelector:
35-
matchLabels:
36-
kubernetes.io/metadata.name: monitoring
34+
matchLabels:
35+
kubernetes.io/metadata.name: monitoring
3736
# ...
3837
----
3938
====
@@ -64,9 +63,8 @@ spec:
6463
action: "Deny"
6564
from:
6665
- namespaces:
67-
namespaceSelector:
68-
matchLabels:
69-
kubernetes.io/metadata.name: monitoring
66+
matchLabels:
67+
kubernetes.io/metadata.name: monitoring
7068
# ...
7169
----
7270
====
@@ -99,9 +97,8 @@ spec:
9997
action: "Pass"
10098
from:
10199
- namespaces:
102-
namespaceSelector:
103-
matchLabels:
104-
kubernetes.io/metadata.name: monitoring
100+
matchLabels:
101+
kubernetes.io/metadata.name: monitoring
105102
# ...
106103
----
107104
====

modules/nw-ovn-k-adminnetwork-policy.adoc

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ An ANP allows administrators to specify the following:
1414

1515
* A `priority` value that determines the order of its evaluation. The lower the value the higher the precedence.
1616
17-
* A set of pods that consists of a set of namespaces or namespace.
17+
* A set of pods that consists of a set of namespaces or namespace on which the policy is applied.
1818
1919
* A list of ingress rules to be applied for all ingress traffic towards the `subject`.
2020
@@ -45,8 +45,8 @@ spec:
4545
from:
4646
- pods:
4747
namespaceSelector:
48-
matchLabels:
49-
custom-anp: tenant-1
48+
matchLabels:
49+
custom-anp: tenant-1
5050
podSelector:
5151
matchLabels:
5252
custom-anp: tenant-1 <6>
@@ -55,10 +55,9 @@ spec:
5555
action: "Pass"
5656
to:
5757
- pods:
58-
namespaces:
59-
namespaceSelector:
60-
matchLabels:
61-
custom-anp: tenant-1
58+
namespaceSelector:
59+
matchLabels:
60+
custom-anp: tenant-1
6261
podSelector:
6362
matchLabels:
6463
custom-anp: tenant-1
@@ -68,6 +67,6 @@ spec:
6867
<3> Specify the namespace to apply the ANP resource.
6968
<4> ANP have both ingress and egress rules. ANP rules for `spec.ingress` field accepts values of `Pass`, `Deny`, and `Allow` for the `action` field.
7069
<5> Specify a name for the `ingress.name`.
71-
<6> Specify `podSelector.matchLabels` name of the pods to apply the ANP resource.
70+
<6> Specify `podSelector.matchLabels` to select pods within the namespaces selected by `namespaceSelector.matchLabels` as ingress peers.
7271
<7> ANPs have both ingress and egress rules. ANP rules for `spec.egress` field accepts values of `Pass`, `Deny`, and `Allow` for the `action` field.
7372
====

modules/nw-ovn-k-baseline-adminnetwork-policy.adoc

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,9 @@ spec:
4242
action: "Deny"
4343
from:
4444
- pods:
45-
namespaces:
46-
namespaceSelector:
47-
matchLabels:
48-
custom-banp: tenant-1 <5>
45+
namespaceSelector:
46+
matchLabels:
47+
custom-banp: tenant-1 <5>
4948
podSelector:
5049
matchLabels:
5150
custom-banp: tenant-1 <6>
@@ -54,10 +53,9 @@ spec:
5453
action: "Allow"
5554
to:
5655
- pods:
57-
namespaces:
58-
namespaceSelector:
59-
matchLabels:
60-
custom-banp: tenant-1
56+
namespaceSelector:
57+
matchLabels:
58+
custom-banp: tenant-1
6159
podSelector:
6260
matchLabels:
6361
custom-banp: tenant-1
@@ -95,9 +93,8 @@ spec:
9593
action: "Deny"
9694
from:
9795
- namespaces:
98-
namespaceSelector:
99-
matchLabels:
100-
kubernetes.io/metadata.name: monitoring
96+
matchLabels:
97+
kubernetes.io/metadata.name: monitoring
10198
# ...
10299
----
103100
====

0 commit comments

Comments
 (0)