1
0
Fork 0
home-stack-kustomize/kustomize/bases/librechat/librechat-deployment.yaml

152 lines
4.3 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: server
labels:
app.kubernetes.io/name: librechat
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app.kubernetes.io/name: librechat
template:
metadata:
labels:
app.kubernetes.io/name: librechat
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
# Image only supports amd64
- key: kubernetes.io/arch
operator: In
values:
- amd64
containers:
- name: librechat
image: ghcr.io/danny-avila/librechat
env:
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: DOMAIN_CLIENT
valueFrom:
configMapKeyRef:
name: kustomize-generated-config
key: LIBRECHAT_EXTERNAL_URL
- name: DOMAIN_SERVER
valueFrom:
configMapKeyRef:
name: kustomize-generated-config
key: LIBRECHAT_EXTERNAL_URL
- name: MONGO_URI
value: mongodb://librechat-mongodb.$(NAMESPACE).svc:27017/LibreChat
- name: SEARCH
value: 'false' # TODO
- name: CREDS_KEY
valueFrom:
secretKeyRef:
name: server-tokens
key: creds_key
- name: CREDS_IV
valueFrom:
secretKeyRef:
name: server-tokens
key: creds_iv
- name: JWT_SECRET
valueFrom:
secretKeyRef:
name: server-tokens
key: jwt_secret
- name: JWT_REFRESH_SECRET
valueFrom:
secretKeyRef:
name: server-tokens
key: jwt_refresh_secret
- name: ALLOW_EMAIL_LOGIN
value: 'false'
- name: ALLOW_REGISTRATION
value: 'false'
- name: ALLOW_SOCIAL_LOGIN
value: 'true'
- name: ALLOW_SOCIAL_REGISTRATION
value: 'true'
- name: OPENID_CLIENT_ID
valueFrom:
secretKeyRef:
name: server-openid-config
key: openid_client_id
- name: OPENID_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: server-openid-config
key: openid_client_secret
- name: OPENID_ISSUER
valueFrom:
secretKeyRef:
name: server-openid-config
key: openid_issuer
- name: OPENID_SESSION_SECRET
valueFrom:
secretKeyRef:
name: server-openid-config
key: openid_session_secret
- name: OPENID_SCOPE
value: openid profile email
- name: OPENID_CALLBACK_URL
value: /oauth/openid/callback
ports:
- name: http
containerPort: 3080
resources:
requests:
cpu: 250m
memory: 500Mi
limits:
cpu: 1000m
memory: 500Mi
volumeMounts:
- name: server-images-pv
mountPath: /app/client/public/images
- name: server-config
mountPath: /app/librechat.yaml
subPath: librechat.yaml
volumes:
- name: server-images-pv
persistentVolumeClaim:
claimName: server-images-pvc
- name: server-config
configMap:
name: server-config
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: server-images-pvc
labels:
app.kubernetes.io/name: librechat
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
---
apiVersion: v1
kind: Service
metadata:
name: server
labels:
app.kubernetes.io/name: librechat
spec:
selector:
app.kubernetes.io/name: librechat
ports:
- name: http
port: 3080
targetPort: http