ISTIO GRPC网关配置 [英] ISTIO GRPC Gateway configuration

查看:593
本文介绍了ISTIO GRPC网关配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用GRPC设置ISTIO网关.我正在使用以下示例: https://github.com/h3poteto/istio-grpc-example .

I am trying to setup ISTIO Gateway with GRPC. I am using example from:https://github.com/h3poteto/istio-grpc-example.

此示例不包含网关.我添加了网关:

This example does not contain Gateway. I added the Gateway:

kind: Gateway
metadata:
  name: my-gateway
  namespace: istio-grpc-example
spec:
  selector:
    istio: ingressgateway
  servers:
  - port:
      number: 80
      name: grpc-wildcard
      protocol: GRPC
    hosts:
    - "*"

并修改了VirtualService:

and modified the VirtualService:

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: backend
  namespace: istio-grpc-example
spec:
  hosts:
    - "backend"
  gateways:
  - my-gateway
  http:
  - match:
    - port: 50051
    route:
    - destination:
        host: backend
        subset: v0
      weight: 90
    - destination:
        host: backend
        subset: v1
      weight: 10

还有其他我应该做的事情吗?我仍然无法通过网关…查询服务端点时收到错误.

Is there somethig else I should do? I still cannot go through Gateway… Received an error when querying services endpoint.

谢谢!

推荐答案

我在评论中提到

您是否尝试过使用通配符主机? *代替backend?

您需要更改虚拟服务主机.

You need to change virtual service hosts.

spec:
  hosts:
    - "backend"

spec:
  hosts:
    - "*"

@Ondra补充说,他更改的另一件事是网关端口号.

And @Ondra add that other thing he changed was the gateway port number.

我将端口号从80更改为31400,并将主机从后端"更改为"*".现在看来一切正常. –恩德拉

I changed the port number from 80 to 31400 and changed the host from "backend" to "*". Now it looks like everything is working. – Ondra

这篇关于ISTIO GRPC网关配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆