jitsi-contrib / jitsi-helm

A helm chart to deploy Jitsi to Kubernetes
MIT License
141 stars 74 forks source link

JVB/Web OCTO region sharding support #111

Open anirbandas18 opened 7 months ago

anirbandas18 commented 7 months ago

Hi,

I would like to know if this helm-chart supports a Jitsi shard and videobridge pools naturally out of the box?

jitsi shard = web + jicofo + prosody videobridge pools = jvb replicas (already supported I guess)

My use case is to have multiple shards accessing a common set of videobridges amongst them.

Will this helm-chart support my use case naturally or do i have to modify it or roll out my own helm-charts?

spijet commented 7 months ago

Hello @anirbandas18!

As for now, JVB multi-replica setups are supported via OCTO, and same should hold true for the Web component. Not sure about Jicofo, and Prosody is a stateful service holding all internal state of Jitsi Meet components, so sharding it should roughly be equal to deploying multiple (separate) Jitsi Meet instances, if I understand it right. See also #89 for a similar question.

There's an ongoing discussion about splitting JVB replicas to OCTO regions in #107, you can join.

anirbandas18 commented 7 months ago

So, my idea is to apply horizontal pod auto scaling to a jitsi shard (as defined above) which should handle the stateful nature of prosody as well and use octo in conjunction between jicofo of each shard vs the common jvb in the videobridge pool by ensuring each shard sets the correct userRegion value for jicofo to select a jvb from the pool properly.

Does this sound achievable ?

spijet commented 7 months ago

AFAICT, HPA operates on groups of identical pods, so by definition it would be possible to use it to scale individual groups of Jitsi Web or JVB pods (as in separate auto-scaling groups for different regions or one "global" auto-scaling group), not to create new regions/shards.

anirbandas18 commented 7 months ago

does this helm-chart support HPA of such group of pods?

what do you mean by creating new region/shards in this context?

spijet commented 7 months ago

Unfortunately not, this is not supported at the moment.

As for the regions/shards, here's an example from current main branch:

# templates/jvb/configmap.yaml
  {{- if .Values.octo.enabled }}
  ENABLE_OCTO: "1"
  JVB_OCTO_BIND_PORT: "4096"
  JVB_OCTO_REGION: "all"
  {{- end }}

The last variable (JVB_OCTO_REGION) tells us that all JVB pods (no matter the replica count) are assigned to the same OCTO region, called all, and all the pods will be equally eligible for use by all clients, no matter their IP/location/etc.

In order to introduce different shards/regions we have to rework this part of the chart, so that we can create separate JVB Deployments with separate ConfigMaps that specify different values for JVB_OCTO_REGION, and then do the same for the Web component as well.

anirbandas18 commented 7 months ago

Will this be reworked as an enhancement?

spijet commented 7 months ago

Maybe/probably, if I come up with a good enough way to implement it. :)

anirbandas18 commented 7 months ago

Anyway I can help?

spijet commented 7 months ago

PRs are always welcome, so you can try implementing it if you have an idea how to do it. :)

I'll try to do so too, but unfortunately at the moment I'm a bit caught up at my full-time job.