Istio Gateway和VirtualService似乎不起作用

时间:2019-12-12 01:19:06

标签: kubernetes openshift istio

我在命名空间中设置了Gateway和VirtualService对象,但看来它们无法正常工作。 Istio入口网关由OpenShift的Route对象公开。

apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata: 
  name: n1-gateway #n1 is temporary value of namespace
  namespace: n1
spec:
  selector:
    istio: ingressgateway
  servers:
  - port:
      number: 80
      protocol: HTTP
      name: http
    hosts:
    - istio-ingressgateway.com #temporary istio-ingressgateway ROUTE URL 
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: zipkin
  namespace: n1
spec:
  hosts:
  - istio-ingressgateway.com #temporary istio-ingressgateway ROUTE URL
  gateways:
  - n1/n1-gateway #neither n1-gateway nor n1/n1-gateway does not work
  http:
  - match:
    - uri:
        prefix: /n1-zipkin
      route:
      - destination:
          host: zipkin.n1.svc.cluster.local #neither zipkin nor zipkin.n1.svc.cluster.local does not work
          port:
            number: 9411

但是,当我连接到istio-ingressgateway.com/n1-zipkin时,它总是显示404 Not Found页面。 我可以使用Openshift的Route对象访问同一服务,以便Gateway和VirtualService对象似乎无法正常工作。

我必须检查名称空间的任何设置吗?因为我可以使用完全相同的Gateway和VirtualServices访问其他名称空间中的服务,所以只有名称空间值是不同的。

0 个答案:

没有答案