From 2bd53a610dab45dc612b69ad0de2c01b84a9b270 Mon Sep 17 00:00:00 2001 From: Andrew Todd Date: Tue, 16 Sep 2025 10:19:54 -0400 Subject: [PATCH 01/17] feat: add gh-pages release workflow --- .github/workflows/release.yml | 167 ++++++++++++++++++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..755712f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,167 @@ +name: Release Helm Charts + +# Do not change this +concurrency: release-helm + +on: + workflow_dispatch: + push: + +jobs: + release: + runs-on: ubuntu-latest + outputs: + changed-charts: ${{ steps.get-changed-charts.outputs.changed-charts }} + steps: + + - name: Checkout + uses: actions/checkout@v4 + with: + path: 'src' + fetch-depth: 0 + + - name: Checkout + uses: actions/checkout@v4 + with: + path: 'dest' + ref: 'gh-pages' + fetch-depth: 0 + + - name: Install Helm + uses: azure/setup-helm@v1 + + - name: Set version to -prerelease on non-major branches + if: github.ref != 'refs/heads/main' + shell: bash + run: | + for chart in $(find . -type f -name 'Chart.yaml'); do + yq e '.version |= (. + "-prerelease")' ${chart} > tmp-Chart.yaml + mv tmp-Chart.yaml ${chart} + done + + - name: Sync README.md + if: github.ref == 'refs/heads/main' + shell: bash + run: | + cp src/README.md dest/README.md + + - name: Package Helm Charts + shell: bash + run: | + find . -type f -name 'Chart.yaml' | sed -r 's|/[^/]+$||' | sort | uniq | xargs -L 1 helm dep up + for d in `find ./* -type d -maxdepth 0 -not -name examples` ; do + echo "$d" + helm package "$d" -u -d dest + done + + - name: Push New Files + shell: bash + working-directory: dest + run: | + helm repo index . --url https://raw.githubusercontent.com/laerdallabs/livekit-helm/gh-pages/ + git config user.name "Helm Updater" + git config user.email "actions@users.noreply.github.com" + git add . + git commit -m "Updated from ref: $GITHUB_SHA" + git push + + - name: Identify Updated Charts + id: get-changed-charts + if: github.ref == 'refs/heads/main' + shell: bash + working-directory: src + run: | + changed_charts="$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep "Chart.yaml" | jq -R . | jq -sc .)" + echo "changed-charts=${changed_charts}" + echo "changed-charts=${changed_charts}" >> $GITHUB_OUTPUT + + create-releases: + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + needs: release + strategy: + matrix: + chart: ${{fromJson(needs.release.outputs.changed-charts)}} + steps: + + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Checkout + uses: actions/checkout@v4 + with: + path: 'gh-pages' + ref: 'gh-pages' + fetch-depth: 0 + + - name: Set Release Vars + id: set-vars + run: | + chart_name="$(yq e '.name' ${{ matrix.chart }})" + chart_version="$(yq e '.version' ${{ matrix.chart }})" + chart_description="$(yq e '.description' ${{ matrix.chart }})" + release_tag="${chart_name}-${chart_version}" + + echo "chart_name=${chart_name}" + echo "chart_version=${chart_version}" + echo "chart_description=${chart_description}" + echo "release_tag=${release_tag}" + + echo "chart_name=${chart_name}" >> $GITHUB_OUTPUT + echo "chart_version=${chart_version}" >> $GITHUB_OUTPUT + echo "chart_description=${chart_description}" >> $GITHUB_OUTPUT + echo "release_tag=${release_tag}" >> $GITHUB_OUTPUT + + - name: Create GitHub Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + + # Define the JSON payload + JSON_PAYLOAD=$(jq -n \ + --arg tag_name "${{ steps.set-vars.outputs.release_tag }}" \ + --arg body "${{ steps.set-vars.outputs.chart_description }}" \ + --arg name "${{ steps.set-vars.outputs.release_tag }}" \ + '{ + tag_name: $tag_name, + name: $name, + body: $body, + draft: false, + prerelease: false + }') + + # Make the API request + RESPONSE=$(curl -XPOST \ + -H "Accept: application/vnd.github.v3+json" \ + -H "Authorization: token $GITHUB_TOKEN" \ + --data "$JSON_PAYLOAD" \ + "https://api.github.com/repos/${GITHUB_REPOSITORY}/releases") + + # Output the response (optional) + echo "$RESPONSE" + + - name: Upload Release Asset + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + ASSET_PATH="gh-pages/${{ steps.set-vars.outputs.release_tag }}.tgz" + ASSET_NAME="$(basename ${ASSET_PATH})" + + # Retrieve the ID of the created release + RELEASE_ID="$( + curl -sH "Authorization: token $GITHUB_TOKEN" \ + "https://api.github.com/repos/${GITHUB_REPOSITORY}/releases/tags/${{ steps.set-vars.outputs.release_tag }}" \ + | jq -r '.id' + )" + + # Get the correct upload URL for the asset + UPLOAD_URL="https://uploads.github.com/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=$(basename $ASSET_PATH)" + + # Upload the asset + curl -XPOST \ + --data-binary @"$ASSET_PATH" \ + -H "Authorization: token $GITHUB_TOKEN" \ + -H "Content-Type: application/octet-stream" \ + "$UPLOAD_URL" From 541a467c36366fa6d5772d13e7dd22e24af7307d Mon Sep 17 00:00:00 2001 From: Andrew Todd Date: Tue, 16 Sep 2025 10:20:01 -0400 Subject: [PATCH 02/17] feat: add podLabels --- livekit-server/templates/_helpers.tpl | 7 +++++++ livekit-server/templates/deployment.yaml | 1 + livekit-server/values.yaml | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/livekit-server/templates/_helpers.tpl b/livekit-server/templates/_helpers.tpl index e136477..8142ba8 100644 --- a/livekit-server/templates/_helpers.tpl +++ b/livekit-server/templates/_helpers.tpl @@ -50,6 +50,13 @@ app.kubernetes.io/name: {{ include "livekit-server.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} +{{/* +Pod labels +*/}} +{{- define "livekit-server.podLabels" -}} + +{{- end }} + {{/* Create the name of the service account to use */}} diff --git a/livekit-server/templates/deployment.yaml b/livekit-server/templates/deployment.yaml index 7b35cee..e30ddb2 100644 --- a/livekit-server/templates/deployment.yaml +++ b/livekit-server/templates/deployment.yaml @@ -28,6 +28,7 @@ spec: checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} labels: {{- include "livekit-server.selectorLabels" . | nindent 8 }} + {{- include "livekit-server.podLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: diff --git a/livekit-server/values.yaml b/livekit-server/values.yaml index bcf6d51..195b65e 100644 --- a/livekit-server/values.yaml +++ b/livekit-server/values.yaml @@ -110,6 +110,11 @@ podAnnotations: sidecar.istio.io/inject: "false" linkerd.io/inject: disabled +podLabels: + {} + # environment: production + # tier: frontend + podSecurityContext: {} # fsGroup: 2000 From 9dd1970ab5fc6eec30d80a309dded018c2197fb9 Mon Sep 17 00:00:00 2001 From: Andrew Todd Date: Tue, 16 Sep 2025 10:44:08 -0400 Subject: [PATCH 03/17] Deployment troubleshooting --- .github/workflows/release.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 755712f..2369e3d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,7 +18,6 @@ jobs: uses: actions/checkout@v4 with: path: 'src' - fetch-depth: 0 - name: Checkout uses: actions/checkout@v4 @@ -45,11 +44,15 @@ jobs: run: | cp src/README.md dest/README.md + - name: debug stuff + shell: bash + run: find . + - name: Package Helm Charts shell: bash run: | find . -type f -name 'Chart.yaml' | sed -r 's|/[^/]+$||' | sort | uniq | xargs -L 1 helm dep up - for d in `find ./* -type d -maxdepth 0 -not -name examples` ; do + for d in `find ./src/* -type d -maxdepth 0 -not -name examples` ; do echo "$d" helm package "$d" -u -d dest done From 255d440cd29174fd05d6c024b5fcb1c02181c370 Mon Sep 17 00:00:00 2001 From: Andrew Todd Date: Tue, 16 Sep 2025 11:04:57 -0400 Subject: [PATCH 04/17] Fix podLabels --- livekit-server/templates/_helpers.tpl | 7 ------- livekit-server/templates/deployment.yaml | 4 +++- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/livekit-server/templates/_helpers.tpl b/livekit-server/templates/_helpers.tpl index 8142ba8..e136477 100644 --- a/livekit-server/templates/_helpers.tpl +++ b/livekit-server/templates/_helpers.tpl @@ -50,13 +50,6 @@ app.kubernetes.io/name: {{ include "livekit-server.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} -{{/* -Pod labels -*/}} -{{- define "livekit-server.podLabels" -}} - -{{- end }} - {{/* Create the name of the service account to use */}} diff --git a/livekit-server/templates/deployment.yaml b/livekit-server/templates/deployment.yaml index e30ddb2..8b0e390 100644 --- a/livekit-server/templates/deployment.yaml +++ b/livekit-server/templates/deployment.yaml @@ -28,7 +28,9 @@ spec: checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} labels: {{- include "livekit-server.selectorLabels" . | nindent 8 }} - {{- include "livekit-server.podLabels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: From 046dacdf0f78b6285e341148e8bf2d417f63a3ae Mon Sep 17 00:00:00 2001 From: Andrew Todd Date: Tue, 16 Sep 2025 11:49:17 -0400 Subject: [PATCH 05/17] fetch-depth 0 --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2369e3d..4e38707 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,6 +18,7 @@ jobs: uses: actions/checkout@v4 with: path: 'src' + fetch-depth: 0 - name: Checkout uses: actions/checkout@v4 From 7f4a41850f0edbfe7398617f87d2dd9934f6b828 Mon Sep 17 00:00:00 2001 From: Andrew Todd Date: Tue, 16 Sep 2025 12:15:04 -0400 Subject: [PATCH 06/17] debug --- .github/workflows/release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4e38707..119267e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,7 +47,9 @@ jobs: - name: debug stuff shell: bash - run: find . + run: | + find . + jq --version - name: Package Helm Charts shell: bash From 8e44e54e10f6aad0cf9b846cc105ef3467f0b44c Mon Sep 17 00:00:00 2001 From: Andrew Todd Date: Tue, 16 Sep 2025 12:19:01 -0400 Subject: [PATCH 07/17] debug --- .github/workflows/release.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 119267e..8ba5d17 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -77,6 +77,10 @@ jobs: shell: bash working-directory: src run: | + jq --version + git log ${{ github.event.before }} + git log ${{ github.event.after }} + git diff --name-only ${{ github.event.before }} ${{ github.event.after }} changed_charts="$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep "Chart.yaml" | jq -R . | jq -sc .)" echo "changed-charts=${changed_charts}" echo "changed-charts=${changed_charts}" >> $GITHUB_OUTPUT From ce445184422c461eebf795b7792809030f85846e Mon Sep 17 00:00:00 2001 From: Andrew Todd Date: Tue, 16 Sep 2025 12:30:23 -0400 Subject: [PATCH 08/17] debug --- .github/workflows/release.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8ba5d17..76cb549 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -77,10 +77,14 @@ jobs: shell: bash working-directory: src run: | + set -v jq --version git log ${{ github.event.before }} git log ${{ github.event.after }} git diff --name-only ${{ github.event.before }} ${{ github.event.after }} + git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep "Chart.yaml" + git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep "Chart.yaml" | jq -R . + git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep "Chart.yaml" | jq -R . | jq -sc . changed_charts="$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep "Chart.yaml" | jq -R . | jq -sc .)" echo "changed-charts=${changed_charts}" echo "changed-charts=${changed_charts}" >> $GITHUB_OUTPUT @@ -93,7 +97,6 @@ jobs: matrix: chart: ${{fromJson(needs.release.outputs.changed-charts)}} steps: - - name: Checkout uses: actions/checkout@v4 with: From 29136a087172a06b504f817d4e374dcf1469988d Mon Sep 17 00:00:00 2001 From: Andrew Todd Date: Tue, 16 Sep 2025 12:31:44 -0400 Subject: [PATCH 09/17] debug --- .github/workflows/release.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 76cb549..7da3634 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -78,9 +78,6 @@ jobs: working-directory: src run: | set -v - jq --version - git log ${{ github.event.before }} - git log ${{ github.event.after }} git diff --name-only ${{ github.event.before }} ${{ github.event.after }} git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep "Chart.yaml" git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep "Chart.yaml" | jq -R . From 730adb902d614ffad3ebad6f4115b0b18da7dde9 Mon Sep 17 00:00:00 2001 From: Andrew Todd Date: Tue, 16 Sep 2025 12:37:30 -0400 Subject: [PATCH 10/17] debug --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7da3634..a611e09 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -78,6 +78,7 @@ jobs: working-directory: src run: | set -v + set +e git diff --name-only ${{ github.event.before }} ${{ github.event.after }} git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep "Chart.yaml" git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep "Chart.yaml" | jq -R . From 22be453f6666387d32d9fc8489c4c28c647a13dd Mon Sep 17 00:00:00 2001 From: Andrew Todd Date: Tue, 16 Sep 2025 12:40:40 -0400 Subject: [PATCH 11/17] debug --- .github/workflows/release.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a611e09..22bd9ae 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -76,20 +76,15 @@ jobs: if: github.ref == 'refs/heads/main' shell: bash working-directory: src + continue-on-error: true run: | - set -v - set +e - git diff --name-only ${{ github.event.before }} ${{ github.event.after }} - git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep "Chart.yaml" - git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep "Chart.yaml" | jq -R . - git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep "Chart.yaml" | jq -R . | jq -sc . changed_charts="$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep "Chart.yaml" | jq -R . | jq -sc .)" echo "changed-charts=${changed_charts}" echo "changed-charts=${changed_charts}" >> $GITHUB_OUTPUT create-releases: runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' && needs.release.outputs.changed-charts != '[]' needs: release strategy: matrix: From 62591b42f12750bfe532fdf6f7bce7fb14e93936 Mon Sep 17 00:00:00 2001 From: Andrew Todd Date: Tue, 16 Sep 2025 12:42:33 -0400 Subject: [PATCH 12/17] Revert changes to get-changed-charts --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 22bd9ae..41d0722 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -76,7 +76,6 @@ jobs: if: github.ref == 'refs/heads/main' shell: bash working-directory: src - continue-on-error: true run: | changed_charts="$(git diff --name-only ${{ github.event.before }} ${{ github.event.after }} | grep "Chart.yaml" | jq -R . | jq -sc .)" echo "changed-charts=${changed_charts}" From 9b6120d725a7df51cff918c0dd913e537f12c0f1 Mon Sep 17 00:00:00 2001 From: Andrew Todd Date: Thu, 18 Sep 2025 14:52:48 -0400 Subject: [PATCH 13/17] add podLabels to egress --- egress/templates/deployment.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/egress/templates/deployment.yaml b/egress/templates/deployment.yaml index 4a8808a..6675643 100644 --- a/egress/templates/deployment.yaml +++ b/egress/templates/deployment.yaml @@ -20,6 +20,9 @@ spec: checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} labels: {{- include "egress.selectorLabels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} spec: serviceAccountName: {{ include "egress.serviceAccountName" . }} securityContext: From 48d3b78b7468630e3c2c9e384d87aff6824282ab Mon Sep 17 00:00:00 2001 From: Andrew Todd Date: Wed, 4 Mar 2026 14:30:40 -0500 Subject: [PATCH 14/17] add config for GST_DEBUG env var --- egress/templates/deployment.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/egress/templates/deployment.yaml b/egress/templates/deployment.yaml index 6675643..1f84528 100644 --- a/egress/templates/deployment.yaml +++ b/egress/templates/deployment.yaml @@ -40,6 +40,10 @@ spec: configMapKeyRef: name: {{ include "egress.fullname" . }} key: config.yaml + {{- if .Values.gst_debug }} + - name: GST_DEBUG + value: "{{ .Values.gst_debug }}" + {{- end }} ports: {{- if .Values.egress.health_port }} - name: health From 21de37ede951b8f491b99c24ae95a7e9d8d9bf27 Mon Sep 17 00:00:00 2001 From: Andrew Todd Date: Wed, 4 Mar 2026 14:41:29 -0500 Subject: [PATCH 15/17] fix: .Values.gst_debug -> .Values.egress.gst_debug --- egress/templates/deployment.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/egress/templates/deployment.yaml b/egress/templates/deployment.yaml index 1f84528..af1d1ad 100644 --- a/egress/templates/deployment.yaml +++ b/egress/templates/deployment.yaml @@ -40,9 +40,9 @@ spec: configMapKeyRef: name: {{ include "egress.fullname" . }} key: config.yaml - {{- if .Values.gst_debug }} + {{- if .Values.egress.gst_debug }} - name: GST_DEBUG - value: "{{ .Values.gst_debug }}" + value: "{{ .Values.egress.gst_debug }}" {{- end }} ports: {{- if .Values.egress.health_port }} From cc7ca6db4d97f56748519d91b58a9a3952d00bad Mon Sep 17 00:00:00 2001 From: Andrew Todd Date: Fri, 6 Mar 2026 16:26:48 -0500 Subject: [PATCH 16/17] chore: add external/object metric support to egress hpa --- egress/templates/hpa.yaml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/egress/templates/hpa.yaml b/egress/templates/hpa.yaml index ed1651c..ef52e85 100644 --- a/egress/templates/hpa.yaml +++ b/egress/templates/hpa.yaml @@ -42,6 +42,43 @@ spec: {{- end }} {{- end }} {{- if .Values.autoscaling.custom }} + {{- $customType := default "Pods" .Values.autoscaling.custom.type }} + {{- $describedObject := default (dict) .Values.autoscaling.custom.describedObject }} + {{- if eq $customType "Object" }} + - type: Object + object: + {{- if semverCompare ">=1.23-0" .Capabilities.KubeVersion.GitVersion }} + describedObject: + apiVersion: {{ default "v1" (get $describedObject "apiVersion") }} + kind: {{ default "Namespace" (get $describedObject "kind") }} + name: {{ default .Release.Namespace (get $describedObject "name") }} + metric: + name: {{ .Values.autoscaling.custom.metricName }} + target: + type: Value + value: {{ .Values.autoscaling.custom.targetValue }} + {{- else }} + target: + apiVersion: {{ default "v1" (get $describedObject "apiVersion") }} + kind: {{ default "Namespace" (get $describedObject "kind") }} + name: {{ default .Release.Namespace (get $describedObject "name") }} + metricName: {{ .Values.autoscaling.custom.metricName }} + targetValue: {{ .Values.autoscaling.custom.targetValue }} + {{- end }} + {{- else if eq $customType "External" }} + - type: External + external: + {{- if semverCompare ">=1.23-0" .Capabilities.KubeVersion.GitVersion }} + metric: + name: {{ .Values.autoscaling.custom.metricName }} + target: + type: Value + value: {{ .Values.autoscaling.custom.targetValue }} + {{- else }} + metricName: {{ .Values.autoscaling.custom.metricName }} + targetValue: {{ .Values.autoscaling.custom.targetValue }} + {{- end }} + {{- else }} - type: Pods pods: {{- if semverCompare ">=1.23-0" .Capabilities.KubeVersion.GitVersion }} @@ -55,4 +92,5 @@ spec: targetAverageValue: {{ .Values.autoscaling.custom.targetAverageValue }} {{- end }} {{- end }} + {{- end }} {{- end }} From 8c3eb7dc7fa183432b1babb8382aaddc5c6e86d2 Mon Sep 17 00:00:00 2001 From: James Kim Date: Tue, 14 Apr 2026 16:43:12 -0400 Subject: [PATCH 17/17] feat: add egress livekit secret refs --- egress/templates/configmap.yaml | 7 ++++++- egress/templates/deployment.yaml | 12 ++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/egress/templates/configmap.yaml b/egress/templates/configmap.yaml index 409929d..3c92e25 100644 --- a/egress/templates/configmap.yaml +++ b/egress/templates/configmap.yaml @@ -4,4 +4,9 @@ metadata: name: {{ include "egress.fullname" . }} data: config.yaml: | -{{ toYaml .Values.egress | indent 4 }} +{{- $config := deepCopy .Values.egress }} +{{- if .Values.apiSecretRef }} +{{- $config = unset $config "api_key" }} +{{- $config = unset $config "api_secret" }} +{{- end }} +{{ toYaml $config | indent 4 }} diff --git a/egress/templates/deployment.yaml b/egress/templates/deployment.yaml index af1d1ad..66f4305 100644 --- a/egress/templates/deployment.yaml +++ b/egress/templates/deployment.yaml @@ -40,6 +40,18 @@ spec: configMapKeyRef: name: {{ include "egress.fullname" . }} key: config.yaml + {{- if .Values.apiSecretRef }} + - name: LIVEKIT_API_KEY + valueFrom: + secretKeyRef: + name: {{ .Values.apiSecretRef }} + key: livekit-api-key + - name: LIVEKIT_API_SECRET + valueFrom: + secretKeyRef: + name: {{ .Values.apiSecretRef }} + key: livekit-api-secret + {{- end }} {{- if .Values.egress.gst_debug }} - name: GST_DEBUG value: "{{ .Values.egress.gst_debug }}"