From 096ae830f7b83153f777a68973badbebfca2df5b Mon Sep 17 00:00:00 2001 From: nold Date: Thu, 13 Jun 2024 20:38:16 +0200 Subject: [PATCH] feat: env variables from secrets Signed-off-by: nold --- charts/local-ai/Chart.yaml | 2 +- charts/local-ai/templates/deployment.yaml | 3 +++ charts/local-ai/values.yaml | 9 +++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/charts/local-ai/Chart.yaml b/charts/local-ai/Chart.yaml index f2d04a9..ffa327b 100644 --- a/charts/local-ai/Chart.yaml +++ b/charts/local-ai/Chart.yaml @@ -3,4 +3,4 @@ appVersion: 1.40 description: A Helm chart for deploying LocalAI to a Kubernetes cluster name: local-ai type: application -version: 3.2.0 +version: 3.3.0 diff --git a/charts/local-ai/templates/deployment.yaml b/charts/local-ai/templates/deployment.yaml index d8dcbe4..37144a4 100644 --- a/charts/local-ai/templates/deployment.yaml +++ b/charts/local-ai/templates/deployment.yaml @@ -242,6 +242,9 @@ spec: {{- end }} - name: MODELS_PATH value: {{ .Values.deployment.modelsPath }} + {{- if .Values.deployment.secretEnv }} + {{- toYaml .Values.deployment.secretEnv | nindent 12 }} + {{- end}} volumeMounts: {{- range $key, $pvc := $rootPersistence}} {{- if $pvc.enabled }} diff --git a/charts/local-ai/values.yaml b/charts/local-ai/values.yaml index e32de48..6ab2cca 100644 --- a/charts/local-ai/values.yaml +++ b/charts/local-ai/values.yaml @@ -7,6 +7,15 @@ deployment: env: threads: 4 context_size: 512 + + # # Inject Secrets into Environment: + # secretEnv: + # - name: HF_TOKEN + # valueFrom: + # secretKeyRef: + # name: some-secret + # key: hf-token + modelsPath: "/models" download_model: # To use cloud provided (eg AWS) image, provide it like: 1234356789.dkr.ecr.us-REGION-X.amazonaws.com/busybox