Skip to content

Commit bb61eef

Browse files
authored
Lk jwt (#13)
* charts/lk-jwt/ * lk-jwt
1 parent 89e1091 commit bb61eef

File tree

8 files changed

+195
-0
lines changed

8 files changed

+195
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ helm repo add code-tool https://code-tool.github.io/matrix-stack/
1515
1. `sentry-webhook` - for webhook from sentry to matrix chat
1616
1. `webhook` - for webhook from slack-compatible clients to matrix chat
1717
1. `matrix-alertmanager-receiver` - for webhook from Prometheus Alertmanager to matrix chat
18+
1. `livekit-jwt` - for LiveKit management service
1819

1920

2021
## Visualisation

charts/livekit-jwt/Chart.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
apiVersion: v2
3+
name: livekit-jwt
4+
version: 0.0.1
5+
sources:
6+
- https://github.com/element-hq/lk-jwt-service
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{{/*
2+
Selector labels
3+
*/}}
4+
{{- define "livekit-jwt.selectorLabels" -}}
5+
app: livekit
6+
component: livekit-jwt
7+
{{- end }}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: livekit-jwt
5+
labels:
6+
{{- include "livekit-jwt.selectorLabels" . | nindent 4 }}
7+
spec:
8+
{{- if not .Values.autoscaling.enabled }}
9+
replicas: {{ .Values.replicas }}
10+
{{- end }}
11+
selector:
12+
matchLabels:
13+
{{- include "livekit-jwt.selectorLabels" . | nindent 6 }}
14+
{{- if .Values.updateStrategy }}
15+
strategy:
16+
{{ toYaml .Values.updateStrategy | nindent 4 }}
17+
{{- end }}
18+
template:
19+
metadata:
20+
annotations:
21+
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") $ | sha256sum }}
22+
{{- with .Values.podAnnotations }}
23+
{{- toYaml . | nindent 8 }}
24+
{{- end }}
25+
labels:
26+
{{- include "livekit-jwt.selectorLabels" . | nindent 8 }}
27+
spec:
28+
containers:
29+
- name: livekit-jwt
30+
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
31+
imagePullPolicy: {{ .Values.image.pullPolicy }}
32+
env:
33+
- name: "LK_JWT_PORT"
34+
value: "8080"
35+
- name: "LIVEKIT_URL"
36+
value: {{ .Values.config.url }}
37+
envFrom:
38+
- secretRef:
39+
name: livekit-jwt
40+
ports:
41+
- name: http
42+
containerPort: 8080
43+
protocol: TCP
44+
livenessProbe:
45+
{{- toYaml .Values.livenessProbe | nindent 12 }}
46+
readinessProbe:
47+
{{- toYaml .Values.readinessProbe | nindent 12 }}
48+
resources:
49+
{{- toYaml .Values.resources | nindent 12 }}
50+
{{- if .Values.nodeSelector }}
51+
nodeSelector:
52+
{{ toYaml .Values.nodeSelector | nindent 8 }}
53+
{{- end }}
54+
{{- if .Values.tolerations }}
55+
tolerations:
56+
{{ toYaml .Values.tolerations | nindent 8 }}
57+
{{- end }}
58+
{{- if .Values.affinity }}
59+
affinity:
60+
{{ toYaml .Values.affinity | nindent 8 }}
61+
{{- end }}
62+
{{- if .Values.topologySpreadConstraints }}
63+
topologySpreadConstraints:
64+
{{ toYaml .Values.topologySpreadConstraints | nindent 8 }}
65+
{{- end }}
66+
{{- if .Values.priorityClassName }}
67+
priorityClassName: "{{ .Values.priorityClassName }}"
68+
{{- end }}

charts/livekit-jwt/templates/hpa.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{{- if .Values.autoscaling.enabled }}
2+
---
3+
{{- if semverCompare ">=1.23-0" .Capabilities.KubeVersion.GitVersion }}
4+
apiVersion: autoscaling/v2
5+
{{- else }}
6+
apiVersion: autoscaling/v2beta1
7+
{{- end }}
8+
kind: HorizontalPodAutoscaler
9+
metadata:
10+
name: livekit-jwt
11+
labels:
12+
{{- include " livekit-jwt.selectorLabels" . | nindent 4 }}
13+
spec:
14+
scaleTargetRef:
15+
apiVersion: apps/v1
16+
kind: Deployment
17+
name: livekit-jwt
18+
minReplicas: {{ .Values.autoscaling.minReplicas }}
19+
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
20+
metrics:
21+
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
22+
- type: Resource
23+
resource:
24+
name: cpu
25+
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
26+
{{- end }}
27+
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
28+
- type: Resource
29+
resource:
30+
name: memory
31+
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
32+
{{- end }}
33+
{{- end }}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
apiVersion: v1
3+
kind: Secret
4+
metadata:
5+
name: livekit-jwt
6+
labels:
7+
{{- include "livekit-jwt.selectorLabels" . | nindent 4 }}
8+
data:
9+
LIVEKIT_KEY: {{ .Values.config.key | b64enc }}
10+
LIVEKIT_SECRET: {{ .Values.config.secret | b64enc }}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: livekit-jwt
6+
labels:
7+
{{- include "livekit-jwt.selectorLabels" . | nindent 4 }}
8+
spec:
9+
selector:
10+
{{- include "livekit-jwt.selectorLabels" . | nindent 4 }}
11+
type: ClusterIP
12+
ports:
13+
- port: 80
14+
targetPort: http
15+
protocol: TCP
16+
name: http

charts/livekit-jwt/values.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
config:
2+
url:
3+
key: key
4+
secret: secret
5+
6+
image:
7+
repository: ghcr.io/element-hq/lk-jwt-service
8+
tag: 0.0.1
9+
pullPolicy: IfNotPresent
10+
11+
replicas: 1
12+
13+
autoscaling:
14+
enabled: false
15+
minReplicas: 1
16+
maxReplicas: 10
17+
targetCPUUtilizationPercentage: 80
18+
# targetMemoryUtilizationPercentage: 80
19+
20+
livenessProbe:
21+
httpGet:
22+
path: /healthz
23+
port: http
24+
readinessProbe:
25+
httpGet:
26+
path: /healthz
27+
port: http
28+
29+
resources: {}
30+
# limits:
31+
# cpu: 100m
32+
# memory: 64Mi
33+
# requests:
34+
# cpu: 100m
35+
# memory: 64Mi
36+
podAnnotations: {}
37+
nodeSelector: {}
38+
tolerations: []
39+
affinity: {}
40+
updateStrategy:
41+
type: RollingUpdate
42+
rollingUpdate:
43+
maxUnavailable: 1
44+
maxSurge: 25%
45+
priorityClassName: ''
46+
topologySpreadConstraints: []
47+
# example
48+
#topologySpreadConstraints:
49+
# - maxSkew: 1
50+
# topologyKey: failure-domain.beta.kubernetes.io/zone
51+
# whenUnsatisfiable: ScheduleAnyway
52+
# labelSelector:
53+
# matchLabels:
54+
# kubernetes.io/os: linux

0 commit comments

Comments
 (0)