diff --git a/templates/jicofo/configmap.yaml b/templates/jicofo/configmap.yaml index 39c9672..2c3c659 100644 --- a/templates/jicofo/configmap.yaml +++ b/templates/jicofo/configmap.yaml @@ -11,6 +11,10 @@ data: JIBRI_BREWERY_MUC: '{{ .Values.jibri.breweryMuc }}' JIBRI_PENDING_TIMEOUT: '{{ .Values.jibri.timeout }}' {{- end }} + {{- if .Values.jigasi.enabled }} + JIGASI_BREWERY_MUC: '{{ .Values.jigasi.breweryMuc }}' + JIGASI_SIP_URI: "available" + {{- end }} {{- range $key, $value := .Values.jicofo.extraEnvs }} {{- if not (kindIs "invalid" $value) }} {{ $key }}: {{ tpl $value $ | quote }} @@ -19,4 +23,4 @@ data: {{- if .Values.octo.enabled }} ENABLE_OCTO: "1" OCTO_BRIDGE_SELECTION_STRATEGY: "SplitBridgeSelectionStrategy" - {{- end }} \ No newline at end of file + {{- end }} diff --git a/templates/jigasi/_helper.tpl b/templates/jigasi/_helper.tpl new file mode 100644 index 0000000..debe33f --- /dev/null +++ b/templates/jigasi/_helper.tpl @@ -0,0 +1,18 @@ + +{{- define "jitsi-meet.jigasi.fullname" -}} +{{ include "jitsi-meet.fullname" . }}-jigasi +{{- end -}} + +{{- define "jitsi-meet.jigasi.labels" -}} +{{ include "jitsi-meet.labels" . }} +app.kubernetes.io/component: jigasi +{{- end -}} + +{{- define "jitsi-meet.jigasi.selectorLabels" -}} +{{ include "jitsi-meet.selectorLabels" . }} +app.kubernetes.io/component: jigasi +{{- end -}} + +{{- define "jitsi-meet.jigasi.secret" -}} +{{ include "call-nested" (list . "prosody" "prosody.fullname") }}-jigasi +{{- end -}} diff --git a/templates/jigasi/configmap.yaml b/templates/jigasi/configmap.yaml new file mode 100644 index 0000000..d137ae7 --- /dev/null +++ b/templates/jigasi/configmap.yaml @@ -0,0 +1,16 @@ +{{- if .Values.jigasi.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "jitsi-meet.jigasi.fullname" . }} + labels: + {{- include "jitsi-meet.jigasi.labels" . | nindent 4 }} +data: + JIGASI_BREWERY_MUC: '{{ .Values.jigasi.breweryMuc }}' + XMPP_SERVER: '{{ include "jitsi-meet.xmpp.server" . }}' + {{- range $key, $value := .Values.jigasi.extraEnvs }} + {{- if not (kindIs "invalid" $value) }} + {{ $key }}: {{ tpl $value $ | quote }} + {{- end }} + {{- end }} +{{- end }} diff --git a/templates/jigasi/deployment.yaml b/templates/jigasi/deployment.yaml new file mode 100644 index 0000000..9dbe55f --- /dev/null +++ b/templates/jigasi/deployment.yaml @@ -0,0 +1,74 @@ +{{- if and .Values.jigasi.enabled (not .Values.jigasi.useExternalJigasi) }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "jitsi-meet.jigasi.fullname" . }} + labels: + {{- include "jitsi-meet.jigasi.labels" . | nindent 4 }} + {{- with .Values.jigasi.annotations }} + annotations: + {{ toYaml . | nindent 4 }} + {{- end }} +spec: + replicas: {{ .Values.jigasi.replicaCount | default 1 }} + selector: + matchLabels: + {{- include "jitsi-meet.jigasi.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "jitsi-meet.jigasi.selectorLabels" . | nindent 8 }} + {{- range $label, $value := mergeOverwrite .Values.global.podLabels .Values.jigasi.podLabels }} + {{ $label }}: {{ $value }} + {{- end }} + annotations: + checksum/config: {{ include (print $.Template.BasePath "/jigasi/configmap.yaml") . | sha256sum }} + checksum/secret: {{ include (print $.Template.BasePath "/jigasi/xmpp-secret.yaml") . | sha256sum }} + {{- range $annotation, $value := mergeOverwrite .Values.global.podAnnotations .Values.jigasi.podAnnotations }} + {{ $annotation }}: {{ $value|quote }} + {{- end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "jitsi-meet.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.jigasi.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.jigasi.securityContext | nindent 12 }} + image: "{{ .Values.jigasi.image.repository }}:{{ default .Chart.AppVersion .Values.jigasi.image.tag }}" + imagePullPolicy: {{ pluck "pullPolicy" .Values.jigasi.image .Values.image | first }} + envFrom: + - secretRef: + name: {{ include "call-nested" (list . "prosody" "prosody.fullname") }}-jigasi + - configMapRef: + name: {{ include "call-nested" (list . "prosody" "prosody.fullname") }}-common + - configMapRef: + name: {{ include "jitsi-meet.jigasi.fullname" . }} + {{- with .Values.jigasi.livenessProbe }} + livenessProbe: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.jigasi.readinessProbe }} + readinessProbe: + {{- toYaml . | nindent 12 }} + {{- end }} + resources: + {{- toYaml .Values.jigasi.resources | nindent 12 }} + + {{- with .Values.jigasi.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.jigasi.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.jigasi.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} +{{- end }} diff --git a/templates/jigasi/xmpp-secret.yaml b/templates/jigasi/xmpp-secret.yaml new file mode 100644 index 0000000..c926d0c --- /dev/null +++ b/templates/jigasi/xmpp-secret.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "call-nested" (list . "prosody" "prosody.fullname") }}-jigasi + labels: + {{- include "jitsi-meet.jigasi.labels" . | nindent 4 }} +type: Opaque +data: + {{- if .Values.jigasi.enabled }} + JIGASI_XMPP_USER: '{{ .Values.jigasi.xmpp.user | b64enc }}' + JIGASI_XMPP_PASSWORD: '{{ default (randAlphaNum 10) .Values.jigasi.xmpp.password | b64enc }}' + {{- end }} diff --git a/values.yaml b/values.yaml index 02d502d..7f49f1a 100644 --- a/values.yaml +++ b/values.yaml @@ -234,6 +234,46 @@ octo: enabled: false +jigasi: + ## Enabling Jigasi will allow regular SIP clients to join Jitsi meetings + ## or nearly real-time transcription. + enabled: false + + ## Use external Jigasi installation. + ## This setting skips the creation of Jigasi Deployment altogether, + ## instead creating just the config secret and enabling services. + ## Defaults to disabled (use bundled Jigasi). + useExternalJigasi: true + + replicaCount: 1 + image: + repository: jitsi/jigasi + + breweryMuc: jigasibrewery + + ## jigasi XMPP user credentials: + xmpp: + user: jigasi + password: + + livenessProbe: + tcpSocket: + port: 8788 + readinessProbe: + tcpSocket: + port: 8788 + + podLabels: {} + podAnnotations: {} + podSecurityContext: {} + securityContext: {} + resources: {} + nodeSelector: {} + tolerations: [] + affinity: {} + extraEnvs: {} + + jibri: ## Enabling Jibri will allow users to record ## and/or stream their meetings (e.g. to YouTube). @@ -369,6 +409,8 @@ prosody: enabled: true server: extraEnvFrom: + - secretRef: + name: '{{ include "prosody.fullname" . }}-jigasi' - secretRef: name: '{{ include "prosody.fullname" . }}-jicofo' - secretRef: