我正在开发一个应用程序,并使用 istio 虚拟服务和 URL 网关,但收到 404 错误。以下是我的虚拟服务和应用程序网关文件。
# 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
并且tls位于values.yaml中
tls:
httpsRedirect: true
尝试访问 url“superset.dev”时出现 404 错误。也在检查下面的日志时
"route_not_found"
"response_code":404,"bytes_sent"
这里您配置的前缀是“/superset/”,所以您需要将前缀与主机一起添加。
superset.dev/superset