I am using janus-gateway as a webrtc media server for group videocalling. Previously I had deployed it in a single node using docker-compose but now I want to be able to scale it horizontally. For this, I am trying to use kubernetes but I am facing two problems:
1: Specifying port range to expose for the media server. As the media server needs a port range to operate, which I was able to do in docker-compose with following code
janus-gateway:
build: ./gateway
image: janus-gateway-image
restart: always
ports:
- 8088:8088
- 8188:8188
- 7088:7088
- "10000-10200:10000-10200/udp"
networks:
- back-tier
But I am unable to find any alternative for this in kubernetes. How can I expose a port range using kubernetes.
2: How can I connect from my nodejs app to a specific instance of the gateway. so let's say two instances of gateway are running, right now when user connects to the app, I connect it to one of the two instances running and save it in the redis, and make sure any request from this user is passed to that specific instance. How can I connect to specific replica from node ? Also getting replicas list?
I have checked this issue on kuebernetes but it's still not resolved yet. Is there any workaround for this?