From 0b5954fe2f29b910e99e3579d6066d424a675ab1 Mon Sep 17 00:00:00 2001 From: Wei He Date: Sat, 21 May 2022 14:10:24 +0800 Subject: [PATCH] refactor etherpad into jitsi-meet chart --- deploy_jitsi.sh | 3 +- jitsi/Chart.lock | 6 +-- jitsi/Chart.yaml | 4 +- jitsi/charts/jitsi-meet/Chart.yaml | 3 +- .../jitsi-meet/templates/etherpad/_helper.tpl | 13 +++++ .../templates/etherpad/deployment.yaml | 48 +++++++++++++++++++ .../templates/etherpad/service.yaml | 17 +++++++ .../jitsi-meet/templates/web/configmap.yaml | 3 ++ jitsi/charts/jitsi-meet/values.yaml | 18 +++++++ jitsi/templates/etherpad/deployment.yaml | 30 ------------ jitsi/templates/etherpad/service.yaml | 17 ------- jitsi/values.yaml | 6 +-- 12 files changed, 109 insertions(+), 59 deletions(-) create mode 100644 jitsi/charts/jitsi-meet/templates/etherpad/_helper.tpl create mode 100644 jitsi/charts/jitsi-meet/templates/etherpad/deployment.yaml create mode 100644 jitsi/charts/jitsi-meet/templates/etherpad/service.yaml delete mode 100644 jitsi/templates/etherpad/deployment.yaml delete mode 100644 jitsi/templates/etherpad/service.yaml diff --git a/deploy_jitsi.sh b/deploy_jitsi.sh index baec963..037249b 100755 --- a/deploy_jitsi.sh +++ b/deploy_jitsi.sh @@ -195,8 +195,7 @@ function do_app { --helm-set fqdn=${FQDN} \ --helm-set jitsi-meet.publicURL=https://${FQDN} \ --helm-set jitsi-meet.jvb.publicIP=${PUBLIC_IP} \ - --helm-set jitsi-meet.jvb.UDPPort=${JVB_PORT} \ - --helm-set jitsi-meet.web.extraEnvs.ETHERPAD_URL_BASE=http://${HELM_NAME}-etherpad.${NAMESPACE}.svc:9001 + --helm-set jitsi-meet.jvb.UDPPort=${JVB_PORT} sleep 5 # there is a race if sync happens too quickly, so that it becomes a partial sync argocd app sync ${HELM_NAME} diff --git a/jitsi/Chart.lock b/jitsi/Chart.lock index 27180af..e370e06 100644 --- a/jitsi/Chart.lock +++ b/jitsi/Chart.lock @@ -1,6 +1,6 @@ dependencies: - name: jitsi-meet repository: "" - version: 1.2.2 -digest: sha256:f27d02481ecd087ba8c56aa5e8f76e97f177ff8488a17b016e4bc1c54c253f23 -generated: "2022-05-20T21:45:04.926228+08:00" + version: 1.2.2+etherpad.1 +digest: sha256:8ef0f113e499152fd5b0a2861d93713bdd3e9e4ea0e57b7be2992a7947e748ff +generated: "2022-05-22T10:40:05.978749+08:00" diff --git a/jitsi/Chart.yaml b/jitsi/Chart.yaml index 090dd2a..830fc6a 100644 --- a/jitsi/Chart.yaml +++ b/jitsi/Chart.yaml @@ -1,7 +1,7 @@ --- apiVersion: v2 name: jitsi-deploy -version: 0.1.2 +version: 0.1.3 dependencies: - name: jitsi-meet - version: 1.2.2 + version: "1.2.2+etherpad.1" diff --git a/jitsi/charts/jitsi-meet/Chart.yaml b/jitsi/charts/jitsi-meet/Chart.yaml index 1732002..dc70853 100644 --- a/jitsi/charts/jitsi-meet/Chart.yaml +++ b/jitsi/charts/jitsi-meet/Chart.yaml @@ -3,9 +3,8 @@ appVersion: stable-7287 dependencies: - condition: prosody.enabled name: prosody - repository: "" version: 1.2.2 description: A Helm chart for Kubernetes name: jitsi-meet type: application -version: 1.2.2 +version: "1.2.2+etherpad.1" diff --git a/jitsi/charts/jitsi-meet/templates/etherpad/_helper.tpl b/jitsi/charts/jitsi-meet/templates/etherpad/_helper.tpl new file mode 100644 index 0000000..e0b52b6 --- /dev/null +++ b/jitsi/charts/jitsi-meet/templates/etherpad/_helper.tpl @@ -0,0 +1,13 @@ +{{- define "jitsi-meet.etherpad.fullname" -}} +{{ include "jitsi-meet.fullname" . }}-etherpad +{{- end -}} + +{{- define "jitsi-meet.etherpad.labels" -}} +{{ include "jitsi-meet.labels" . }} +app.kubernetes.io/component: etherpad +{{- end -}} + +{{- define "jitsi-meet.etherpad.selectorLabels" -}} +{{ include "jitsi-meet.selectorLabels" . }} +app.kubernetes.io/component: etherpad +{{- end -}} diff --git a/jitsi/charts/jitsi-meet/templates/etherpad/deployment.yaml b/jitsi/charts/jitsi-meet/templates/etherpad/deployment.yaml new file mode 100644 index 0000000..ff84f5a --- /dev/null +++ b/jitsi/charts/jitsi-meet/templates/etherpad/deployment.yaml @@ -0,0 +1,48 @@ +{{- if .Values.etherpad.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "jitsi-meet.etherpad.fullname" . }} + labels: + {{- include "jitsi-meet.etherpad.labels" . | nindent 4 }} + {{- with .Values.etherpad.annotations }} + annotations: + {{ toYaml . | nindent 4 }} + {{- end }} +spec: + replicas: 1 + selector: + matchLabels: + {{- include "jitsi-meet.etherpad.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "jitsi-meet.etherpad.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "jitsi-meet.serviceAccountName" . }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.etherpad.securityContext | nindent 12 }} + image: "{{ .Values.etherpad.image.repository }}:{{ .Values.etherpad.image.tag }}" + imagePullPolicy: {{ pluck "pullPolicy" .Values.etherpad.image .Values.image | first }} + ports: + - name: http + containerPort: 9001 + protocol: TCP + {{- with .Values.etherpad.livenessProbe }} + livenessProbe: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.etherpad.readinessProbe }} + readinessProbe: + {{- toYaml . | nindent 12 }} + {{- end }} + + resources: + {{- toYaml .Values.etherpad.resources | nindent 12 }} +{{- end }} diff --git a/jitsi/charts/jitsi-meet/templates/etherpad/service.yaml b/jitsi/charts/jitsi-meet/templates/etherpad/service.yaml new file mode 100644 index 0000000..9b00512 --- /dev/null +++ b/jitsi/charts/jitsi-meet/templates/etherpad/service.yaml @@ -0,0 +1,17 @@ +{{- if .Values.etherpad.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ include "jitsi-meet.etherpad.fullname" . }} + labels: + {{- include "jitsi-meet.etherpad.labels" . | nindent 4 }} +spec: + type: ClusterIP + ports: + - name: http + port: 9001 + targetPort: 9001 + protocol: TCP + selector: + {{- include "jitsi-meet.etherpad.selectorLabels" . | nindent 4 }} +{{- end }} diff --git a/jitsi/charts/jitsi-meet/templates/web/configmap.yaml b/jitsi/charts/jitsi-meet/templates/web/configmap.yaml index 718a134..ca3a48f 100644 --- a/jitsi/charts/jitsi-meet/templates/web/configmap.yaml +++ b/jitsi/charts/jitsi-meet/templates/web/configmap.yaml @@ -17,6 +17,9 @@ data: ENABLE_RECORDING: "true" ENABLE_FILE_RECORDING_SERVICE_SHARING: "true" {{- end }} + {{- if .Values.etherpad.enabled}} + ETHERPAD_URL_BASE: 'http://{{ include "jitsi-meet.etherpad.fullname" . }}.{{ .Release.Namespace }}.svc:9001' + {{- end }} {{- range $key, $value := .Values.web.extraEnvs }} {{- if not (kindIs "invalid" $value) }} {{ $key }}: {{ tpl $value $ | quote }} diff --git a/jitsi/charts/jitsi-meet/values.yaml b/jitsi/charts/jitsi-meet/values.yaml index 312b124..8c14dc8 100644 --- a/jitsi/charts/jitsi-meet/values.yaml +++ b/jitsi/charts/jitsi-meet/values.yaml @@ -252,6 +252,24 @@ jibri: extraEnvs: {} +etherpad: + enabled: false + + image: + repository: etherpad/etherpad + tag: 1.8.18 + + livenessProbe: + httpGet: + path: / + port: 9001 + readinessProbe: + httpGet: + path: / + port: 9001 + + resources: {} + serviceAccount: # Specifies whether a service account should be created create: true diff --git a/jitsi/templates/etherpad/deployment.yaml b/jitsi/templates/etherpad/deployment.yaml deleted file mode 100644 index a3ce8d6..0000000 --- a/jitsi/templates/etherpad/deployment.yaml +++ /dev/null @@ -1,30 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ .Release.Name }}-etherpad - namespace: {{ .Release.Namespace }} - labels: - app.kubernetes.io/name: etherpad - app.kubernetes.io/instance: {{ .Release.Name }} -spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/name: etherpad - app.kubernetes.io/instance: {{ .Release.Name }} - template: - metadata: - labels: - app.kubernetes.io/name: etherpad - app.kubernetes.io/instance: {{ .Release.Name }} - spec: - containers: - - name: etherpad - image: "etherpad/etherpad:1.8.18" - imagePullPolicy: IfNotPresent - ports: - - name: http - containerPort: 9001 - protocol: TCP - resources: - {{- toYaml .Values.etherpad.resources | nindent 12 }} diff --git a/jitsi/templates/etherpad/service.yaml b/jitsi/templates/etherpad/service.yaml deleted file mode 100644 index c15dade..0000000 --- a/jitsi/templates/etherpad/service.yaml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ .Release.Name }}-etherpad - namespace: {{ .Release.Namespace }} - labels: - app.kubernetes.io/name: etherpad - app.kubernetes.io/instance: {{ .Release.Name }} -spec: - type: ClusterIP - ports: - - port: 9001 - protocol: TCP - name: http - selector: - app.kubernetes.io/name: etherpad - app.kubernetes.io/instance: {{ .Release.Name }} diff --git a/jitsi/values.yaml b/jitsi/values.yaml index d309009..ab28f7b 100755 --- a/jitsi/values.yaml +++ b/jitsi/values.yaml @@ -12,8 +12,6 @@ jitsi-meet: tz: Asia/Shanghai web: - extraEnvs: - ETHERPAD_URL_BASE: "" ingress: enabled: false @@ -27,7 +25,6 @@ jitsi-meet: jvb: service: - # enabled: true type: NodePort UDPPort: 30000 @@ -42,3 +39,6 @@ jitsi-meet: enabled: true publicIP: "" + + etherpad: + enabled: true