apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: db-policy
  labels:
    day: day3
    sample: dbapp
spec:
  policyTypes:
    - Ingress
  podSelector:
    matchLabels:
      day: day3
      sample: dbapp
      layer: backend
  ingress:
    - from:
       - podSelector:
           matchLabels:
             layer: frontend