DevOps/Kubernetes/network-policy-definition-allowed-from-all-namespaces.yml

19 lines
302 B
YAML

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: db-policy
spec:
podSelector:
matchLabels:
role: db
policyTypes:
- Ingress
ingress:
- from:
- podSelector:
matchLabels:
name: api-pod
ports: - podSelector
- protocol: TCP
port: 3306