2023-04-04 06:01:25 +00:00
|
|
|
apiVersion: networking.k8s.io/v1
|
|
|
|
kind: NetworkPolicy
|
|
|
|
metadata:
|
|
|
|
name: deny-most-allow-some
|
|
|
|
namespace: media
|
|
|
|
spec:
|
|
|
|
# Apply to all pods in this namespace
|
2023-04-04 06:03:23 +00:00
|
|
|
podSelector: {}
|
2023-04-04 06:01:25 +00:00
|
|
|
ingress:
|
|
|
|
- from:
|
|
|
|
# Allow all pods in this namespace
|
2023-04-04 06:31:40 +00:00
|
|
|
- namespaceSelector:
|
|
|
|
matchLabels:
|
|
|
|
name: "media"
|
|
|
|
# - podSelector: {}
|
2023-04-04 06:01:25 +00:00
|
|
|
|
|
|
|
# Allow all pods with this label
|
2023-04-04 06:31:40 +00:00
|
|
|
- podSelector:
|
|
|
|
matchLabels:
|
|
|
|
needsMedia: "yes"
|