-
Notifications
You must be signed in to change notification settings - Fork 111
/
Copy pathdeployment.yaml
80 lines (80 loc) · 1.92 KB
/
deployment.yaml
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
71
72
73
74
75
76
77
78
79
80
apiVersion: apps/v1
kind: Deployment
metadata:
name: ollama
spec:
replicas: 1
selector:
matchLabels:
app: ollama
strategy:
type: Recreate
template:
metadata:
labels:
app: ollama
spec:
containers:
- name: ollama
image: quay.io/rh-aiservices-bu/ollama-ubi9:0.2.8
imagePullPolicy: Always
env:
- name: MODEL_ID
value: mistral:latest
- name: OLLAMA_MODELS
value: /.ollama/models
- name: OLLAMA_HOST
value: 0.0.0.0
- name: OLLAMA_KEEP_ALIVE
value: '-1m'
securityContext:
capabilities:
drop:
- ALL
runAsNonRoot: true
allowPrivilegeEscalation: false
seccompProfile:
type: RuntimeDefault
ports:
- name: http
containerPort: 11434
protocol: TCP
resources:
limits:
cpu: '4'
memory: 8Gi
requests:
cpu: '4'
memory: 8Gi
readinessProbe:
httpGet:
path: /
port: http
scheme: HTTP
timeoutSeconds: 5
periodSeconds: 30
successThreshold: 1
failureThreshold: 3
livenessProbe:
httpGet:
path: /
port: http
scheme: HTTP
timeoutSeconds: 8
periodSeconds: 100
successThreshold: 1
failureThreshold: 3
lifecycle:
postStart:
exec:
command: [ "/bin/sh", "-c", "/bin/ollama pull $MODEL_ID" ]
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /.ollama
name: ollama-cache
restartPolicy: Always
volumes:
- name: ollama-cache
persistentVolumeClaim:
claimName: ollama-cache