【发布时间】:2019-11-20 03:40:24
【问题描述】:
我是 Kubernetes 和 istio 的新手。在 GKE 上,我创建了入口网关和两个虚拟服务。第一个是路由到 hipstershop 的前端网关,第二个是路由到我的 hello world 服务器的 dummyservice。但是当我打电话时
curl -v http://35.223.232.224/dummy
,它显示 Cannot GET /dummy 错误。我确定我的 dummyservice 工作正常,因为我已经使用 Loadbalancer 外部 IP 进行了测试。但是我可以使用 http://ingress_ip 致电 hipstershop。有人可以帮我吗?
这是我的 istio 配置文件
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: frontend-gateway
spec:
selector:
istio: ingressgateway # use Istio default gateway implementation
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- "*"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: dummy-ingress
spec:
hosts:
- "*"
gateways:
- frontend-gateway
http:
- match:
- uri:
exact: /dummy
route:
- destination:
host: dummyservice
port:
number: 80
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: dummy-ingress2
spec:
hosts:
- "*"
gateways:
- frontend-gateway
http:
- match:
- uri:
exact: /dummy2
route:
- destination:
host: dummyservice
port:
number: 80
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: frontend-ingress
spec:
hosts:
- "*"
gateways:
- frontend-gateway
http:
- route:
- destination:
host: frontend
port:
number: 80
【问题讨论】:
标签: google-kubernetes-engine kubernetes-ingress istio