Skip to content

Commit fdb5523

Browse files
committed
Add librechat sub-apps
1 parent 792ed76 commit fdb5523

74 files changed

Lines changed: 10584 additions & 4 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@ Thumbs.db
3939

4040
## Miscellaneous
4141
charts/
42+
!helm/librechat/charts/

helm/librechat/Chart.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ dependencies:
66
repository: https://meilisearch.github.io/meilisearch-kubernetes
77
version: 0.11.0
88
- name: librechat-rag-api
9-
repository: file://../librechat-rag-api
9+
repository: file://./charts/librechat-rag-api
1010
version: 0.5.2
11-
digest: sha256:34469b457a92b4a8aa8ddae756910f1bfabdac08cb4937306ee92f50d5b29c52
12-
generated: "2025-10-30T20:57:33.83911646Z"
11+
digest: sha256:5442460bbdd3831ad8018132269770013a193765eed7c39cf6b5162455c51f8b
12+
generated: "2025-11-13T19:37:55.649449-08:00"

helm/librechat/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ dependencies:
1111
version: 0.11.0
1212
- condition: librechat-rag-api.enabled
1313
name: librechat-rag-api
14-
repository: file://../librechat-rag-api
14+
repository: file://./charts/librechat-rag-api
1515
version: 0.5.2
1616
description: A Helm chart for LibreChat
1717
home: https://www.librechat.ai
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v2
2+
appVersion: v0.4.0
3+
dependencies:
4+
- condition: postgresql.enabled
5+
name: postgresql
6+
repository: https://charts.bitnami.com/bitnami
7+
version: 15.5.38
8+
description: A Helm chart for LibreChat
9+
home: https://www.librechat.ai
10+
name: librechat-rag-api
11+
type: application
12+
version: 0.5.2
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Librechat RAG API Helm CHart
2+
3+
> [!WARNING]
4+
> This Helm-Chart is needed for LibreChat and Deployment information is documented in (the librechat chart)[../librechat/readme.md]
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
2+
3+
4+
5+
{{/*
6+
Create chart name and version as used by the chart label.
7+
*/}}
8+
{{- define "rag.chart" -}}
9+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
10+
{{- end }}
11+
12+
13+
{{/*
14+
Create a default fully qualified app name.
15+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
16+
If release name contains chart name it will be used as a full name.
17+
*/}}
18+
19+
{{- define "rag.fullname" -}}
20+
{{- if $.Values.fullnameOverride }}
21+
{{- $.Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
22+
{{- else }}
23+
{{- $name := default .Chart.Name .Values.nameOverride }}
24+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
25+
{{- end }}
26+
{{- end }}
27+
28+
{{/*
29+
Common labels
30+
*/}}
31+
{{- define "rag.labels" -}}
32+
helm.sh/chart: {{ include "rag.chart" . }}
33+
{{ include "rag.selectorLabels" . }}
34+
{{- if .Chart.AppVersion }}
35+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
36+
{{- end }}
37+
app.kubernetes.io/managed-by: {{ .Release.Service }}
38+
{{- end }}
39+
40+
41+
{{/*
42+
RAG Selector labels
43+
*/}}
44+
{{- define "rag.selectorLabels" -}}
45+
app.kubernetes.io/name: {{ include "rag.fullname" . }}-rag
46+
app.kubernetes.io/instance: {{ .Release.Name }}
47+
{{- end }}
48+
49+
{{/*
50+
Create the name of the service account to use
51+
*/}}
52+
{{- define "rag.serviceAccountName" -}}
53+
{{- if .Values.serviceAccount.create }}
54+
{{- default (include "rag.fullname" .) .Values.serviceAccount.name }}
55+
{{- else }}
56+
{{- default "default" .Values.serviceAccount.name }}
57+
{{- end }}
58+
{{- end }}
59+
60+
61+
{{- define "rag.dbsecretValue" -}}
62+
{{- $secret := .Values.postgresql.auth.existingSecret -}}
63+
{{- $key := "password" -}}
64+
{{- printf "%s" (include "exec" (dict "command" "kubectl" "args" (list "get" "secret" $secret "-o=jsonpath={.data." $key "}"))) | b64enc -}}
65+
{{- end -}}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "rag.fullname" $ | lower}}-config
5+
data:
6+
POSTGRES_DB: {{ .Values.postgresql.auth.database }}
7+
POSTGRES_USER: {{ .Values.postgresql.auth.username }}
8+
DB_HOST: {{ .Release.Name }}-postgresql.{{ .Release.Namespace | lower }}.svc.cluster.local
9+
{{- toYaml .Values.rag.configEnv | nindent 2 }}
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "rag.fullname" $ }}
5+
labels:
6+
{{- include "rag.labels" . | nindent 4 }}
7+
rag-component: rag
8+
spec:
9+
replicas: {{ .Values.rag.replicaCount }}
10+
selector:
11+
matchLabels:
12+
{{- include "rag.selectorLabels" . | nindent 6 }}
13+
template:
14+
metadata:
15+
annotations:
16+
{{- with .Values.rag.podAnnotations }}
17+
{{- toYaml . | nindent 8 }}
18+
{{- end }}
19+
labels:
20+
{{- include "rag.selectorLabels" . | nindent 8 }}
21+
{{- with .Values.rag.podLabels }}
22+
{{- toYaml . | nindent 8 }}
23+
{{- end }}
24+
spec:
25+
{{- with .Values.imagePullSecrets }}
26+
imagePullSecrets:
27+
{{- toYaml . | nindent 8 }}
28+
{{- end }}
29+
securityContext:
30+
{{- toYaml .Values.podSecurityContext | nindent 8 }}
31+
containers:
32+
- name: {{ include "rag.fullname" $ }}-rag
33+
securityContext:
34+
{{- toYaml .Values.securityContext | nindent 12 }}
35+
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
36+
imagePullPolicy: {{ .Values.image.pullPolicy }}
37+
ports:
38+
- name: http
39+
containerPort: {{ .Values.service.port }}
40+
protocol: TCP
41+
livenessProbe:
42+
{{- toYaml .Values.livenessProbe | nindent 12 }}
43+
readinessProbe:
44+
{{- toYaml .Values.readinessProbe | nindent 12 }}
45+
resources:
46+
{{- toYaml .Values.resources | nindent 12 }}
47+
envFrom:
48+
- configMapRef:
49+
name: {{ include "rag.fullname" $ }}-config
50+
{{- if .Values.rag.existingSecret }}
51+
- secretRef:
52+
name: {{ .Values.rag.existingSecret }}
53+
{{- end }}
54+
env:
55+
{{- if .Values.postgresql.auth.existingSecret }}
56+
- name: POSTGRES_PASSWORD
57+
valueFrom:
58+
secretKeyRef:
59+
name: {{ .Values.postgresql.auth.existingSecret }}
60+
key: {{ .Values.postgresql.auth.secretKeys.userPasswordKey }}
61+
{{- end }}
62+
{{- if .Values.global.librechat.existingSecretName }}
63+
- name: OPENAI_API_KEY
64+
valueFrom:
65+
secretKeyRef:
66+
name: {{ .Values.global.librechat.existingSecretName }}
67+
key: {{ .Values.global.librechat.existingSecretApiKey }}
68+
optional: true
69+
{{- end }}
70+
{{- with .Values.env }}
71+
{{- toYaml . | nindent 10 }}
72+
{{- end }}
73+
{{- with .Values.volumeMounts }}
74+
volumeMounts:
75+
{{- toYaml . | nindent 12 }}
76+
{{- end }}
77+
{{- with .Values.extraContainers }}
78+
{{ toYaml . | nindent 8 }}
79+
{{- end }}
80+
81+
82+
volumes:
83+
{{- with .Values.volumes }}
84+
{{- toYaml . | nindent 8 }}
85+
{{- end }}
86+
{{- with .Values.nodeSelector }}
87+
nodeSelector:
88+
{{- toYaml . | nindent 8 }}
89+
{{- end }}
90+
{{- with .Values.affinity }}
91+
affinity:
92+
{{- toYaml . | nindent 8 }}
93+
{{- end }}
94+
{{- with .Values.tolerations }}
95+
tolerations:
96+
{{- toYaml . | nindent 8 }}
97+
{{- end }}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ include "rag.fullname" . }}
5+
labels:
6+
{{- include "rag.labels" . | nindent 4 }}
7+
annotations:
8+
{{- toYaml .Values.service.annotations | nindent 4 }}
9+
spec:
10+
type: {{ .Values.service.type }}
11+
ports:
12+
- port: {{ .Values.service.port }}
13+
targetPort: http
14+
protocol: TCP
15+
name: http
16+
selector:
17+
{{- include "rag.selectorLabels" . | nindent 4 }}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: "{{ include "rag.fullname" . }}-test-connection"
5+
labels:
6+
{{- include "rag.labels" . | nindent 4 }}
7+
annotations:
8+
"helm.sh/hook": test
9+
spec:
10+
containers:
11+
- name: wget
12+
image: busybox
13+
command: ['wget']
14+
args: ['{{ include "rag.fullname" . }}:{{ .Values.service.port }}']
15+
restartPolicy: Never

0 commit comments

Comments
 (0)