Skip to content

Commit d851316

Browse files
mazdaknctauchen
authored andcommitted
Update cluster network policy docs
1 parent 303c9fb commit d851316

1 file changed

Lines changed: 46 additions & 2 deletions

File tree

calico/network-policy/policy-tiers/tiered-policy.mdx

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,30 @@ The default tier is where:
5454
## kube-admin tier:
5555

5656
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.
5881

5982
In addition to `ClusterNetworkPolicy` resources, you can also add $[prodname] `NetworkPolicy`/`GlobalNetworkPolicy` resources
6083
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
6386
## kube-baseline tier:
6487

6588
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.
67111

68112
In addition to the `ClusterNetworkPolicy` resource, you can also add $[prodname] `NetworkPolicy`/`GlobalNetworkPolicy` resources
69113
to the kube-baseline `Tier`. The `ClusterNetworkPolicy` `priority` field maps to the `order` field in the $[prodname]

0 commit comments

Comments
 (0)