kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
  name: ingress-allow-nosqlclient-to-access-mongo
  namespace: production
spec:
  podSelector:
    matchLabels:
      app.kubernetes.io/name: mongodb
  ingress:
    - ports:
        # Refer to the ports.containerPort.name field in mongo pod
        - port: mongodb
      from:
        - podSelector:
            matchLabels:
              run: nosqlclient
