kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
  name: access-db
spec:
  podSelector:
    matchLabels:
      app: db
  ingress:
  - from:
    - namespaceSelector:
        matchLabels:
          name: prod
    - podSelector:
        matchLabels:
          db: "true"