livekit / livekit-helm

LiveKit Helm charts
https://docs.livekit.io
Apache License 2.0
50 stars 59 forks source link

Parametrize namespace #105

Open lebaudantoine opened 2 months ago

lebaudantoine commented 2 months ago

I am facing an issue while adding the LiveKit server and Egress to my project. Their Helm charts do not respect the specified namespace and end up running in the default namespace, which is not what I want.

Here is an example of how I usually declare external charts from Bitnami, such as PostgreSQL:

// helmfile.yaml

repositories:
- name: bitnami
  url: registry-1.docker.io/bitnamicharts

releases:
  - name: postgres
    namespace: {{ .Namespace }}
    chart: bitnami/postgresql
    version: 13.1.5
    values:
       ....

I run the following command to deploy:

helmfile -n my-namespace template .

With the Bitnami charts, everything runs properly in the specified my-namespace namespace. Bitnami charts allow passing a namespace value in the template metadata, for example:

// charts/bitnami/postgresql/templates/secrets.yaml
...
apiVersion: v1
kind: Secret
metadata:
  name: {{ include "common.names.fullname" . }}
  namespace: {{ .Release.Namespace | quote }}
...

When reproducing the same approach with LiveKit charts, the LiveKit server and Egress charts do not seem to respect the specified namespace. They end up running in the default namespace.

Is the namespace attribute missing from the charts' metdata? for example:

// livekit-helm/livekit-server/templates/secret.yaml
...
metadata:
  name: {{ include "livekit-server.fullname" . }}
  labels:
    {{- include "livekit-server.labels" . | nindent 4 }}
...

Am I missing something in my current setup? Please find my current Helmfile under this repository.

Should we add a namespace attribute to the LiveKit server and Egress charts? I would be happy to propose a PR to address this issue.