JG-mirror/Kubernetes/NetworkPolicies/namespace-example.yaml
2024-01-16 12:55:53 +00:00

17 lines
No EOL
328 B
YAML

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: egress-namespaces
spec:
podSelector:
matchLabels:
app: myapp
policyTypes:
- Egress
egress:
- to:
- namespaceSelector:
matchExpressions:
- key: namespace
operator: In
values: ["frontend", "backend"]