404 Not Found when using istio virtual service and appgateway

82 Views Asked by At

I'm working on an app and using istio virtual service and gateway for URL but getting 404 error. Below is my Virtual services and appgateway file.

# Source: superset/templates/app_gateway.yaml

apiVersion: networking.istio.io/v1beta1

kind: Gateway

metadata:

  name: superset

  namespace: superset

  labels:

    app: superset
spec:
  selector:
    istio: ingressgateway
  servers:
    
    - port:
        number: 443
        name: https
        protocol: HTTP
      hosts:
        - "*.ap-southeast-1.elb.amazonaws.com"
        - "superset.dev"
---
# Source: superset/templates/virtualservice.yaml
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: superset
  namespace: superset
  labels:
    app: superset
spec:
  hosts:
    - "*.ap-southeast-1.elb.amazonaws.com"
    - "superset.dev"
  gateways:
  - superset
  http:
  - name: superset
    match:
    - uri:
        prefix: /superset/
    rewrite:
      uri: /
    route:
    - destination:
        host: superset.superset.svc.cluster.local

and tls is in values.yaml

tls: 
    httpsRedirect: true

I'm getting 404 error when trying to hit the url "superset.dev". also when checking the logs got below

"route_not_found"

"response_code":404,"bytes_sent"
1

There are 1 best solutions below

0
On

Here the prefix you have configured is "/superset/", So you need to add the prefix along with the host.

superset.dev/superset