From 034096793056345dedc168326bc994dc55aee96a Mon Sep 17 00:00:00 2001 From: braveokafor Date: Fri, 16 Feb 2024 19:36:38 +0100 Subject: [PATCH 1/2] feat: added kubernetes persistent volume claim for webui --- kubernetes/manifest/base/webui-deployment.yaml | 9 ++++++++- kubernetes/manifest/base/webui-pvc.yaml | 12 ++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 kubernetes/manifest/base/webui-pvc.yaml diff --git a/kubernetes/manifest/base/webui-deployment.yaml b/kubernetes/manifest/base/webui-deployment.yaml index 58de0368..762c09ef 100644 --- a/kubernetes/manifest/base/webui-deployment.yaml +++ b/kubernetes/manifest/base/webui-deployment.yaml @@ -25,4 +25,11 @@ spec: env: - name: OLLAMA_API_BASE_URL value: "http://ollama-service.ollama-namespace.svc.cluster.local:11434/api" - tty: true \ No newline at end of file + tty: true + volumeMounts: + - name: webui-volume + mountPath: /app/backend/data + volumes: + - name: webui-volume + persistentVolumeClaim: + claimName: ollama-webui-pvc \ No newline at end of file diff --git a/kubernetes/manifest/base/webui-pvc.yaml b/kubernetes/manifest/base/webui-pvc.yaml new file mode 100644 index 00000000..9680c238 --- /dev/null +++ b/kubernetes/manifest/base/webui-pvc.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + labels: + app: ollama-webui + name: ollama-webui-pvc + namespace: ollama-namespace +spec: + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi \ No newline at end of file From 31b903d831156ea76ae34bee0eb8f8c0e2b63403 Mon Sep 17 00:00:00 2001 From: braveokafor Date: Sat, 17 Feb 2024 17:20:53 +0100 Subject: [PATCH 2/2] chore: bump kubernetes resources --- kubernetes/helm/values.yaml | 14 ++++++++++---- kubernetes/manifest/base/ollama-statefulset.yaml | 8 ++++++-- kubernetes/manifest/base/webui-deployment.yaml | 5 ++++- kubernetes/manifest/base/webui-pvc.yaml | 2 +- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/kubernetes/helm/values.yaml b/kubernetes/helm/values.yaml index 648b4050..11d23f5e 100644 --- a/kubernetes/helm/values.yaml +++ b/kubernetes/helm/values.yaml @@ -5,11 +5,14 @@ ollama: image: ollama/ollama:latest servicePort: 11434 resources: - limits: + requests: cpu: "2000m" memory: "2Gi" + limits: + cpu: "4000m" + memory: "4Gi" nvidia.com/gpu: "0" - volumeSize: 1Gi + volumeSize: 30Gi nodeSelector: {} tolerations: [] service: @@ -22,16 +25,19 @@ webui: image: ghcr.io/ollama-webui/ollama-webui:main servicePort: 8080 resources: - limits: + requests: cpu: "500m" memory: "500Mi" + limits: + cpu: "1000m" + memory: "1Gi" ingress: enabled: true annotations: # Use appropriate annotations for your Ingress controller, e.g., for NGINX: # nginx.ingress.kubernetes.io/rewrite-target: / host: ollama.minikube.local - volumeSize: 1Gi + volumeSize: 2Gi nodeSelector: {} tolerations: [] service: diff --git a/kubernetes/manifest/base/ollama-statefulset.yaml b/kubernetes/manifest/base/ollama-statefulset.yaml index ee63faa9..eb91c418 100644 --- a/kubernetes/manifest/base/ollama-statefulset.yaml +++ b/kubernetes/manifest/base/ollama-statefulset.yaml @@ -20,9 +20,13 @@ spec: ports: - containerPort: 11434 resources: - limits: + requests: cpu: "2000m" memory: "2Gi" + limits: + cpu: "4000m" + memory: "4Gi" + nvidia.com/gpu: "0" volumeMounts: - name: ollama-volume mountPath: /root/.ollama @@ -34,4 +38,4 @@ spec: accessModes: [ "ReadWriteOnce" ] resources: requests: - storage: 1Gi \ No newline at end of file + storage: 30Gi \ No newline at end of file diff --git a/kubernetes/manifest/base/webui-deployment.yaml b/kubernetes/manifest/base/webui-deployment.yaml index 762c09ef..e67e562b 100644 --- a/kubernetes/manifest/base/webui-deployment.yaml +++ b/kubernetes/manifest/base/webui-deployment.yaml @@ -19,9 +19,12 @@ spec: ports: - containerPort: 8080 resources: - limits: + requests: cpu: "500m" memory: "500Mi" + limits: + cpu: "1000m" + memory: "1Gi" env: - name: OLLAMA_API_BASE_URL value: "http://ollama-service.ollama-namespace.svc.cluster.local:11434/api" diff --git a/kubernetes/manifest/base/webui-pvc.yaml b/kubernetes/manifest/base/webui-pvc.yaml index 9680c238..285dfeef 100644 --- a/kubernetes/manifest/base/webui-pvc.yaml +++ b/kubernetes/manifest/base/webui-pvc.yaml @@ -9,4 +9,4 @@ spec: accessModes: ["ReadWriteOnce"] resources: requests: - storage: 1Gi \ No newline at end of file + storage: 2Gi \ No newline at end of file