mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-12-03 10:33:17 +00:00
feat: k8s deployment
This commit is contained in:
98
k8s/deployments/docsgpt-deploy.yaml
Normal file
98
k8s/deployments/docsgpt-deploy.yaml
Normal file
@@ -0,0 +1,98 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: docsgpt-api
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: docsgpt-api
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: docsgpt-api
|
||||
spec:
|
||||
containers:
|
||||
- name: docsgpt-api
|
||||
image: arc53/docsgpt
|
||||
ports:
|
||||
- containerPort: 7091
|
||||
resources:
|
||||
limits:
|
||||
memory: "4Gi"
|
||||
cpu: "2"
|
||||
requests:
|
||||
memory: "2Gi"
|
||||
cpu: "1"
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: docsgpt-secrets
|
||||
env:
|
||||
- name: FLASK_APP
|
||||
value: "application/app.py"
|
||||
- name: DEPLOYMENT_TYPE
|
||||
value: "cloud"
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: docsgpt-worker
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: docsgpt-worker
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: docsgpt-worker
|
||||
spec:
|
||||
containers:
|
||||
- name: docsgpt-worker
|
||||
image: arc53/docsgpt
|
||||
command: ["celery", "-A", "application.app.celery", "worker", "-l", "INFO", "-n", "worker.%h"]
|
||||
resources:
|
||||
limits:
|
||||
memory: "4Gi"
|
||||
cpu: "2"
|
||||
requests:
|
||||
memory: "2Gi"
|
||||
cpu: "1"
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: docsgpt-secrets
|
||||
env:
|
||||
- name: API_URL
|
||||
value: "BACKEND-URL"
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: docsgpt-frontend
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: docsgpt-frontend
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: docsgpt-frontend
|
||||
spec:
|
||||
containers:
|
||||
- name: docsgpt-frontend
|
||||
image: arc53/docsgpt-fe
|
||||
ports:
|
||||
- containerPort: 5173
|
||||
resources:
|
||||
limits:
|
||||
memory: "1Gi"
|
||||
cpu: "1"
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
cpu: "100m"
|
||||
env:
|
||||
- name: VITE_API_HOST
|
||||
value: "BACKEND-URL"
|
||||
- name: VITE_API_STREAMING
|
||||
value: "true"
|
||||
46
k8s/deployments/mongo-deploy.yaml
Normal file
46
k8s/deployments/mongo-deploy.yaml
Normal file
@@ -0,0 +1,46 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: mongodb-pvc
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi # Adjust size as needed
|
||||
|
||||
---
|
||||
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: mongodb
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mongodb
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: mongodb
|
||||
spec:
|
||||
containers:
|
||||
- name: mongodb
|
||||
image: mongo:latest
|
||||
ports:
|
||||
- containerPort: 27017
|
||||
resources:
|
||||
limits:
|
||||
memory: "1Gi"
|
||||
cpu: "0.5"
|
||||
requests:
|
||||
memory: "512Mi"
|
||||
cpu: "250m"
|
||||
volumeMounts:
|
||||
- name: mongodb-data
|
||||
mountPath: /data/db
|
||||
volumes:
|
||||
- name: mongodb-data
|
||||
persistentVolumeClaim:
|
||||
claimName: mongodb-pvc
|
||||
46
k8s/deployments/qdrant-deploy.yaml
Normal file
46
k8s/deployments/qdrant-deploy.yaml
Normal file
@@ -0,0 +1,46 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: qdrant-pvc
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
|
||||
---
|
||||
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: qdrant
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: qdrant
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: qdrant
|
||||
spec:
|
||||
containers:
|
||||
- name: qdrant
|
||||
image: qdrant/qdrant:latest
|
||||
ports:
|
||||
- containerPort: 6333
|
||||
resources:
|
||||
limits:
|
||||
memory: "2Gi" # Adjust based on your needs
|
||||
cpu: "1" # Adjust based on your needs
|
||||
requests:
|
||||
memory: "1Gi" # Adjust based on your needs
|
||||
cpu: "500m" # Adjust based on your needs
|
||||
volumeMounts:
|
||||
- name: qdrant-data
|
||||
mountPath: /qdrant/storage
|
||||
volumes:
|
||||
- name: qdrant-data
|
||||
persistentVolumeClaim:
|
||||
claimName: qdrant-pvc
|
||||
26
k8s/deployments/redis-deploy.yaml
Normal file
26
k8s/deployments/redis-deploy.yaml
Normal file
@@ -0,0 +1,26 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: redis
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: redis
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: redis
|
||||
spec:
|
||||
containers:
|
||||
- name: redis
|
||||
image: redis:latest
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
resources:
|
||||
limits:
|
||||
memory: "1Gi"
|
||||
cpu: "0.5"
|
||||
requests:
|
||||
memory: "512Mi"
|
||||
cpu: "250m"
|
||||
15
k8s/docsgpt-secrets.yaml
Normal file
15
k8s/docsgpt-secrets.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: docsgpt-secrets
|
||||
type: Opaque
|
||||
data:
|
||||
LLM_NAME: ZG9jc2dwdA==
|
||||
INTERNAL_KEY: aW50ZXJuYWw=
|
||||
CELERY_BROKER_URL: cmVkaXM6Ly9yZWRpcy1zZXJ2aWNlOjYzNzkvMA==
|
||||
CELERY_RESULT_BACKEND: cmVkaXM6Ly9yZWRpcy1zZXJ2aWNlOjYzNzkvMA==
|
||||
QDRANT_URL: cmVkaXM6Ly9yZWRpcy1zZXJ2aWNlOjYzNzkvMA==
|
||||
QDRANT_PORT: NjM3OQ==
|
||||
MONGO_URI: bW9uZ29kYjovL21vbmdvZGItc2VydmljZToyNzAxNy9kb2NzZ3B0P3JldHJ5V3JpdGVzPXRydWUmdz1tYWpvcml0eQ==
|
||||
mongo-user: bW9uZ28tdXNlcg==
|
||||
mongo-password: bW9uZ28tcGFzc3dvcmQ=
|
||||
25
k8s/services/docsgpt-service.yaml
Normal file
25
k8s/services/docsgpt-service.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: docsgpt-api-service
|
||||
spec:
|
||||
selector:
|
||||
app: docsgpt-api
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 80
|
||||
targetPort: 7091
|
||||
type: LoadBalancer
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: docsgpt-frontend-service
|
||||
spec:
|
||||
selector:
|
||||
app: docsgpt-frontend
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 80
|
||||
targetPort: 5173
|
||||
type: LoadBalancer
|
||||
12
k8s/services/mongo-service.yaml
Normal file
12
k8s/services/mongo-service.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: mongodb-service
|
||||
spec:
|
||||
selector:
|
||||
app: mongodb
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 27017
|
||||
targetPort: 27017
|
||||
type: ClusterIP
|
||||
12
k8s/services/qdrant-service.yaml
Normal file
12
k8s/services/qdrant-service.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: qdrant
|
||||
spec:
|
||||
selector:
|
||||
app: qdrant
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 6333
|
||||
targetPort: 6333
|
||||
type: ClusterIP
|
||||
12
k8s/services/redis-service.yaml
Normal file
12
k8s/services/redis-service.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: redis-service
|
||||
spec:
|
||||
selector:
|
||||
app: redis
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 6379
|
||||
targetPort: 6379
|
||||
type: ClusterIP
|
||||
Reference in New Issue
Block a user