You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: calico/network-policy/policy-tiers/tiered-policy.mdx
+46-2Lines changed: 46 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,30 @@ The default tier is where:
54
54
## kube-admin tier:
55
55
56
56
The `Tier` with name `kube-admin` is where all [Kubernetes ClusterNetworkPolicy](https://network-policy-api.sigs.k8s.io/reference/examples/) resources with Admin Tier reside.
57
-
It is automatically created during installation and has the order of 1,000 and a default action of `Pass`. This is fixed, and should not be changed.
57
+
It is automatically created at startup and has the order of 1,000 and a default action of `Pass`. This is fixed, and cannot be changed.
58
+
59
+
```yaml
60
+
apiVersion: policy.networking.k8s.io/v1alpha2
61
+
kind: ClusterNetworkPolicy
62
+
metadata:
63
+
name: accept-default
64
+
spec:
65
+
tier: Admin
66
+
priority: 100
67
+
subject:
68
+
namespaces:
69
+
matchLabels:
70
+
kubernetes.io/metadata.name: default
71
+
ingress:
72
+
- name: accept-default-ingress
73
+
action: "Accept"
74
+
from:
75
+
- namespaces:
76
+
matchLabels:
77
+
kubernetes.io/metadata.name: default
78
+
```
79
+
80
+
$[prodname] places the above resource in `kube-admin` tier.
58
81
59
82
In addition to `ClusterNetworkPolicy` resources, you can also add $[prodname] `NetworkPolicy`/`GlobalNetworkPolicy` resources
60
83
to the kube-admin `Tier`. The `ClusterNetworkPolicy` `priority` field maps to the `order` field in the $[prodname]
@@ -63,7 +86,28 @@ to the kube-admin `Tier`. The `ClusterNetworkPolicy` `priority` field maps to th
63
86
## kube-baseline tier:
64
87
65
88
The `Tier` with name `kube-baseline` is where all [Kubernetes ClusterNetworkPolicy](https://network-policy-api.sigs.k8s.io/reference/examples/) resources with Baseline tier reside.
66
-
It is automatically created during installation and has the order of 10,000,000 and a default action of `Pass`. This is fixed, and should not be changed.
89
+
It is automatically created during startup and has the order of 10,000,000 and a default action of `Pass`. This is fixed, and cannot be changed.
90
+
91
+
```yaml
92
+
apiVersion: policy.networking.k8s.io/v1alpha2
93
+
kind: ClusterNetworkPolicy
94
+
metadata:
95
+
name: deny-all
96
+
spec:
97
+
tier: Baseline
98
+
priority: 1
99
+
subject:
100
+
namespaces:
101
+
matchLabels: {}
102
+
ingress:
103
+
- name: deny-all-ingress
104
+
action: "Deny"
105
+
from:
106
+
- namespaces:
107
+
matchLabels: {}
108
+
```
109
+
110
+
$[prodname] places the above resource in `kube-baseline` tier.
67
111
68
112
In addition to the `ClusterNetworkPolicy` resource, you can also add $[prodname] `NetworkPolicy`/`GlobalNetworkPolicy` resources
69
113
to the kube-baseline `Tier`. The `ClusterNetworkPolicy` `priority` field maps to the `order` field in the $[prodname]
0 commit comments