gRPC Transcoding with Istio

I’m trying to deploy one service using Istio, this application will receive HTTP2 and HTTP1 calls, for the HTTP1 calls we need to do a GRPC Transcode, with envoy locally we used the following configuration and worked:

admin:
access_log_path: /tmp/admin_access.log
address:
socket_address: { address: 0.0.0.0, port_value: 9901 }

static_resources:
listeners:
- name: listener1
address:
socket_address: { address: 0.0.0.0, port_value: 51051 }
filter_chains:
- filters:
- name: envoy.http_connection_manager
config:
stat_prefix: grpc_json
codec_type: AUTO
route_config:
name: local_route
virtual_hosts:
- name: local_service
domains: [“*”]
routes:
- match: { prefix: “/” }
route: { cluster: grpc, timeout: { seconds: 60 } }
http_filters:
- name: envoy.filters.http.jwt_authn
config:
providers:
provider1:
issuer: FQDN
local_jwks:
inline_string: ’
{
“keys”: [
{
“…”
}
]
}

rules:
- match:
prefix: /
requires:
provider_name: provider1
- name: envoy.grpc_json_transcoder
config:
proto_descriptor: “/data/address_definition.pb”
services: [“wally.AddressService”]
print_options:
add_whitespace: true
always_print_primitive_fields: true
always_print_enums_as_ints: false
preserve_proto_field_names: false
- name: envoy.router
clusters:
- name: grpc
connect_timeout: 1.25s
type: logical_dns
lb_policy: round_robin
dns_lookup_family: V4_ONLY
http2_protocol_options: {}
hosts:
- socket_address:
address: 127.0.0.1
port_value: 50051
- name: ext-authz
connect_timeout: 0.25s
type: logical_dns
lb_policy: round_robin
hosts:
- socket_address:
address: 127.0.0.1
port_value: 8080

But I was not able to convert and use this to Istio, the service is UP but the HTTP1 call doesn’t work as intended:

curl -I -X GET ‘http://foo.com/v1/reverse-geocode?placeId=foobar’  16:57:23 
HTTP/1.1 415 Unsupported Media Type
content-type: text/plain; encoding=utf-8
grpc-status: 13
grpc-message: Content-Type is missing from the request
x-envoy-upstream-service-time: 3
date: Fri, 22 Mar 2019 19:57:20 GMT
server: envoy
transfer-encoding: chunked

Someone could help me, please ?

ps.: I’ve used this https://www.tetrate.io/blog/grpc-transcoding-with-istio/ as a guide

just use the http-grpc bridge filter instead. Let me know if you need details.

1 Like

Steven, I’ve managed to use the https://github.com/tetratelabs/istio-tools/tree/master/grpc-transcoder , but I would like to know more about this.
How do you refer the proto buffer using the gRPC HTTP/1.1 bridge?

Istio + Envoy grpc_json_transcoder_filter has the full solution. You just use the protobuf generated client to send the bytes across. Btw, this is definitely what Lyft is doing to expose its api internally. You should use grpc-transcoding with caution.

@Steven_O_brien We’re trying to accomplish something similar. Can you provide details on how to get the http-grpc bridge working?

I will look for it. I think I posted it on this board somewhere else

Yep here it is: Istio + Envoy grpc_json_transcoder_filter