74 lines
1.5 KiB
YAML
74 lines
1.5 KiB
YAML
# Default deny all ingress in the jellyfin namespace
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: default-deny-ingress
|
|
namespace: jellyfin
|
|
spec:
|
|
podSelector: {}
|
|
policyTypes:
|
|
- Ingress
|
|
---
|
|
# Allow Traefik ingress controller to reach Jellyfin
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: allow-ingress-controller
|
|
namespace: jellyfin
|
|
spec:
|
|
podSelector:
|
|
matchLabels:
|
|
app: jellyfin
|
|
policyTypes:
|
|
- Ingress
|
|
ingress:
|
|
- from:
|
|
- namespaceSelector:
|
|
matchLabels:
|
|
kubernetes.io/metadata.name: traefik
|
|
---
|
|
# Allow UDP discovery and DLNA from local network
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: allow-udp-discovery
|
|
namespace: jellyfin
|
|
spec:
|
|
podSelector:
|
|
matchLabels:
|
|
app: jellyfin
|
|
policyTypes:
|
|
- Ingress
|
|
ingress:
|
|
- ports:
|
|
- port: 7359
|
|
protocol: UDP
|
|
- port: 1900
|
|
protocol: UDP
|
|
---
|
|
# Backup jobs need DNS, the Synology rest-server (8888) and B2 over HTTPS.
|
|
# Declaring egress here also confines the backup pods to exactly those.
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: NetworkPolicy
|
|
metadata:
|
|
name: allow-backup-egress
|
|
namespace: jellyfin
|
|
spec:
|
|
podSelector:
|
|
matchLabels:
|
|
app: jellyfin-backup
|
|
policyTypes:
|
|
- Egress
|
|
egress:
|
|
- ports:
|
|
- port: 53
|
|
protocol: UDP
|
|
- port: 53
|
|
protocol: TCP
|
|
- ports:
|
|
- port: 8888
|
|
protocol: TCP
|
|
- ports:
|
|
- port: 443
|
|
protocol: TCP
|