Files
gitops/apps/wireguard/networkpolicy.yaml
T
whyredfire d55d711463 fix(wireguard): Allow egress to Traefik pod ports
Traffic to the 192.168.2.5 external IP is DNATed to the Traefik pod
before NetworkPolicy is evaluated, so the 10.0.0.0/8 exclusion blocked
VPN clients from reaching services behind the gateway.
2026-10-28 21:43:36 +05:30

61 lines
1.3 KiB
YAML

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
- ports:
- port: 8000
protocol: TCP
- port: 8443
protocol: TCP
to:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: traefik
podSelector:
matchLabels:
app.kubernetes.io/name: traefik
- 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