k6 icon indicating copy to clipboard operation
k6 copied to clipboard

Support gRPC xDS (Envoy proxy) requests

Open UovTech opened this issue 2 years ago • 6 comments

Feature Description

in the pr https://github.com/grafana/k6/pull/1937 , add xds protocol by update gRPC version.

However, when I try to invoke the grpc server api through the XDS as load balancing procotol, It is not effective.

I tried the following code, and i set up GRPC_XDS_BOOTSTRAP environment variables

import grpc from 'k6/net/grpc';

const client = new grpc.Client();
client.load(null, 'addsvc.proto');

export default () => {
  client.connect('xds:///server.test', { timeout: '5s' });

  const response = client.invoke('addsvc.Add/Sum', {
    a: 1,
    b: 2,
  });
  console.log(response.message.v); // should print 3

  client.close();
};

It will print an error error while dialing: lookup xds on 1.1.1.1:53 (1.1.1.1:53 is my dns server), It seems to handle server.test as a domain name for DNS resolution

can you give me a right example for invoke grpc xds through xDS?

Suggested Solution (optional)

No response

Already existing or connected issues / PRs (optional)

No response

UovTech avatar Apr 06 '23 11:04 UovTech