首页 文章

使用Istio 0.8和v1alpha3网关进行TCP入口

提问于
浏览
0

我试图使用v1alpha3路由打开TCP连接到Istio服务网格 . 我可以成功打开与外部负载均衡器的连接 . 该流量正如预期的那样进入默认的IngressGateway;我在IngressGateway pod上用 tcpdump 验证了这一点 .

不幸的是,流量永远不会转发到服务网格中;它似乎死在IngressGateway .

以下是我的配置示例:

apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: echo-gateway
spec:
  selector:
    istio: ingressgateway # use istio default controller
  servers:
  - port:
      number: 31400 
      protocol: TCP
    hosts:
    - "*"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: echo-gateway
spec:
  hosts:
  - "*"
  gateways:
  - echo-gateway
  tcp:
  - match:
    - port: 31400
    route:
    - destination:
        host: echo.default.svc.cluster.local
        port:
          number: 6060

我已经确认IngressGateway可以通过指定端口上的 netcat 到达服务 . 使用特使在服务窗格上运行 tcpdump 表示永远不会与窗格或代理进行通信尝试 .

我已多次阅读文档,但我不知道如何继续 . 文档中的这一行对我来说是可疑的:

虽然Istio将配置代理以侦听这些端口,但用户有责任确保允许这些端口的外部流量进入网状网 .

有什么想法吗?

1 回答

  • 0

    您应该为 Gateway 端口指定一个名称,例如 port: name: not_http number: 80 protocol: HTTP

    (当我尝试在Istio 1.0中创建没有名称的群集时,它被拒绝了) . 使用“not_http”有助于提醒我们这是一个TCP网关,无法访问所有的Istio配置功能 .

    VirtualService 看起来是正确的 . 确保主机"*"只有一个VirtualService(使用 istioctl get all --all-namespaces ) .

相关问题