From 73d6143f81ecc370e53f297f46d50517b4409a38 Mon Sep 17 00:00:00 2001 From: Serge Tkatchouk Date: Fri, 9 Dec 2022 23:38:24 +0800 Subject: [PATCH] Introduce support for multiple public IPs --- README.md | 23 +++++++++++++++++------ templates/jvb/deployment.yaml | 10 +++++----- templates/jvb/metrics-service.yaml | 2 +- templates/jvb/service.yaml | 2 +- values.yaml | 12 ++++++++++++ 5 files changed, 36 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 0f73178..3515663 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,13 @@ jvb: service: type: LoadBalancer - # Depending on the cloud, publicIP cannot be know in advance, so deploy first, without the next option. + # Depending on the cloud, LB's public IP cannot be known in advance, so deploy first, without the next option. # Next: redeploy with the following option set to the public IP you retrieved from the API. - publicIP: 1.2.3.4 + # Additionally, you can add your cluster's public IPs if you want to use direct connection as a fallback. + publicIPs: + - 1.2.3.4 + # - 30.10.10.1 + # - 30.10.10.2 ``` In this case you're not allowed to change the `jvb.replicaCount` to more than `1`, UDP packets will be routed to random `jvb`, which would not allow for a working video setup. @@ -43,11 +47,14 @@ In this case you're not allowed to change the `jvb.replicaCount` to more than `1 jvb: service: type: NodePort - # It may be required to change the default port to a value allowed by Kubernetes (30000-32768) - UDPPort: 30000 + # Set the following variable if you want to use a specific external port for the service. + # The default is to select a random port from Kubelet's allowed NodePort range (30000-32767). - # Use public IP of one of your node, or the public IP of a loadbalancer in front of the nodes - publicIP: 1.2.3.4 + # nodePort: 10000 + + # Use public IP of one of your nodes, or the public IP of an external LB: + publicIPs: + - 30.10.10.1 ``` In this case you're not allowed to change the `jvb.replicaCount` to more than `1`, UDP packets will be routed to random `jvb`, which would not allow for a working video setup. @@ -123,9 +130,13 @@ Parameter | Description | Default `jicofo.xmpp.user` | Name of the XMPP user used by jicofo to authenticate | `focus` `jicofo.xmpp.password` | Password used by jicofo to authenticate on the XMPP service | 10 random chars `jicofo.xmpp.componentSecret` | Values of the secret used by jicofo for the xmpp-component | 10 random chars +`jvb.publicIPs` | List of IP addresses for JVB to announce to clients | `(unset)` `jvb.service.enabled` | Boolean to enable os disable the jvb service creation | `false` if `jvb.useHostPort` is `true` otherwise `true` `jvb.service.type` | Type of the jvb service | `ClusterIP` `jvb.UDPPort` | UDP port used by jvb, also affects port of service, and hostPort | `10000` +`jvb.nodePort` | UDP port used by NodePort service | `(unset)` +`jvb.useHostPort` | Enable HostPort feature (may not work on some CNI plugins) | `false` +`jvb.useHostNetwork` | Connect JVB pod to host network namespace | `false` `jvb.extraEnvs` | Map containing additional environment variables to jvb | '{}' `jvb.xmpp.user` | Name of the XMPP user used by jvb to authenticate | `jvb` `jvb.xmpp.password` | Password used by jvb to authenticate on the XMPP service | 10 random chars diff --git a/templates/jvb/deployment.yaml b/templates/jvb/deployment.yaml index c2b2876..0f6d785 100644 --- a/templates/jvb/deployment.yaml +++ b/templates/jvb/deployment.yaml @@ -57,18 +57,18 @@ spec: - configMapRef: name: {{ include "jitsi-meet.jvb.fullname" . }} env: - {{- if or .Values.jvb.useNodeIP .Values.jvb.publicIP }} + {{- if or .Values.jvb.useNodeIP .Values.jvb.publicIPs }} - name: DOCKER_HOST_ADDRESS - {{- if .Values.jvb.publicIP }} - value: {{ .Values.jvb.publicIP }} + {{- if .Values.jvb.publicIPs }} + value: {{ first .Values.jvb.publicIPs }} {{- else }} valueFrom: fieldRef: fieldPath: status.hostIP {{- end }} - name: JVB_ADVERTISE_IPS - {{- if .Values.jvb.publicIP }} - value: {{ .Values.jvb.publicIP }} + {{- if .Values.jvb.publicIPs }} + value: {{ .Values.jvb.publicIPs | join "," }} {{- else }} valueFrom: fieldRef: diff --git a/templates/jvb/metrics-service.yaml b/templates/jvb/metrics-service.yaml index c832155..32a656d 100644 --- a/templates/jvb/metrics-service.yaml +++ b/templates/jvb/metrics-service.yaml @@ -13,4 +13,4 @@ spec: name: tcp-metrics selector: {{- include "jitsi-meet.jvb.selectorLabels" . | nindent 4 }} - {{- end }} +{{- end }} diff --git a/templates/jvb/service.yaml b/templates/jvb/service.yaml index 54a1ffa..d86385d 100644 --- a/templates/jvb/service.yaml +++ b/templates/jvb/service.yaml @@ -1,4 +1,4 @@ -{{- if or (and (kindIs "invalid" .Values.jvb.service.enabled) (not .Values.jvb.useHostPort)) .Values.jvb.service.enabled }} +{{- if or (and (kindIs "invalid" .Values.jvb.service.enabled) (not (or .Values.jvb.useHostPort .Values.jvb.useHostNetwork))) .Values.jvb.service.enabled }} apiVersion: v1 kind: Service metadata: diff --git a/values.yaml b/values.yaml index 25ccc18..d0fedd0 100644 --- a/values.yaml +++ b/values.yaml @@ -161,6 +161,17 @@ jvb: user: jvb password: + ## Set public IP addresses to be advertised by JVB. + # You can specify your nodes' IP addresses, + # or IP addresses of proxies/LoadBalancers used for your + # Jitsi Meet installation. Or both! + # + # Note that only the first IP address will be used for legacy + # `DOCKER_HOST_ADDRESS` environment variable. + # + # publicIPs: + # - 1.2.3.4 + # - 5.6.7.8 ## Use a STUN server to help some users punch through some # especially nasty NAT setups. Usually makes sense for P2P calls. stunServers: 'meet-jit-si-turnrelay.jitsi.net:443' @@ -170,6 +181,7 @@ jvb: ## Use host's network namespace: # (not recommended, but might help for some cases) useHostNetwork: false + ## UDP transport port: UDPPort: 10000 ## Use a pre-defined external port for NodePort or LoadBalancer service, # if needed. Will allocate a random port from allowed range if unset.