chore(apps): Add network policies to standalone apps

This commit is contained in:
2026-10-28 15:12:22 +05:30
parent 6e1f53ed3f
commit 7467e34b4c
11 changed files with 185 additions and 0 deletions
+1
View File
@@ -4,3 +4,4 @@ resources:
- deployment.yaml - deployment.yaml
- service.yaml - service.yaml
- httproute.yaml - httproute.yaml
- networkpolicy.yaml
+21
View File
@@ -0,0 +1,21 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: bentopdf
namespace: bentopdf
spec:
egress: []
ingress:
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: traefik
ports:
- port: 8080
protocol: TCP
podSelector:
matchLabels:
app.kubernetes.io/name: bentopdf
policyTypes:
- Ingress
- Egress
+1
View File
@@ -4,3 +4,4 @@ resources:
- sealed-secret.yaml - sealed-secret.yaml
- middleware.yaml - middleware.yaml
- httproute.yaml - httproute.yaml
- networkpolicy.yaml
+40
View File
@@ -0,0 +1,40 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: garage-ui
namespace: garage
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: 3903
protocol: TCP
to:
- podSelector:
matchLabels:
app.kubernetes.io/name: garage
ingress:
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: traefik
ports:
- port: 8080
protocol: TCP
podSelector:
matchLabels:
app.kubernetes.io/name: garage-ui
policyTypes:
- Ingress
- Egress
+1
View File
@@ -7,3 +7,4 @@ resources:
- service.yaml - service.yaml
- middleware.yaml - middleware.yaml
- httproute.yaml - httproute.yaml
- networkpolicy.yaml
+28
View File
@@ -0,0 +1,28 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: qbittorrent
namespace: qbit
spec:
egress:
- to:
- ipBlock:
cidr: 0.0.0.0/0
except:
- 10.0.0.0/8
- 172.16.0.0/12
- 192.168.0.0/16
ingress:
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: traefik
ports:
- port: 8080
protocol: TCP
podSelector:
matchLabels:
app.kubernetes.io/name: qbittorrent
policyTypes:
- Ingress
- Egress
+1
View File
@@ -5,3 +5,4 @@ resources:
- deployment.yaml - deployment.yaml
- service.yaml - service.yaml
- httproute.yaml - httproute.yaml
- networkpolicy.yaml
+21
View File
@@ -0,0 +1,21 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: rustbin
namespace: rustbin
spec:
egress: []
ingress:
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: traefik
ports:
- port: 3000
protocol: TCP
podSelector:
matchLabels:
app.kubernetes.io/name: rustbin
policyTypes:
- Ingress
- Egress
+1
View File
@@ -7,3 +7,4 @@ resources:
- service.yaml - service.yaml
- service-admin.yaml - service-admin.yaml
- httproute.yaml - httproute.yaml
- networkpolicy.yaml
+48
View File
@@ -0,0 +1,48 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: wireguard
namespace: wireguard
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
- to:
- ipBlock:
cidr: 192.168.2.0/24
- ipBlock:
cidr: 0.0.0.0/0
except:
- 10.0.0.0/8
- 172.16.0.0/12
- 192.168.0.0/16
ingress:
- from:
- ipBlock:
cidr: 0.0.0.0/0
ports:
- port: 27299
protocol: UDP
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: traefik
ports:
- port: 51821
protocol: TCP
podSelector:
matchLabels:
app.kubernetes.io/name: wireguard
policyTypes:
- Ingress
- Egress
+22
View File
@@ -30,6 +30,28 @@ spec:
enabled: true enabled: true
type: hostPath type: hostPath
hostPath: /srv/media hostPath: /srv/media
# Metadata, artwork, and subtitles come from the internet; the
# cluster and the LAN stay off limits
networkPolicy:
enabled: true
ingress:
allowExternal: false
namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: traefik
egress:
allowAllEgress: false
restrictedEgress:
allowMetadata: false
allowInCluster: false
customRules:
- to:
- ipBlock:
cidr: 0.0.0.0/0
except:
- 10.0.0.0/8
- 172.16.0.0/12
- 192.168.0.0/16
resources: resources:
limits: limits:
cpu: 3000m cpu: 3000m