k3s-cluster/cluster/apps/irc/network_policy.yaml
2023-04-13 13:12:47 -04:00

25 lines
No EOL
525 B
YAML

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: deny-most-allow-some
namespace: irc
spec:
# Apply to all pods in this namespace
podSelector: {}
ingress:
- from:
# Allow all pods in this namespace
- namespaceSelector:
matchLabels:
name: "irc"
# - podSelector: {}
# Allow traefik pods
- namespaceSelector:
matchLabels:
name: "traefik"
# Allow all pods with this label
- podSelector:
matchLabels:
needsIRC: "yes"