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

29 lines
618 B
YAML
Raw Normal View History

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