Envoy Deploy gRPC web

Hi people I looked into gRPC service behind Envoy proxy and other ones that similar but I think I’m doing something wrong.

I deployed my grpc server grpc-test-server that run perfectly.
I created grpc-test-server for put envoy proxy to use grpc-web but couldn’t manage to do it.

I’m using envoyproxy/envoy:v1.30-latest as docker image with my config on it.

grpc-test-server is not responding to any calls but it is working I checked live log and it seems like working in there.

envoy.yaml

admin:
  address:
    socket_address: { address: "::", port_value: 9901, ipv4_compat: true }

static_resources:
  listeners:
    - name: listener_0
      address:
        socket_address: { address: "::", port_value: 8080, ipv4_compat: true }
      filter_chains:
        - filters:
            - name: envoy.http_connection_manager
              typed_config:
                "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
                codec_type: auto
                stat_prefix: ingress_http
                route_config:
                  name: local_route
                  virtual_hosts:
                    - name: local_service
                      domains: ["*"]
                      routes:
                        - match: { prefix: "/" }
                          route: { cluster: echo_service }
                http_filters:
                  - name: envoy.grpc_web
                    typed_config:
                      "@type": type.googleapis.com/envoy.extensions.filters.http.grpc_web.v3.GrpcWeb
                  - name: envoy.filters.http.router
                    typed_config:
                      "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
  clusters:
    - name: echo_service
      connect_timeout: 0.25s
      type: LOGICAL_DNS
      typed_extension_protocol_options:
        envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
          "@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
          explicit_http_config:
            http2_protocol_options: {}
      lb_policy: ROUND_ROBIN
      load_assignment:
        cluster_name: echo_service
        endpoints:
          - lb_endpoints:
              - endpoint:
                  address:
                    socket_address:
                      address: grpc-test-server.internal
                      port_value: 443
                      ipv4_compat: true

fly.toml

app = 'grpc-test-server-proxy'
primary_region = 'ams'

[build]

[http_service]
  internal_port = 8080
  force_https = true


[[services]]
  protocol = 'tcp'
  internal_port = 8080

  [[services.ports]]
    port = 443
    handlers = ['tls']

    [services.ports.tls_options]
      alpn = ['h2']

[[vm]]
  size = 'shared-cpu-1x'

I tried with nginx

nginx.conf

server {
        listen       8080;
        listen [::]:8080;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

	    # api
        location / {
                resolver [fdaa::3];
                grpc_set_header Content-Type application/grpc;
                grpc_pass grpc://grpc-test-server.internal:54321;
        }
}

but similar problem cannot get any respond from gRPC server that deployed.

the gRPC server I’m trying to connect.
fly.toml

primary_region = 'ams'

[build]
  [build.args]
    GO_VERSION = '1.22.4'

[env]
  PORT = '8080'

[[services]]
  internal_port = 8080
  protocol = "tcp"

  [[services.ports]]
    handlers = ["tls"]
    port = "443"

  [services.ports.tls_options]
    alpn = ["h2"]



[[vm]]
  size = 'shared-cpu-1x'

Update:
after some testing I can verify nginx is making some traffic to fly machine to serves gRPC but still couldn’t manage to create grpc-web connection

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.