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

25 lines
531 B
YAML
Raw Normal View History

2023-04-11 00:44:45 -04:00
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: deny-most-allow-some
namespace: tools
2023-04-11 00:44:45 -04:00
spec:
# Apply to all pods in this namespace
podSelector: {}
ingress:
- from:
# Allow all pods in this namespace
- namespaceSelector:
matchLabels:
2023-04-12 01:39:31 -04:00
name: "tools"
# - podSelector: {}
2023-04-11 00:44:45 -04:00
# Allow traefik pods
- namespaceSelector:
matchLabels:
name: "traefik"
# Allow all pods with this label
- podSelector:
matchLabels:
needsTools: "yes"