apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: allowed-to-access-db
spec:
  podSelector:
    matchLabels:
      tier: "db"
  policyTypes:
    - Ingress
  ingress:
  - from:
    - podSelector:
        matchLabels:
          networking/allow-db-access: "true"
