Repository navigation
Expand file tree
/
Copy pathdeployment.yaml
More file actions
70 lines (70 loc) · 2.28 KB
/
Copy pathdeployment.yaml
File metadata and controls
70 lines (70 loc) · 2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
apiVersion: apps/v1
kind: Deployment
metadata:
name: rag-app-deployment
spec:
replicas: 1
selector:
matchLabels:
app: rag-api
template:
metadata:
labels:
app: rag-api
spec:
hostNetwork: true # Allow pod to access host network (for local Ollama)
containers:
- name: rag-api-container
image: zag23/rag-app:latest
# Use 'Never' only if using local image: rag-app:latest
# imagePullPolicy: Never
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8000 # Port the Python application listens on (matches Dockerfile)
name: http
env:
- name: OLLAMA_HOST
# Choose one of these options based on your setup:
#
# Option 1: Ollama running in Kubernetes cluster (recommended for production)
# value: "ollama-service.default.svc.cluster.local:11434"
# Note: Remove hostNetwork: true for production deployments
#
# Option 2: Ollama on host machine (for minikube/local dev) - CURRENTLY ACTIVE
# Requires hostNetwork: true (enabled above) to access host machine
# For minikube, use host.docker.internal which works with hostNetwork
value: "host.docker.internal:11434"
#
# Option 3: Ollama on external host
# value: "your-host-ip-or-domain:11434"
# May require network configuration to allow pod-to-host communication
resources:
requests:
memory: "256Mi"
cpu: "250m"
limits:
memory: "512Mi"
cpu: "500m"
livenessProbe:
httpGet:
path: /
port: 8000 # Health check port (matches containerPort)
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
httpGet:
path: /
port: 8000 # Readiness check port (matches containerPort)
initialDelaySeconds: 10
periodSeconds: 5
timeoutSeconds: 3
failureThreshold: 3
volumeMounts:
- name: chromadb-storage
mountPath: /app/db
volumes:
- name: chromadb-storage
persistentVolumeClaim:
claimName: chromadb-pvc