45 lines
1.0 KiB
YAML
45 lines
1.0 KiB
YAML
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: pgweb
|
|
namespace: pgweb
|
|
spec:
|
|
# Only traefik may reach pgweb, so authentik can't be bypassed.
|
|
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: 5432
|
|
protocol: TCP
|
|
to:
|
|
- namespaceSelector:
|
|
matchLabels:
|
|
kubernetes.io/metadata.name: postgres
|
|
podSelector:
|
|
matchLabels:
|
|
cnpg.io/cluster: postgres
|
|
ingress:
|
|
- from:
|
|
- namespaceSelector:
|
|
matchLabels:
|
|
kubernetes.io/metadata.name: traefik
|
|
ports:
|
|
- port: 8081
|
|
protocol: TCP
|
|
podSelector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: pgweb
|
|
policyTypes:
|
|
- Ingress
|
|
- Egress
|