Good day to all! I'm having an issue with istio ingress configuration for gRPC service. My istio config is following:
apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
name: test-grpc-gateway
namespace: istio-system
spec:
selector:
app:-grpc-gateway
environment: test
servers:
- hosts:
- test-grpc-gateway.apps.osh-cln01-test.eub.kz
port:
name: http2
number: 80
protocol: HTTP2
---
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: adapter-info-grpc
namespace: istio-system
spec:
gateways:
- test-grpc-gateway
hosts:
- '*'
http:
- match:
- uri:
prefix: /
route:
- destination:
host: adapter-info.adapters.svc.cluster.local
port:
number: 10540
subset: adapter-info-grpc
---
apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
name: adapter-rsbk-info-grpc
namespace: adapters
spec:
host: adapter-info.adapters.svc.cluster.local
subsets:
- labels:
app.kubernetes.io/instance: adapter-info
app.kubernetes.io/name: adapter-info
name: adapter-info-grpc
trafficPolicy:
portLevelSettings:
- loadBalancer:
simple: ROUND_ROBIN
port:
number: 10540
I call the service using postman's grpc call and call the url 'test-grpc-gateway.apps.osh-cln01-test.eub.kz'. Reflector successfully pulls the methods of gRPC server but doesn't seem to recieve the server responses.
Logs of the gRPC server shows that server indeed received the call, processed it and sent a responce, but what I get in postman is 'Received RST_STREAM with code 0'.
Here're the logs:
2023-12-05T14:49:50.8062336+06:00 [INF] [0HMVLDSFKPKGC:00000001] (Microsoft.AspNetCore.Hosting.Diagnostics) Request starting HTTP/2 POST http://test-grpc-gateway.apps.osh-cln01-test.example.com/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo application/grpc -
2023-12-05T14:49:50.8079935+06:00 [DBG] [0HMVLDSFKPKGC:00000001] (Microsoft.AspNetCore.Routing.Matching.DfaMatcher) 3 candidate(s) found for the request path '"/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo"'
2023-12-05T14:49:50.8080435+06:00 [DBG] [0HMVLDSFKPKGC:00000001] (Microsoft.AspNetCore.Routing.Matching.DfaMatcher) Endpoint '"gRPC - /grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo"' with route pattern '"/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo"' is valid for the request path '"/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo"'
2023-12-05T14:49:50.8080710+06:00 [DBG] [0HMVLDSFKPKGC:00000001] (Microsoft.AspNetCore.Routing.Matching.DfaMatcher) Endpoint '"gRPC - Unimplemented method for grpc.reflection.v1alpha.ServerReflection"' with route pattern '"grpc.reflection.v1alpha.ServerReflection/{unimplementedMethod:grpcunimplemented}"' is valid for the request path '"/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo"'
2023-12-05T14:49:50.8080886+06:00 [DBG] [0HMVLDSFKPKGC:00000001] (Microsoft.AspNetCore.Routing.Matching.DfaMatcher) Endpoint '"gRPC - Unimplemented service"' with route pattern '"{unimplementedService}/{unimplementedMethod:grpcunimplemented}"' is valid for the request path '"/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo"'
2023-12-05T14:49:50.8081917+06:00 [DBG] [0HMVLDSFKPKGC:00000001] (Microsoft.AspNetCore.Routing.EndpointRoutingMiddleware) Request matched endpoint '"gRPC - /grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo"'
2023-12-05T14:49:50.8087639+06:00 [DBG] [0HMVLDSFKPKGC:00000001] (Microsoft.AspNetCore.StaticFiles.StaticFileMiddleware) Static files was skipped as the request already matched an endpoint.
2023-12-05T14:49:50.8088214+06:00 [INF] [0HMVLDSFKPKGC:00000001] (Microsoft.AspNetCore.Routing.EndpointMiddleware) Executing endpoint '"gRPC - /grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo"'
2023-12-05T14:49:50.8209506+06:00 [DBG] [0HMVLDSFKPKGC:00000001] (Grpc.AspNetCore.Server.ServerCallHandler) Reading message.
2023-12-05T14:49:50.8210085+06:00 [DBG] [0HMVLDSFKPKGC:00000001] (Microsoft.AspNetCore.Server.Kestrel) Connection id ""0HMVLDSFKPKGC"", Request id ""0HMVLDSFKPKGC:00000001"": started reading request body.
2023-12-05T14:49:50.8210705+06:00 [DBG] [0HMVLDSFKPKGC:00000001] (Microsoft.AspNetCore.Server.Kestrel) Connection id ""0HMVLDSFKPKGC"", Request id ""0HMVLDSFKPKGC:00000001"": done reading request body.
2023-12-05T14:49:50.8246357+06:00 [DBG] [0HMVLDSFKPKGC:00000001] (Grpc.AspNetCore.Server.ServerCallHandler) Sending message.
2023-12-05T14:49:50.8254736+06:00 [DBG] [0HMVLDSFKPKGC:00000001] (Grpc.AspNetCore.Server.ServerCallHandler) Reading message.
2023-12-05T14:49:50.8257861+06:00 [INF] [0HMVLDSFKPKGC:00000001] (Microsoft.AspNetCore.Routing.EndpointMiddleware) Executed endpoint '"gRPC - /grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo"'
2023-12-05T14:49:50.8261282+06:00 [INF] [0HMVLDSFKPKGC:00000001] (Microsoft.AspNetCore.Hosting.Diagnostics) Request finished HTTP/2 POST http://test-grpc-gateway.apps.osh-cln01-test.example.com/grpc.reflection.v1alpha.ServerReflection/ServerReflectionInfo application/grpc - - 200 - application/grpc 19.8670ms
2023-12-05T14:4
Can anybody help?
I tried changing the gateway protocol to grpc and http but only http2 works. Just can't find a good docs on this. I don't know much about mTLS and gRPS requirements on TLS so probably that could be the case? Any help is highly appreciated.