New to gRPC:
Having a gRPC client, how do you use routing?
My gRPC server is at this local path 10.0.1.6/hw
.
It is running and listening in a Kubernetes pod and it is working internally, if I run it in a pod. But I am now accessing it via url and ingress.
But how do I test that it actually is working with the routing without a port number?
const (
address = "10.0.1.6:80/hw"
defaultName = "World"
)
var (
conn *grpc.ClientConn
c pb.GreeterClient
)
func setupRPC() {
var err error
conn, err = grpc.Dial(address, grpc.WithInsecure())
c = pb.NewGreeterClient(conn)
if err != nil {
log.Fatalf("did not connect: %v", err)
}
}
I get this error:
could not greet: rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = "transport: Error while dialing dial tcp: lookup tcp/80/hw: nodename nor servname provided, or not known"
Do you know how? Or how to test gRPC endpoints?