aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2024-08-10 10:24:50 -0400
committerXe Iaso <me@xeiaso.net>2024-08-10 10:24:50 -0400
commit0f32938f2cee6bf92bb8c29417d12883a311af26 (patch)
tree04ad69ea00b119a40ea3447ef0b26df04ecc1156
parenta702ce19be284f0a287d0f5ff2d4c730c8bc4a07 (diff)
downloadx-0f32938f2cee6bf92bb8c29417d12883a311af26.tar.xz
x-0f32938f2cee6bf92bb8c29417d12883a311af26.zip
set up ollama for alrest
Signed-off-by: Xe Iaso <me@xeiaso.net>
-rw-r--r--kube/alrest/ollama/ollama.yaml106
1 files changed, 106 insertions, 0 deletions
diff --git a/kube/alrest/ollama/ollama.yaml b/kube/alrest/ollama/ollama.yaml
new file mode 100644
index 0000000..aaed210
--- /dev/null
+++ b/kube/alrest/ollama/ollama.yaml
@@ -0,0 +1,106 @@
+---
+apiVersion: v1
+kind: Namespace
+metadata:
+ name: ollama
+ labels:
+ xeiaso.net/project: ollama
+---
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+ name: ollama
+ namespace: ollama
+spec:
+ accessModes:
+ - ReadWriteOnce
+ storageClassName: "longhorn"
+ resources:
+ requests:
+ storage: 64Gi
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: ollama
+ namespace: ollama
+ labels:
+ xeiaso.net/project: ollama
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ app.kubernetes.io/name: ollama
+ template:
+ metadata:
+ labels:
+ app.kubernetes.io/name: ollama
+ xeiaso.net/project: ollama
+ spec:
+ securityContext:
+ fsGroup: 1000
+ volumes:
+ - name: ollama-data
+ persistentVolumeClaim:
+ claimName: ollama
+ runtimeClassName: nvidia
+ nodeSelector:
+ xeiaso.net/gpu: rtx3060-12gb
+
+ containers:
+ - name: main
+ image: ollama/ollama
+ imagePullPolicy: Always
+ securityContext:
+ runAsUser: 1000
+ runAsGroup: 1000
+ runAsNonRoot: true
+ allowPrivilegeEscalation: false
+ capabilities:
+ drop:
+ - ALL
+ seccompProfile:
+ type: RuntimeDefault
+ env:
+ - name: PATH
+ value: /usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ - name: LD_LIBRARY_PATH
+ value: /usr/local/nvidia/lib:/usr/local/nvidia/lib64
+ - name: NVIDIA_DRIVER_CAPABILITIES
+ value: compute,utility
+ - name: NVIDIA_VISIBLE_DEVICES
+ value: all
+ volumeMounts:
+ - name: ollama-data
+ mountPath: /.ollama
+ ports:
+ - name: http
+ containerPort: 11434
+ protocol: TCP
+ livenessProbe:
+ httpGet:
+ path: /
+ port: http
+ initialDelaySeconds: 2
+ periodSeconds: 5
+ timeoutSeconds: 5
+ successThreshold: 1
+ failureThreshold: 5
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: ollama
+ namespace: ollama
+ labels:
+ xeiaso.net/project: ollama
+ annotations: {}
+spec:
+ type: ClusterIP
+ ports:
+ - port: 80
+ targetPort: http
+ protocol: TCP
+ name: http
+ selector:
+ app.kubernetes.io/name: ollama \ No newline at end of file