forked from phoenix/litellm-mirror
chore: better handling redis deployment architecture and connection
This commit is contained in:
parent
b3646f6644
commit
eea803cae4
3 changed files with 20 additions and 3 deletions
|
@ -65,6 +65,20 @@ Create the name of the service account to use
|
||||||
Get redis service name
|
Get redis service name
|
||||||
*/}}
|
*/}}
|
||||||
{{- define "litellm.redis.serviceName" -}}
|
{{- define "litellm.redis.serviceName" -}}
|
||||||
{{- printf "%s-headless" (default "redis" .Values.redis.nameOverride | trunc 63 | trimSuffix "-") -}}
|
{{- if and (eq .Values.redis.architecture "standalone") .Values.redis.sentinel.enabled -}}
|
||||||
|
{{- printf "%s-%s" .Release.Name (default "redis" .Values.redis.nameOverride | trunc 63 | trimSuffix "-") -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- printf "%s-%s-master" .Release.Name (default "redis" .Values.redis.nameOverride | trunc 63 | trimSuffix "-") -}}
|
||||||
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Get redis service port
|
||||||
|
*/}}
|
||||||
|
{{- define "litellm.redis.port" -}}
|
||||||
|
{{- if .Values.redis.sentinel.enabled -}}
|
||||||
|
{{ .Values.redis.sentinel.service.ports.sentinel }}
|
||||||
|
{{- else -}}
|
||||||
|
{{ .Values.redis.master.service.ports.redis }}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
|
@ -144,9 +144,9 @@ spec:
|
||||||
key: masterkey
|
key: masterkey
|
||||||
{{- if .Values.redis.enabled }}
|
{{- if .Values.redis.enabled }}
|
||||||
- name: REDIS_HOST
|
- name: REDIS_HOST
|
||||||
value: {{ template "litellm.redis.serviceName" . }}
|
value: {{ include "litellm.redis.serviceName" . }}
|
||||||
- name: REDIS_PORT
|
- name: REDIS_PORT
|
||||||
value: {{ if .Values.redis.sentinel.enabled }}{{ .Values.redis.sentinel.service.ports.sentinel }}{{ else }}{{ .Values.redis.master.service.ports.redis}}{{ end }}
|
value: {{ include "litellm.redis.port" . | quote }}
|
||||||
- name: REDIS_PASSWORD
|
- name: REDIS_PASSWORD
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
|
|
|
@ -87,6 +87,8 @@ proxy_config:
|
||||||
api_key: eXaMpLeOnLy
|
api_key: eXaMpLeOnLy
|
||||||
general_settings:
|
general_settings:
|
||||||
master_key: os.environ/PROXY_MASTER_KEY
|
master_key: os.environ/PROXY_MASTER_KEY
|
||||||
|
# litellm_settings:
|
||||||
|
# cache: true
|
||||||
|
|
||||||
resources: {}
|
resources: {}
|
||||||
# We usually recommend not to specify default resources and to leave this as a conscious
|
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||||
|
@ -172,3 +174,4 @@ postgresql:
|
||||||
# with cache: true to use existing redis instance
|
# with cache: true to use existing redis instance
|
||||||
redis:
|
redis:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
architecture: replication
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue