kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
  name: inventoryapi-policy
spec:
  podSelector:
    matchLabels:
      app.kubernetes.io/role: backendapi
      app.kubernetes.io/name: bookstore-inventory-api
  ingress:
    - from:
        - podSelector:
            matchLabels:
              app.kubernetes.io/role: backendapi
              app.kubernetes.io/name: bookstore-resource-api
      ports:
        - protocol: TCP
          port: 5000