seaweedfs-operator icon indicating copy to clipboard operation
seaweedfs-operator copied to clipboard

filer ingress support both http port and grpc port for the same host

Open chrislusf opened this issue 5 years ago • 12 comments

current host can only support one port under one path.

Is it possible to support both the normal filer port and the filer grpc port? Maybe use load balancer?

chrislusf avatar Nov 04 '20 22:11 chrislusf

AFAIK, multiplexing HTTP and gRPC is possible. But I don't know if an ingress controller supports this. Maybe need refactoring on filer. Maybe a reverse proxy will work?

howardlau1999 avatar Nov 05 '20 02:11 howardlau1999

I implemented HTTP and gRPC multiplexing before. It does not work after some grpc version. So the grpc now is http port + 10000.

chrislusf avatar Nov 05 '20 02:11 chrislusf

Seems it is impossible to open more than one ports on the exact same ingress path. So I think multiplexing is the only way. Have you tried grpc-gateway? etcd uses this and works fine.

howardlau1999 avatar Nov 05 '20 02:11 howardlau1999

grpc-gateway needs to start with a grpc implementation and then generate REST APIs.

How about adding another ingress for the filer grpc port?

chrislusf avatar Nov 05 '20 03:11 chrislusf

seems nginx can support non-http ports https://www.nginx.com/blog/announcing-nginx-ingress-controller-for-kubernetes-release-1-7-0/#tcp-udp

chrislusf avatar Nov 05 '20 03:11 chrislusf

grpc-gateway needs to start with a grpc implementation and then generate REST APIs.

How about adding another ingress for the filer grpc port?

I think that still needs two different paths

howardlau1999 avatar Nov 05 '20 03:11 howardlau1999

grpc-gateway needs to start with a grpc implementation and then generate REST APIs.

How about adding another ingress for the filer grpc port?

I think grpc-gateway also allows you to add custom http endpoints without a grpc definition

howardlau1999 avatar Nov 05 '20 04:11 howardlau1999

grpc-gateway has many limitations. One of them, "True bi-directional streaming.", is a required. There are other similar attempts, but none of them work fluently as the native implementatiion.

chrislusf avatar Nov 05 '20 04:11 chrislusf

Seems we can deploy our own nginx controller, and specify the deployed one in --ingress-class:

https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/#using-multiple-ingress-controllers

chrislusf avatar Nov 05 '20 04:11 chrislusf

That will work. But may not seamlessly integrate with users' own ingress controller. I prefer two-path method, i.e. one path for http and another for grpc

howardlau1999 avatar Nov 05 '20 09:11 howardlau1999

That will work. But may not seamlessly integrate with users' own ingress controller. I prefer two-path method, i.e. one path for http and another for grpc

Two host names? One for http and one for grpc? Doable after some code adjustments.

chrislusf avatar Nov 05 '20 09:11 chrislusf

Current clients, weed mount and HDFS client, would only use filer gRPC API and volume server RESE API. We can simply configure them by host names.

filer.seaweed.abcde.com

grpcfiler.seaweed.abcde.com
volume1.seaweed.abcde.com
volume2.seaweed.abcde.com
volume3.seaweed.abcde.com

The clients need some adjustment to resolve the filer grpc port.

chrislusf avatar Nov 08 '20 01:11 chrislusf