Skip to content

Commit

Permalink
Add Image Volume
Browse files Browse the repository at this point in the history
  • Loading branch information
hofq committed Mar 19, 2024
1 parent 97eeb6d commit ab865d8
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
13 changes: 11 additions & 2 deletions charts/librechat/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ spec:
template:
metadata:
annotations:
{{if .Values.librechat.configYamlContent }}checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}{{end}}
checksum/config: {{ include (print $.Template.BasePath "/configmap-env.yaml") . | sha256sum }}
{{ if .Values.librechat.configYamlContent }}checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}{{ end }}
checksum/configEnv: {{ include (print $.Template.BasePath "/configmap-env.yaml") . | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down Expand Up @@ -52,6 +52,10 @@ spec:
subPath: "librechat.yaml"
readOnly: true
{{- end }}
{{- if .Values.librechat.imageVolume }}
- name: image-volume
mountPath: "/app/client/public/images"
{{- end }}
envFrom:
- configMapRef:
name: {{ include "librechat.fullname" $ }}-configenv
Expand All @@ -70,6 +74,11 @@ spec:
name: {{ include "librechat.fullname" $ }}-config
{{- end }}
{{- end }}
{{- if .Values.librechat.imageVolume }}
- name: image-volume
persistentVolumeClaim:
claimName: {{ include "librechat.fullname" $ }}-images
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
16 changes: 16 additions & 0 deletions charts/librechat/templates/persistentvolumeclaim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- if .Values.librechat.imageVolume }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "librechat.fullname" $ }}-images
spec:
accessModes:
- ReadWriteOnce
{{- if .Values.librechat.imageVolume.storageClassName }}
storageClassName: {{ .Values.librechat.imageVolume.storageClassName }}
{{- end }}
volumeMode: Filesystem
resources:
requests:
storage: {{ .Values.librechat.imageVolume.size }}
{{- end }}
5 changes: 5 additions & 0 deletions charts/librechat/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,18 @@ librechat:
# # name of existing Yaml configmap, key must be librechat.yaml
existingConfigYaml: ""

# Volume used to store image Files uploaded to the Web UI
imageVolume:
size: 10G

image:
repository: danny-avila/librechat
registry: ghcr.io
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""


imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
Expand Down

0 comments on commit ab865d8

Please sign in to comment.