Skip to content

Commit

Permalink
Egress (#27)
Browse files Browse the repository at this point in the history
* dump

* undo lk server rename

* update version
  • Loading branch information
frostbyte73 authored May 19, 2022
1 parent b46ecff commit cfa8755
Show file tree
Hide file tree
Showing 17 changed files with 144 additions and 142 deletions.
4 changes: 2 additions & 2 deletions deploy-recorder.sh → deploy-egress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ set -euxo pipefail

rm -rf build
mkdir -p build
helm package livekit-recorder --destination build
helm package egress --destination build
cd build
AWS_REGION=us-east-1 helm s3 push --relative ./livekit-recorder*.tgz livekit
AWS_REGION=us-east-1 helm s3 push --relative ./egress*.tgz livekit

aws cloudfront create-invalidation --distribution-id E2MJ94T12TAUZU --paths "/*"
61 changes: 30 additions & 31 deletions livekit-recorder/values.yaml → egress-sample.yaml
Original file line number Diff line number Diff line change
@@ -1,54 +1,53 @@
# Default values for livekit-recorder.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 1

image:
repository: livekit/livekit-recorder
pullPolicy: IfNotPresent

# configuration for recorder
recorder:
egress:
api_key: "server-api-key"
api_secret: "server-api-secret"
ws_url: "ws://livekit-host:<port>"
log_level: info
# ws_url: "wss://your-livekit-domain"
# api_key: "server-api-key"
# api_secret: "server-api-secret"
health_port: 8080
# redis:
# address: <redis_host:port>
prometheus_port: 9090
# template_base: "https://your-custom-template.com"
redis:
address: <redis_host:port>
# db: 0
# username:
# password:
# defaults:
# width: 1920
# height: 1080
# depth: 24
# framerate: 30
# audio_bitrate: 128
# audio_frequency: 44100
# video_bitrate: 4500
s3:
access_key: "access_key"
secret: "secret"
region: "us-west-2"
# endpoint:
bucket: "my-egress"
# azure:
# account_name:
# account_key:
# container_name:
# gcp:
# credentials_json:
# bucket:

nameOverride: ""
fullnameOverride: ""

# autoscaling requires resources to be defined
autoscaling:
# set to true to enable autoscaling. when set, ignores replicaCount
enabled: false
minReplicas: 1
maxReplicas: 5
targetMemoryUtilizationPercentage: 50
targetCPUUtilizationPercentage: 60

# if egress should run only on specific nodes
# this can be used to isolate designated nodes
nodeSelector: {}
# node.kubernetes.io/instance-type: c5.2xlarge

resources: {}
# requests:
# cpu: 3000m
# memory: 500Mi
# limits:
# cpu: 5000m
# memory: 1500Mi
# memory: 1024Mi
# limits:
# cpu: 8000m
# memory: 2048Mi

serviceAccount:
# Specifies whether a service account should be created
Expand All @@ -71,7 +70,7 @@ securityContext: {}
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsNonRoot: true
# runAsUser: 1000

tolerations: []
Expand Down
File renamed without changes.
9 changes: 9 additions & 0 deletions egress/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v2
name: egress
description: Egress is used by LiveKit to stream and record rooms.
type: application
version: 1.0.0
appVersion: "v1.0.0"

sources:
- https://github.com/livekit/egress
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-------------------------------------------------------------------------------

LiveKit Recorder {{ .Values.image.tag | default .Chart.AppVersion }} has been deployed!
LiveKit Egress {{ .Values.image.tag | default .Chart.AppVersion }} has been deployed!

-------------------------------------------------------------------------------
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "livekit-recorder.name" -}}
{{- define "egress.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

Expand All @@ -10,7 +10,7 @@ Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "livekit-recorder.fullname" -}}
{{- define "egress.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
Expand All @@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name.
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "livekit-recorder.chart" -}}
{{- define "egress.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "livekit-recorder.labels" -}}
helm.sh/chart: {{ include "livekit-recorder.chart" . }}
{{ include "livekit-recorder.selectorLabels" . }}
{{- define "egress.labels" -}}
helm.sh/chart: {{ include "egress.chart" . }}
{{ include "egress.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
Expand All @@ -45,17 +45,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/*
Selector labels
*/}}
{{- define "livekit-recorder.selectorLabels" -}}
app.kubernetes.io/name: {{ include "livekit-recorder.name" . }}
{{- define "egress.selectorLabels" -}}
app.kubernetes.io/name: {{ include "egress.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "livekit-recorder.serviceAccountName" -}}
{{- define "egress.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "livekit-recorder.fullname" .) .Values.serviceAccount.name }}
{{- default (include "egress.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
Expand Down
7 changes: 7 additions & 0 deletions egress/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "egress.fullname" . }}
data:
config.yaml: |
{{ toYaml .Values.egress | indent 4 }}
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "livekit-recorder.fullname" . }}
name: {{ include "egress.fullname" . }}
labels:
{{- include "livekit-recorder.labels" . | nindent 4 }}
{{- include "egress.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "livekit-recorder.selectorLabels" . | nindent 6 }}
{{- include "egress.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "livekit-recorder.selectorLabels" . | nindent 8 }}
{{- include "egress.selectorLabels" . | nindent 8 }}
spec:
serviceAccountName: {{ include "livekit-recorder.serviceAccountName" . }}
serviceAccountName: {{ include "egress.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
Expand All @@ -30,27 +30,30 @@ spec:
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: SERVICE_MODE
value: "1"
- name: LIVEKIT_RECORDER_CONFIG
- name: EGRESS_CONFIG_BODY
valueFrom:
configMapKeyRef:
name: {{ include "livekit-recorder.fullname" . }}
name: {{ include "egress.fullname" . }}
key: config.yaml
ports:
{{- if .Values.recorder.health_port }}
- name: http
containerPort: {{ .Values.recorder.health_port }}
{{- if .Values.egress.health_port }}
- name: health
containerPort: {{ .Values.egress.health_port }}
protocol: TCP
{{- end }}
{{- if .Values.egress.prometheus_port }}
- name: metrics
containerPort: {{ .Values.egress.prometheus_port }}
protocol: TCP
{{- end }}
livenessProbe:
httpGet:
path: /
port: http
port: health
readinessProbe:
httpGet:
path: /
port: http
port: health
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "livekit-recorder.fullname" . }}
name: {{ include "egress.fullname" . }}
labels:
{{- include "livekit-recorder.labels" . | nindent 4 }}
{{- include "egress.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "livekit-recorder.fullname" . }}
name: {{ include "egress.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "livekit-recorder.serviceAccountName" . }}
name: {{ include "egress.serviceAccountName" . }}
labels:
{{- include "livekit-recorder.labels" . | nindent 4 }}
{{- include "egress.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down
44 changes: 44 additions & 0 deletions egress/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Default values for egress.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 1

image:
repository: livekit/egress
pullPolicy: IfNotPresent

egress:
log_level: info
health_port: 8080
prometheus_port: 9090

nameOverride: ""
fullnameOverride: ""

autoscaling:
enabled: false
minReplicas: 1
maxReplicas: 5
targetMemoryUtilizationPercentage: 50

nodeSelector: {}

resources: {}

serviceAccount:
create: false
annotations: {}
name: ""

podAnnotations:
sidecar.istio.io/inject: "false"
linkerd.io/inject: disabled

podSecurityContext: {}

securityContext: {}

tolerations: []

affinity: {}
16 changes: 16 additions & 0 deletions examples/egress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
replicaCount: 2

egress:
ws_url: <ws_url>
api_key: <api_key>
api_secret: <secret>
log_level: info
health_port: 8080
prometheus_port: 9090
redis:
address: <redis_host:port>
s3:
access_key: <access_key>
secret: <secret>
region: "us-west-2"
bucket: "my-egress"
9 changes: 0 additions & 9 deletions examples/recorder.yaml

This file was deleted.

9 changes: 0 additions & 9 deletions livekit-recorder/Chart.yaml

This file was deleted.

7 changes: 0 additions & 7 deletions livekit-recorder/templates/configmap.yaml

This file was deleted.

6 changes: 3 additions & 3 deletions livekit-server/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: livekit-server
description: Open source WebRTC infrastructure. Host your own real-time video/audio experiences.
type: application
version: 0.15.7
appVersion: "v0.15.7"
version: 1.0.0
appVersion: "v1.0.0"

sources:
- https://github.com/livekit/livekit-server
- https://github.com/livekit/livekit
Loading

0 comments on commit cfa8755

Please sign in to comment.