etherpad start/stop cronjobs

pull/14/head
Wei He 4 years ago committed by Wei He
parent aad7a1fa7f
commit 77baaf3d5c
  1. 2
      jitsi/Chart.yaml
  2. 2
      jitsi/charts/jitsi-meet/templates/etherpad/deployment.yaml
  3. 1
      jitsi/charts/jitsi-meet/values.yaml
  4. 15
      jitsi/templates/etherpad-schedule/cluster-role-binding.yaml
  5. 18
      jitsi/templates/etherpad-schedule/cluster-role.yaml
  6. 54
      jitsi/templates/etherpad-schedule/cronjob.yaml
  7. 7
      jitsi/templates/etherpad-schedule/serviceacount.yaml
  8. 6
      jitsi/values.yaml

@ -1,7 +1,7 @@
--- ---
apiVersion: v2 apiVersion: v2
name: jitsi-deploy name: jitsi-deploy
version: 0.1.3 version: 0.1.4
dependencies: dependencies:
- name: jitsi-meet - name: jitsi-meet
version: "1.2.2+etherpad.1" version: "1.2.2+etherpad.1"

@ -10,7 +10,7 @@ metadata:
{{ toYaml . | nindent 4 }} {{ toYaml . | nindent 4 }}
{{- end }} {{- end }}
spec: spec:
replicas: 1 replicas: {{ .Values.etherpad.replicaCount }}
selector: selector:
matchLabels: matchLabels:
{{- include "jitsi-meet.etherpad.selectorLabels" . | nindent 6 }} {{- include "jitsi-meet.etherpad.selectorLabels" . | nindent 6 }}

@ -254,6 +254,7 @@ jibri:
etherpad: etherpad:
enabled: false enabled: false
replicaCount: 1
image: image:
repository: etherpad/etherpad repository: etherpad/etherpad

@ -0,0 +1,15 @@
{{- if .Values.etherpad.scheduled }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ .Release.Name }}-etherpad-scale-role-binding
subjects:
- namespace: {{ .Release.Namespace }}
kind: ServiceAccount
name: {{ .Release.Name }}-etherpad-startstop-account
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ .Release.Name }}-etherpad-scale-role
{{- end }}

@ -0,0 +1,18 @@
{{- if .Values.etherpad.scheduled }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ .Release.Name }}-etherpad-scale-role
rules:
- apiGroups:
- apps
resources:
- deployments
verbs: [ "get" ]
- apiGroups:
- apps
resources:
- deployments/scale
verbs: [ "patch" ]
{{- end }}

@ -0,0 +1,54 @@
{{- if .Values.etherpad.scheduled }}
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: {{ .Release.Name }}-start-etherpad
spec:
schedule: {{ .Values.etherpad.schedules.start }}
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 1
jobTemplate:
spec:
template:
spec:
restartPolicy: OnFailure
containers:
- name: kubectl
image: bitnami/kubectl:1.23
imagePullPolicy: IfNotPresent
args:
- -n
- {{ .Release.Namespace }}
- scale
- deployment
- {{ .Release.Name }}-jitsi-meet-etherpad
- --replicas=1
serviceAccountName: {{ .Release.Name }}-etherpad-startstop-account
---
apiVersion: batch/v1
kind: CronJob
metadata:
name: {{ .Release.Name }}-stop-etherpad
spec:
schedule: {{ .Values.etherpad.schedules.stop }}
successfulJobsHistoryLimit: 1
failedJobsHistoryLimit: 1
jobTemplate:
spec:
template:
spec:
restartPolicy: OnFailure
containers:
- name: kubectl
image: bitnami/kubectl:1.23
imagePullPolicy: IfNotPresent
args:
- -n
- {{ .Release.Namespace }}
- scale
- deployment
- {{ .Release.Name }}-jitsi-meet-etherpad
- --replicas=0
serviceAccountName: {{ .Release.Name }}-etherpad-startstop-account
{{- end }}

@ -0,0 +1,7 @@
{{- if .Values.etherpad.scheduled }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Release.Name }}-etherpad-startstop-account
{{- end }}

@ -4,7 +4,10 @@ certResolver: le-staging
fqdn: "" fqdn: ""
etherpad: etherpad:
resources: {} scheduled: false
schedules:
start: ""
stop: ""
jitsi-meet: jitsi-meet:
publicURL: "" publicURL: ""
@ -42,3 +45,4 @@ jitsi-meet:
etherpad: etherpad:
enabled: true enabled: true
replicaCount: 1

Loading…
Cancel
Save