2023-04-06 23:53:18 +00:00
|
|
|
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"
|
|
|
|
|
2023-04-10 04:15:18 +00:00
|
|
|
- namespaceSelector:
|
|
|
|
matchLabels:
|
|
|
|
needsDownload: "yes"
|
|
|
|
|
2023-04-06 23:53:18 +00:00
|
|
|
# Allow all pods with this label
|
|
|
|
- podSelector:
|
|
|
|
matchLabels:
|
|
|
|
needsDownload: "yes"
|