I am new to both envoy and grpc. Trying to write a xds_server for VHDS. Here is my relevant config:
static_resources:
clusters:
- name: xds_server
connect_timeout: 0.25s
type: STATIC
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: xds_server
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 127.0.0.1
port_value: 50051
transport_socket:
name: envoy.transport_sockets.tls
typed_config:
common_tls_context:
tls_certificates:
- certificate_chain:
filename: ./certs/client.crt
private_key:
filename: ./certs/client.key
alpn_protocols:
- h2
rds.conf:
"api_type": "DELTA_GRPC",
"transport_api_version": "V3",
"cluster_name": "xds_server"
I see envoy trying to talk to the xds_server but the xds_server is printing out this error:
I0424 22:01:42.214966000 3033 chttp2_transport.cc:2904] transport 0x7fc7dc19ee90 set connectivity_state=4
I0424 22:01:42.215632300 3033 chttp2_transport.cc:1843] perform_transport_op[t=0x7fc7dc19ee90]: SET_ACCEPT_STREAM:(nil)((nil),...)
I0424 22:01:42.216302600 3033 tcp_posix.cc:857] TCP:0x7fc7dc16a820 got_error: {"created":"@1587765702.215611500","description":"FD Shutdown","file":"external/com_github_grpc_grpc/src/core/lib/iomgr/lockfree_event.cc","file_line":194,"referenced_errors":[{"created":"@1587765702.214954400","description":"Failed parsing HTTP/2","file":"external/com_github_grpc_grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.cc","file_line":2531,"grpc_status":14,"referenced_errors":[{"created":"@1587765702.214935700","description":"Connect string mismatch: expected 'R' (82) got 'O' (79) at byte 1","file":"external/com_github_grpc_grpc/src/core/ext/transport/chttp2/transport/parsing.cc","file_line":97}]}]}
I0424 22:01:42.216976000 3033 chttp2_transport.cc:2647] ipv4:127.0.0.1:33866: Complete BDP ping err={"created":"@1587765702.214954400","description":"Failed parsing HTTP/2","file":"external/com_github_grpc_grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.cc","file_line":2531,"referenced_errors":[{"created":"@1587765702.214935700","description":"Connect string mismatch: expected 'R' (82) got 'O' (79) at byte 1","file":"external/com_github_grpc_grpc/src/core/ext/transport/chttp2/transport/parsing.cc","file_line":97}]}
On the enovy side:
[2020-04-24 22:03:41.671][3079][debug][router] [external/envoy/source/common/router/router.cc:477] [C0][S10473609296706210577] cluster 'xds_server' match for URL '/envoy.api.v2.VirtualHostDiscoveryService/DeltaVirtualHosts'
[2020-04-24 22:03:41.672][3079][debug][router] [external/envoy/source/common/router/router.cc:634] [C0][S10473609296706210577] router decoding headers:
':path', '/envoy.api.v2.VirtualHostDiscoveryService/DeltaVirtualHosts'
':authority', 'xds_server'
'content-type', 'application/grpc'
'x-envoy-internal', 'true'
'x-forwarded-for', '172.19.0.2'
So, the error from the xds_server is grpc complaining about the POST request instead of a preface request using PRI verb according the Http/2 spec.
Can some time point me to the right direction on how to resolve this? Thanks.
Andy