From d63f5f99e90fceca27602fbd83079706b242d35a Mon Sep 17 00:00:00 2001 From: "Jugal D. Bhatt" <55304795+jugaldb@users.noreply.github.com> Date: Thu, 21 Aug 2025 14:58:50 -0700 Subject: [PATCH] Enhance database configuration: add support for optional endpointKey in values.yaml and update deployment/migrations job templates to conditionally source DATABASE_HOST from the secret if endpointKey is set. (#13763) --- deploy/charts/litellm-helm/templates/deployment.yaml | 7 +++++++ deploy/charts/litellm-helm/templates/migrations-job.yaml | 7 +++++++ deploy/charts/litellm-helm/values.yaml | 2 ++ 3 files changed, 16 insertions(+) diff --git a/deploy/charts/litellm-helm/templates/deployment.yaml b/deploy/charts/litellm-helm/templates/deployment.yaml index 71412b8052..b30b882932 100644 --- a/deploy/charts/litellm-helm/templates/deployment.yaml +++ b/deploy/charts/litellm-helm/templates/deployment.yaml @@ -71,7 +71,14 @@ spec: name: {{ .Values.db.secret.name }} key: {{ .Values.db.secret.passwordKey }} - name: DATABASE_HOST + {{- if .Values.db.secret.endpointKey }} + valueFrom: + secretKeyRef: + name: {{ .Values.db.secret.name }} + key: {{ .Values.db.secret.endpointKey }} + {{- else }} value: {{ .Values.db.endpoint }} + {{- end }} - name: DATABASE_NAME value: {{ .Values.db.database }} - name: DATABASE_URL diff --git a/deploy/charts/litellm-helm/templates/migrations-job.yaml b/deploy/charts/litellm-helm/templates/migrations-job.yaml index ec80e86b21..4c8925564a 100644 --- a/deploy/charts/litellm-helm/templates/migrations-job.yaml +++ b/deploy/charts/litellm-helm/templates/migrations-job.yaml @@ -49,7 +49,14 @@ spec: name: {{ .Values.db.secret.name }} key: {{ .Values.db.secret.passwordKey }} - name: DATABASE_HOST + {{- if .Values.db.secret.endpointKey }} + valueFrom: + secretKeyRef: + name: {{ .Values.db.secret.name }} + key: {{ .Values.db.secret.endpointKey }} + {{- else }} value: {{ .Values.db.endpoint }} + {{- end }} - name: DATABASE_NAME value: {{ .Values.db.database }} - name: DATABASE_URL diff --git a/deploy/charts/litellm-helm/values.yaml b/deploy/charts/litellm-helm/values.yaml index e9a96b23de..0bd95003c1 100644 --- a/deploy/charts/litellm-helm/values.yaml +++ b/deploy/charts/litellm-helm/values.yaml @@ -161,6 +161,8 @@ db: name: postgres usernameKey: username passwordKey: password + # Optional: when set, DATABASE_HOST will be sourced from this secret key instead of db.endpoint + endpointKey: "" # Use the Stackgres Helm chart to deploy an instance of a Stackgres cluster. # The Stackgres Operator must already be installed within the target