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

30 lines
675 B
YAML
Raw Normal View History

2023-04-06 23:01:51 -04:00
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"
# Allow all pods with this label
- podSelector:
matchLabels:
needsAuthentik: "yes"