How to route gRPC in Istio?

9/10/2018

I'm new with service mesh thing, so I did some PoC of basic implementation of microservices in kubernetes with istio.

I have 2 Deployments which is supposed to be talking to each other using gRPC. When I call the grpc server it returned error rpc error: code = Internal desc = server closed the stream without sending trailers

This is my grpc Service config:

apiVersion: v1 kind: Service metadata: name: grpcserver labels: app: grpcserver spec: ports: - port: 8080 name: http selector: app: grpcserver

-- Ahmad Muzakki
grpc
istio
kubernetes

1 Answer

9/10/2018

Quoting Istio docs,

Service ports must be named. The port names must be of the form {protocol}[-{suffix}] with http, http2, grpc, mongo, or redis as the in order to take advantage of Istio’s routing features.

So the Service configuration should be:

apiVersion: v1
kind: Service
metadata:
  name: grpcserver
  labels:
    app: grpcserver
spec:
  ports:
  - port: 8080
    name: grpc
  selector:
    app: grpcserver
-- Ahmad Muzakki
Source: StackOverflow