diff --git a/k8s/deployments/docsgpt-deploy.yaml b/k8s/deployments/docsgpt-deploy.yaml new file mode 100644 index 00000000..1d0b86a3 --- /dev/null +++ b/k8s/deployments/docsgpt-deploy.yaml @@ -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" \ No newline at end of file diff --git a/k8s/deployments/mongo-deploy.yaml b/k8s/deployments/mongo-deploy.yaml new file mode 100644 index 00000000..1ab55295 --- /dev/null +++ b/k8s/deployments/mongo-deploy.yaml @@ -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 \ No newline at end of file diff --git a/k8s/deployments/qdrant-deploy.yaml b/k8s/deployments/qdrant-deploy.yaml new file mode 100644 index 00000000..70937b17 --- /dev/null +++ b/k8s/deployments/qdrant-deploy.yaml @@ -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 \ No newline at end of file diff --git a/k8s/deployments/redis-deploy.yaml b/k8s/deployments/redis-deploy.yaml new file mode 100644 index 00000000..e2728961 --- /dev/null +++ b/k8s/deployments/redis-deploy.yaml @@ -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" \ No newline at end of file diff --git a/k8s/docsgpt-secrets.yaml b/k8s/docsgpt-secrets.yaml new file mode 100644 index 00000000..45a00973 --- /dev/null +++ b/k8s/docsgpt-secrets.yaml @@ -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= \ No newline at end of file diff --git a/k8s/services/docsgpt-service.yaml b/k8s/services/docsgpt-service.yaml new file mode 100644 index 00000000..958d7c63 --- /dev/null +++ b/k8s/services/docsgpt-service.yaml @@ -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 \ No newline at end of file diff --git a/k8s/services/mongo-service.yaml b/k8s/services/mongo-service.yaml new file mode 100644 index 00000000..0ea3db62 --- /dev/null +++ b/k8s/services/mongo-service.yaml @@ -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 \ No newline at end of file diff --git a/k8s/services/qdrant-service.yaml b/k8s/services/qdrant-service.yaml new file mode 100644 index 00000000..7ab395e8 --- /dev/null +++ b/k8s/services/qdrant-service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: qdrant +spec: + selector: + app: qdrant + ports: + - protocol: TCP + port: 6333 + targetPort: 6333 + type: ClusterIP \ No newline at end of file diff --git a/k8s/services/redis-service.yaml b/k8s/services/redis-service.yaml new file mode 100644 index 00000000..5d7dbf99 --- /dev/null +++ b/k8s/services/redis-service.yaml @@ -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 \ No newline at end of file