apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: model-registry
  namespace: kubeflow
spec:
  podSelector:
    matchExpressions:
      - key: component
        operator: In
        values:
          - model-registry-server
  ingress:
    - from:
        - namespaceSelector:
            matchExpressions:
              - key: app.kubernetes.io/part-of
                operator: In
                values:
                  - kubeflow-profile
        - namespaceSelector:
            matchExpressions:
              - key: kubernetes.io/metadata.name
                operator: In
                values:
                  - istio-system
      ports:
        - protocol: TCP
          port: 8080
        - protocol: TCP
          port: 9090
  policyTypes:
    - Ingress
