diff --git a/livekit-server/templates/secret.yaml b/livekit-server/templates/secret.yaml index 986f149..2950d90 100644 --- a/livekit-server/templates/secret.yaml +++ b/livekit-server/templates/secret.yaml @@ -6,5 +6,14 @@ metadata: labels: {{- include "livekit-server.labels" . | nindent 4 }} data: - {{ .Values.livekit.key_file }}: {{ toYaml .Values.storeKeysInSecret.keys | b64enc }} + {{- if and .Values.storeKeysInSecret.autoGenerateKeys (empty .Values.storeKeysInSecret.keys) (empty .Values.livekit.keys) }} + {{- $apiKey := "lk_api_key" }} + {{- $apiSecret := randAlphaNum 50 }} + {{- $keyData := dict $apiKey $apiSecret }} + {{ .Values.livekit.key_file }}: {{ toYaml $keyData | b64enc }} + api_key: {{ $apiKey | b64enc }} + api_secret: {{ $apiSecret | b64enc }} + {{- else }} + {{ .Values.livekit.key_file }}: {{ toYaml .Values.storeKeysInSecret.keys | b64enc }} + {{- end }} {{- end }} diff --git a/livekit-server/values.yaml b/livekit-server/values.yaml index bcf6d51..27b4db2 100644 --- a/livekit-server/values.yaml +++ b/livekit-server/values.yaml @@ -50,6 +50,9 @@ livekit: # Set this option to true if you want to store your API keys in a secret instead of the config file storeKeysInSecret: enabled: false + # Set this option to true if you want to generate your API keys and store them in a secret instead of the config file. + # storeKeysInSecret.enabled needs to be true for this option to work. + autoGenerateKeys: false # Use a pre existing secret, useful to combine with external secret managers # as GCP External Secrets or Hashicorp Vault existingSecret: ""