diff --git a/ollama/ollama-deployment.yaml b/ollama/ollama-deployment.yaml new file mode 100644 index 0000000..5f4d091 --- /dev/null +++ b/ollama/ollama-deployment.yaml @@ -0,0 +1,38 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: ollama + namespace: ollama-ns +spec: + replicas: 1 + selector: + matchLabels: + app: ollama + template: + metadata: + labels: + app: ollama + spec: + runtimeClassName: nvidia + containers: + - name: ollama + image: ollama/ollama + env: + - name: OLLAMA_HOST + value: 0.0.0.0 + - name: OLLAMA_MODELS + value: "/models" + #- name: OLLAMA_KEEP_ALIVE + # value: "-1" + ports: + - containerPort: 11434 + resources: + limits: + nvidia.com/gpu: 3 + volumeMounts: + - name: ollama-volume + mountPath: "/models" + volumes: + - name: ollama-volume + persistentVolumeClaim: + claimName: ollama-pvc diff --git a/ollama/ollama-pvc.yaml b/ollama/ollama-pvc.yaml new file mode 100644 index 0000000..f2d2aa0 --- /dev/null +++ b/ollama/ollama-pvc.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: ollama-pvc + namespace: ollama-ns +spec: + accessModes: + - ReadWriteOnce + storageClassName: longhorn + resources: + requests: + storage: 200Gi diff --git a/ollama/ollama-service.yaml b/ollama/ollama-service.yaml new file mode 100644 index 0000000..d034c21 --- /dev/null +++ b/ollama/ollama-service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: ollama-service + namespace: ollama-ns +spec: + type: LoadBalancer + ports: + - port: 11434 + targetPort: 11434 + selector: + app: ollama