-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path50-netpolicy04.yaml
More file actions
48 lines (48 loc) · 845 Bytes
/
Copy path50-netpolicy04.yaml
File metadata and controls
48 lines (48 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Team-A egress policy
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: team-a-egress
namespace: team-a
spec:
podSelector:
matchLabels:
app: ta
policyTypes:
- Egress
egress:
- to:
- namespaceSelector:
matchLabels:
app: team-b
podSelector:
matchLabels:
app: tb
- to:
# - namespaceSelector:
# matchLabels:
# name: kube-system
ports:
- protocol: UDP
port: 53
---
# Team-B ingress policy
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: team-b-ingress
namespace: team-b
spec:
podSelector:
matchLabels:
app: tb
policyTypes:
- Ingress
ingress:
- from:
- namespaceSelector:
matchLabels:
app: team-a
podSelector:
matchLabels:
app: ta