Add mongodb database for librechat

This commit is contained in:
2025-03-31 23:59:47 +02:00
parent ffeecf65f6
commit 0d17825eab
2 changed files with 93 additions and 0 deletions

View File

@@ -4,3 +4,4 @@ resources:
- gitea.yaml - gitea.yaml
- renovate.yaml - renovate.yaml
- ollama.yaml - ollama.yaml
- librechat.yaml

92
apps/librechat.yaml Normal file
View File

@@ -0,0 +1,92 @@
---
apiVersion: v1
kind: Namespace
metadata:
name: librechat
---
# Manually create database serviceaccount
# https://github.com/mongodb/helm-charts/blob/01e50752b84de90607f12b1bd8d32c2d3493f1d2/charts/community-operator/templates/database_roles.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: mongodb-database
namespace: librechat
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: mongodb-database
namespace: librechat
rules:
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
- apiGroups:
- ""
resources:
- pods
verbs:
- patch
- delete
- get
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: mongodb-database
namespace: librechat
subjects:
- kind: ServiceAccount
name: mongodb-database
roleRef:
kind: Role
name: mongodb-database
apiGroup: rbac.authorization.k8s.io
---
apiVersion: mongodbcommunity.mongodb.com/v1
kind: MongoDBCommunity
metadata:
name: librechat
namespace: librechat
spec:
members: 1
type: ReplicaSet
version: "6.0.5"
security:
authentication:
modes: ["SCRAM"]
users:
- name: librechat
db: admin
passwordSecretRef: # a reference to the secret that will be used to generate the user's password
name: librechat-mongodb-secret
roles:
- name: clusterAdmin
db: admin
- name: userAdminAnyDatabase
db: admin
scramCredentialsSecretName: my-scram
additionalMongodConfig:
storage.wiredTiger.engineConfig.journalCompressor: zlib
statefulSet:
spec:
volumeClaimTemplates:
- metadata:
name: data-volume
spec:
accessModes: ["ReadWriteOnce"]
storageClassName: openebs-single-replica
resources:
requests:
storage: 10Gi
- metadata:
name: logs-volume
spec:
accessModes: ["ReadWriteOnce"]
storageClassName: openebs-single-replica
resources:
requests:
storage: 1Gi