73 lines
1.8 KiB
YAML
73 lines
1.8 KiB
YAML
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: postgres
|
|
namespace: postgres
|
|
spec:
|
|
egress:
|
|
- ports:
|
|
- port: 53
|
|
protocol: UDP
|
|
- port: 53
|
|
protocol: TCP
|
|
to:
|
|
- namespaceSelector:
|
|
matchLabels:
|
|
kubernetes.io/metadata.name: kube-system
|
|
podSelector:
|
|
matchLabels:
|
|
k8s-app: kube-dns
|
|
- ports:
|
|
- port: 6443
|
|
protocol: TCP
|
|
- to:
|
|
- podSelector:
|
|
matchLabels:
|
|
cnpg.io/cluster: postgres
|
|
ingress:
|
|
- from:
|
|
- podSelector:
|
|
matchLabels:
|
|
cnpg.io/cluster: postgres
|
|
- from:
|
|
- namespaceSelector:
|
|
matchLabels:
|
|
kubernetes.io/metadata.name: cnpg-system
|
|
podSelector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: cloudnative-pg
|
|
ports:
|
|
- port: 8000
|
|
protocol: TCP
|
|
- from:
|
|
- namespaceSelector:
|
|
matchLabels:
|
|
kubernetes.io/metadata.name: authentik
|
|
podSelector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: authentik
|
|
- namespaceSelector:
|
|
matchLabels:
|
|
kubernetes.io/metadata.name: monitoring
|
|
podSelector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: grafana
|
|
- namespaceSelector:
|
|
matchLabels:
|
|
kubernetes.io/metadata.name: pgweb
|
|
podSelector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: pgweb
|
|
- namespaceSelector:
|
|
matchLabels:
|
|
kubernetes.io/metadata.name: redoost
|
|
ports:
|
|
- port: 5432
|
|
protocol: TCP
|
|
podSelector:
|
|
matchLabels:
|
|
cnpg.io/cluster: postgres
|
|
policyTypes:
|
|
- Ingress
|
|
- Egress
|