-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathmaddy.yaml
75 lines (73 loc) · 1.38 KB
/
maddy.yaml
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
apiVersion: v1
kind: Namespace
metadata:
name: maddy
---
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: default-ingress
namespace: maddy
spec:
podSelector: {}
ingress:
- from:
# Allow ingress from nginx
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: nginx
- from:
# Allow local ingress to PostgreSQL
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: maddy
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: postgres
ports:
- protocol: TCP
port: 5432
endPort: 5432
- protocol: TCP
port: 8008 #Patroni
endPort: 8008
- from:
# Allow Internet access to mail server
- ipBlock:
cidr: 0.0.0.0/0
ports:
- protocol: TCP
port: 25
endPort: 25
- protocol: TCP
port: 2525
endPort: 2525
- protocol: TCP
port: 143
endPort: 143
- protocol: TCP
port: 993
endPort: 993
- protocol: TCP
port: 587
endPort: 587
- protocol: TCP
port: 465
endPort: 465
policyTypes:
- Ingress
---
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: default-egress
namespace: maddy
spec:
podSelector: {}
egress:
- to:
# allow outbound email
- ipBlock:
cidr: "0.0.0.0/0"
policyTypes:
- Egress