diff --git a/.gitignore b/.gitignore index de1c7598f..b03bc895b 100644 --- a/.gitignore +++ b/.gitignore @@ -44,3 +44,4 @@ deploy/charts/litellm/*.tgz deploy/charts/litellm/charts/* deploy/charts/*.tgz litellm/proxy/vertex_key.json +**/.vim/ diff --git a/deploy/charts/litellm/Chart.yaml b/deploy/charts/litellm/Chart.yaml index 6ecdebb50..cc08a9921 100644 --- a/deploy/charts/litellm/Chart.yaml +++ b/deploy/charts/litellm/Chart.yaml @@ -31,3 +31,7 @@ dependencies: version: ">=13.3.0" repository: oci://registry-1.docker.io/bitnamicharts condition: db.deployStandalone + - name: redis + version: ">=18.0.0" + repository: oci://registry-1.docker.io/bitnamicharts + condition: redis.enabled diff --git a/deploy/charts/litellm/templates/_helpers.tpl b/deploy/charts/litellm/templates/_helpers.tpl index b8893d07c..fa563fadc 100644 --- a/deploy/charts/litellm/templates/_helpers.tpl +++ b/deploy/charts/litellm/templates/_helpers.tpl @@ -60,3 +60,11 @@ Create the name of the service account to use {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }} + +{{/* +Get redis service name +*/}} +{{- define "litellm.redis.serviceName" -}} +{{- printf "%s-headless" (default "redis" .Values.redis.nameOverride | trunc 63 | trimSuffix "-") -}} +{{- end -}} + diff --git a/deploy/charts/litellm/templates/deployment.yaml b/deploy/charts/litellm/templates/deployment.yaml index 6ed112dac..bc2a0bd09 100644 --- a/deploy/charts/litellm/templates/deployment.yaml +++ b/deploy/charts/litellm/templates/deployment.yaml @@ -142,6 +142,17 @@ spec: secretKeyRef: name: {{ include "litellm.fullname" . }}-masterkey key: masterkey + {{- if .Values.redis.enabled }} + - name: REDIS_HOST + value: {{ template "litellm.redis.serviceName" . }} + - name: REDIS_PORT + value: {{ if .Values.redis.sentinel.enabled }}{{ .Values.redis.sentinel.service.ports.sentinel }}{{ else }}{{ .Values.redis.master.service.ports.redis}}{{ end }} + - name: REDIS_PASSWORD + valueFrom: + secretKeyRef: + name: {{ include "redis.secretName" . }} + key: {{include "redis.secretPasswordKey" . }} + {{- end }} envFrom: {{- range .Values.environmentSecrets }} - secretRef: diff --git a/deploy/charts/litellm/values.yaml b/deploy/charts/litellm/values.yaml index 1b83fe801..9b697b013 100644 --- a/deploy/charts/litellm/values.yaml +++ b/deploy/charts/litellm/values.yaml @@ -166,3 +166,9 @@ postgresql: # existingSecret: "" # secretKeys: # userPasswordKey: password + +# requires cache: true in config file +# either enable this or pass a secret for REDIS_HOST, REDIS_PORT, REDIS_PASSWORD or REDIS_URL +# with cache: true to use existing redis instance +redis: + enabled: false