apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: ml-pipeline-ui
  namespace: kubeflow
spec:
  hosts:
    - {{< .Values.deploykf_core.deploykf_istio_gateway.gateway.hostname | quote >}}
  gateways:
    - {{< .Values.deploykf_core.deploykf_istio_gateway.namespace >}}/{{< .Values.deploykf_core.deploykf_istio_gateway.gateway.name >}}
  http:
    ## this route is used in `EnvoyFilter/kubeflow-pipelines--redirect-artifact-namespaces` to redirect
    ## artifact requests which use the wrong `?namespace=` query parameter
    - name: ml-pipeline-ui-artifacts-route
      match:
        - uri:
            prefix: /pipeline/artifacts/
      route:
        - destination:
            host: ml-pipeline-ui.kubeflow.svc.cluster.local
            port:
              number: 80
    ## this route is used in `EnvoyFilter/deploykf-istio-gateway--ext-authz` to allow JWT tokens to alternatively
    ## have the "kubeflow-pipelines-sdk" audience, used by "browser login flow" tokens
    - name: ml-pipeline-ui-route
      match:
        - uri:
            prefix: /pipeline
      route:
        - destination:
            host: ml-pipeline-ui.kubeflow.svc.cluster.local
            port:
              number: 80
      timeout: 300s