apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: allow-sentences-to-name
spec:
  podSelector:
    matchLabels:
      app: sentences
      mode: name
  policyTypes:
  - Ingress
  ingress:
  - from:
    - podSelector:
        matchLabels:
          app: sentences
          mode: sentence
    ports:
    - port: 5000
      protocol: TCP
