k3s-cluster/cluster/apps/game-servers/network_policy.yaml

38 lines
781 B
YAML
Raw Normal View History

2023-04-19 23:37:53 +00:00
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: deny-most-allow-some
namespace: game-servers
spec:
# Apply to all pods in this namespace
podSelector: {}
ingress:
- from:
# Allow all pods in this namespace
- namespaceSelector:
matchLabels:
name: "game-servers"
# Allow traefik pods
- namespaceSelector:
matchLabels:
name: "traefik"
# Allow all pods with this label
- podSelector:
matchLabels:
2024-01-27 04:49:45 +00:00
needsGameServers: "yes"
egress:
- to:
- ipBlock:
cidr: 192.168.87.0/24 # server lan
ports:
# palworld
- protocol: UDP
port: 8211
- protocol: UDP
port: 38211
- protocol: UDP
port: 25575
- protocol: UDP
port: 32575