From 05e31494c2ce13b9254922816d611cff4f52a9a8 Mon Sep 17 00:00:00 2001 From: duhow Date: Mon, 19 Feb 2024 22:33:22 +0100 Subject: [PATCH] rename ports, labels and service settings --- kubernetes/helm/templates/ollama-service.yaml | 4 ++-- kubernetes/helm/templates/ollama-statefulset.yaml | 5 +++-- kubernetes/helm/templates/webui-deployment.yaml | 7 ++++--- kubernetes/helm/templates/webui-ingress.yaml | 4 ++-- kubernetes/helm/templates/webui-pvc.yaml | 4 ++-- kubernetes/helm/templates/webui-service.yaml | 4 ++-- kubernetes/helm/values.yaml | 15 ++++++++++----- 7 files changed, 25 insertions(+), 18 deletions(-) diff --git a/kubernetes/helm/templates/ollama-service.yaml b/kubernetes/helm/templates/ollama-service.yaml index f1512c5a4..be5a6657e 100644 --- a/kubernetes/helm/templates/ollama-service.yaml +++ b/kubernetes/helm/templates/ollama-service.yaml @@ -12,6 +12,6 @@ spec: ports: - protocol: TCP name: http - port: {{ .port }} - targetPort: {{ .containerPort }} + port: http + targetPort: {{ .port }} {{- end }} diff --git a/kubernetes/helm/templates/ollama-statefulset.yaml b/kubernetes/helm/templates/ollama-statefulset.yaml index cc37a2316..19204347a 100644 --- a/kubernetes/helm/templates/ollama-statefulset.yaml +++ b/kubernetes/helm/templates/ollama-statefulset.yaml @@ -13,13 +13,14 @@ spec: template: metadata: labels: - {{- include "ollama.selectorLabels" . | nindent 8 }} + {{- include "ollama.labels" . | nindent 8 }} spec: containers: - name: {{ include "ollama.name" . }} image: {{ .Values.ollama.image }} ports: - - containerPort: {{ .Values.ollama.servicePort }} + - name: http + containerPort: {{ .Values.ollama.service.containerPort }} env: {{- if .Values.ollama.gpu.enabled }} - name: PATH diff --git a/kubernetes/helm/templates/webui-deployment.yaml b/kubernetes/helm/templates/webui-deployment.yaml index 4b08da785..3e62ac9f2 100644 --- a/kubernetes/helm/templates/webui-deployment.yaml +++ b/kubernetes/helm/templates/webui-deployment.yaml @@ -5,20 +5,21 @@ metadata: labels: {{- include "open-webui.labels" . | nindent 4 }} spec: - replicas: 1 + replicas: {{ .Values.webui.replicaCount }} selector: matchLabels: {{- include "open-webui.selectorLabels" . | nindent 6 }} template: metadata: labels: - {{- include "open-webui.selectorLabels" . | nindent 8 }} + {{- include "open-webui.labels" . | nindent 8 }} spec: containers: - name: {{ .Chart.Name }} image: {{ .Values.webui.image }} ports: - - containerPort: 8080 + - name: http + containerPort: {{ .Values.webui.service.containerPort }} {{- with .Values.webui.resources }} resources: {{- toYaml . | nindent 10 }} {{- end }} diff --git a/kubernetes/helm/templates/webui-ingress.yaml b/kubernetes/helm/templates/webui-ingress.yaml index 9d943c07e..4cb1b1390 100644 --- a/kubernetes/helm/templates/webui-ingress.yaml +++ b/kubernetes/helm/templates/webui-ingress.yaml @@ -18,7 +18,7 @@ spec: pathType: Prefix backend: service: - name: open-webui-service + name: {{ include "open-webui.name" . }} port: - number: {{ .Values.webui.servicePort }} + number: {{ .Values.webui.service.port }} {{- end }} diff --git a/kubernetes/helm/templates/webui-pvc.yaml b/kubernetes/helm/templates/webui-pvc.yaml index 711117fb9..3ceed2ca6 100644 --- a/kubernetes/helm/templates/webui-pvc.yaml +++ b/kubernetes/helm/templates/webui-pvc.yaml @@ -3,9 +3,9 @@ kind: PersistentVolumeClaim metadata: name: {{ include "open-webui.name" . }} labels: - {{- include "open-webui.labels" . | nindent 4 }} + {{- include "open-webui.selectorLabels" . | nindent 4 }} spec: accessModes: [ "ReadWriteOnce" ] resources: requests: - storage: {{ .Values.webui.volumeSize }} + storage: {{ .Values.webui.persistence.size }} diff --git a/kubernetes/helm/templates/webui-service.yaml b/kubernetes/helm/templates/webui-service.yaml index d126968d3..bd87c853d 100644 --- a/kubernetes/helm/templates/webui-service.yaml +++ b/kubernetes/helm/templates/webui-service.yaml @@ -11,8 +11,8 @@ spec: type: {{ .type }} ports: - protocol: TCP - port: {{ .port }} - targetPort: {{ .containerPort }} + port: http + targetPort: {{ .port }} {{- if .nodePort }} nodePort: {{ .nodePort }} {{- end }} diff --git a/kubernetes/helm/values.yaml b/kubernetes/helm/values.yaml index ff96fa277..3e9f6a958 100644 --- a/kubernetes/helm/values.yaml +++ b/kubernetes/helm/values.yaml @@ -1,7 +1,6 @@ ollama: replicaCount: 1 image: ollama/ollama:latest - servicePort: 11434 resources: requests: cpu: "2000m" @@ -15,13 +14,14 @@ ollama: tolerations: [] service: type: ClusterIP + port: 80 + containerPort: 11434 gpu: enabled: false webui: replicaCount: 1 image: ghcr.io/open-webui/open-webui:main - servicePort: 8080 resources: requests: cpu: "500m" @@ -31,12 +31,17 @@ webui: memory: "1Gi" ingress: enabled: true - annotations: + annotations: {} # Use appropriate annotations for your Ingress controller, e.g., for NGINX: # nginx.ingress.kubernetes.io/rewrite-target: / host: open-webui.minikube.local - volumeSize: 2Gi + persistence: + enabled: true + size: 2Gi nodeSelector: {} tolerations: [] service: - type: NodePort + type: ClusterIP + port: 80 + containerPort: 8080 + nodePort: ""