apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: access-mongo-comment
  namespace: default
spec:
  podSelector:
    matchLabels:
      component: mongo
  policyTypes:
  - Ingress
  ingress:
  - from:
    - podSelector:
        matchLabels:
          component: comment
    - podSelector:
        matchLabels:
          component: post



