apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: metadata-grpc-server
  namespace: kubeflow
spec:
  podSelector:
    matchExpressions:
      - key: component
        operator: In
        values:
          - metadata-grpc-server # metadata server
  ingress:
    - from:
        - namespaceSelector:
            matchExpressions:
              - key: app.kubernetes.io/part-of
                operator: In
                values:
                  - kubeflow-profile
        - podSelector: {} # allow all pods from the same namespace
  policyTypes:
    - Ingress
