k3s-cluster/cluster/apps/authentik/network_policy.yaml

34 lines
746 B
YAML

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: deny-most-allow-some
namespace: authentik
spec:
# Apply to all pods in this namespace
podSelector: {}
ingress:
- from:
# Allow all pods in this namespace
- namespaceSelector:
matchLabels:
name: "authentik"
# - podSelector: {}
# Allow traefik pods
- namespaceSelector:
matchLabels:
name: "traefik"
# Not sure if this is required, but just to make sure
- namespaceSelector:
matchLabels:
name: "database"
- namespaceSelector:
matchLabels:
name: "media"
# Allow all pods with this label
- podSelector:
matchLabels:
needsAuthentik: "yes"