Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [open-webui] add option for use hpa and pdb #163

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions charts/open-webui/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: open-webui
version: 5.10.1
appVersion: 0.5.10
version: 5.11.0
appVersion: 0.5.11
home: https://www.openwebui.com/
icon: >-
https://raw.githubusercontent.com/open-webui/open-webui/main/static/favicon.png
Expand Down
23 changes: 20 additions & 3 deletions charts/open-webui/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# open-webui

![Version: 5.10.0](https://img.shields.io/badge/Version-5.10.0-informational?style=flat-square) ![AppVersion: 0.5.10](https://img.shields.io/badge/AppVersion-0.5.10-informational?style=flat-square)
![Version: 5.11.0](https://img.shields.io/badge/Version-5.11.0-informational?style=flat-square) ![AppVersion: 0.5.11](https://img.shields.io/badge/AppVersion-0.5.11-informational?style=flat-square)

Open WebUI: A User-Friendly Web Interface for Chat Interactions 👋

Expand All @@ -12,6 +12,7 @@ Open WebUI: A User-Friendly Web Interface for Chat Interactions 👋
* <https://github.com/open-webui/open-webui/pkgs/container/open-webui>
* <https://github.com/otwld/ollama-helm/>
* <https://hub.docker.com/r/ollama/ollama>
* <https://charts.bitnami.com/bitnami>

## Installing

Expand Down Expand Up @@ -43,6 +44,13 @@ helm upgrade --install open-webui open-webui/open-webui
|-----|------|---------|-------------|
| affinity | object | `{}` | Affinity for pod assignment |
| annotations | object | `{}` | |
| autoscaling | object | `{"behavior":{},"enabled":false,"maxReplicas":5,"metrics":[],"minReplicas":1,"targetCPUUtilizationPercentage":50,"targetMemoryUtilizationPercentage":90}` | Configure horizontal pod autoscale (hpa) ref: <https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/> |
| autoscaling.behavior | object | `{}` | Configures the scaling behavior of the target in both Up and Down directions. |
| autoscaling.enabled | bool | `false` | Enable Horizontal Pod Autoscaler |
| autoscaling.maxReplicas | int | `5` | Maximum number of replicas |
| autoscaling.minReplicas | int | `1` | Minimum number of replicas |
| autoscaling.targetCPUUtilizationPercentage | int | `50` | Average CPU utilization percentage |
| autoscaling.targetMemoryUtilizationPercentage | int | `90` | Average memory utilization percentage |
| clusterDomain | string | `"cluster.local"` | Value of cluster domain |
| containerSecurityContext | object | `{}` | Configure container security context ref: <https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-containe> |
| copyAppData.resources | object | `{}` | |
Expand All @@ -52,20 +60,29 @@ helm upgrade --install open-webui open-webui/open-webui
| image | object | `{"pullPolicy":"IfNotPresent","repository":"ghcr.io/open-webui/open-webui","tag":""}` | Open WebUI image tags can be found here: https://github.com/open-webui/open-webui |
| imagePullSecrets | list | `[]` | Configure imagePullSecrets to use private registry ref: <https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry> |
| ingress.additionalHosts | list | `[]` | |
| ingress.annotations | object | `{}` | Use appropriate annotations for your Ingress controller, e.g., for NGINX: nginx.ingress.kubernetes.io/rewrite-target: / |
| ingress.annotations | object | `{}` | Use appropriate annotations for your Ingress controller, e.g., for NGINX: |
| ingress.class | string | `""` | |
| ingress.enabled | bool | `false` | |
| ingress.existingSecret | string | `""` | |
| ingress.host | string | `""` | |
| ingress.host | string | `"chat.example.com"` | |
| ingress.tls | bool | `false` | |
| livenessProbe | object | `{}` | Probe for liveness of the Open WebUI container ref: <https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes> |
| managedCertificate.domains[0] | string | `"chat.example.com"` | |
| managedCertificate.enabled | bool | `false` | |
| managedCertificate.name | string | `"mydomain-chat-cert"` | |
| nameOverride | string | `""` | |
| namespaceOverride | string | `""` | |
| nodeSelector | object | `{}` | Node labels for pod assignment. |
| ollama.enabled | bool | `true` | Automatically install Ollama Helm chart from https://otwld.github.io/ollama-helm/. Use [Helm Values](https://github.com/otwld/ollama-helm/#helm-values) to configure |
| ollama.fullnameOverride | string | `"open-webui-ollama"` | If enabling embedded Ollama, update fullnameOverride to your desired Ollama name value, or else it will use the default ollama.name value from the Ollama chart |
| ollamaUrls | list | `[]` | A list of Ollama API endpoints. These can be added in lieu of automatically installing the Ollama Helm chart, or in addition to it. |
| openaiBaseApiUrl | string | `""` | OpenAI base API URL to use. Defaults to the Pipelines service endpoint when Pipelines are enabled, and "https://api.openai.com/v1" if Pipelines are not enabled and this value is blank |
| pdb | object | `{"annotations":{},"enabled":false,"labels":{},"maxUnavailable":"","minAvailable":1}` | Deploy a PodDisruptionBudget ref: <https://kubernetes.io/docs/tasks/run-application/configure-pdb/> |
| pdb.annotations | object | `{}` | Annotations to be added to pdb |
| pdb.enabled | bool | `false` | Enable PodDisruptionBudget |
| pdb.labels | object | `{}` | Labels to be added to pdb |
| pdb.maxUnavailable | string | `""` | Number of pods that are unavailable after eviction as number or percentage (eg.: 50%). # Has higher precedence over `controller.pdb.minAvailable` |
| pdb.minAvailable | int | `1` | Number of pods that are available after eviction as number or percentage (eg.: 50%) |
| persistence.accessModes | list | `["ReadWriteOnce"]` | If using multiple replicas, you must update accessModes to ReadWriteMany |
| persistence.annotations | object | `{}` | |
| persistence.enabled | bool | `true` | |
Expand Down
41 changes: 41 additions & 0 deletions charts/open-webui/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "open-webui.name" . }}
namespace: {{ include "open-webui.namespace" . }}
labels:
{{- include "open-webui.labels" . | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "open-webui.name" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
{{- with .Values.autoscaling.metrics }}
{{- toYaml . | nindent 4 }}
{{- else }}
{{- with .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ . }}
{{- end }}
{{- with .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ . }}
{{- end }}
{{- end }}
{{- with .Values.autoscaling.behavior }}
behavior:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
27 changes: 27 additions & 0 deletions charts/open-webui/templates/pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{- if .Values.pdb.enabled }}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "open-webui.name" . }}
namespace: {{ include "open-webui.namespace" . }}
labels:
{{- include "open-webui.labels" . | nindent 4 }}
{{- with .Values.pdb.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.pdb.annotations }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
spec:
{{- with .Values.pdb.maxUnavailable }}
maxUnavailable: {{ . }}
{{- else }}
minAvailable: {{ .Values.pdb.minAvailable }}
{{- end }}
selector:
matchLabels:
{{- include "open-webui.selectorLabels" . | nindent 6 }}
{{- end }}
50 changes: 47 additions & 3 deletions charts/open-webui/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ managedCertificate:
ingress:
enabled: false
class: ""
# -- Use appropriate annotations for your Ingress controller, e.g., for NGINX:
# -- Use appropriate annotations for your Ingress controller, e.g., for NGINX:
annotations: {}
# # Example for GKE Ingress
# kubernetes.io/ingress.class: "gce"
Expand All @@ -176,8 +176,8 @@ ingress:
# nginx.ingress.kubernetes.io/ssl-redirect: "true"
# nginx.ingress.kubernetes.io/permanent-redirect: "https://chat.example.com"
# networking.gke.io/managed-certificates: "mydomain-chat-cert"
# # nginx.ingress.kubernetes.io/rewrite-target: /
host: "chat.example.com" # update to your real domain
# # nginx.ingress.kubernetes.io/rewrite-target: /
host: "chat.example.com" # update to your real domain
additionalHosts: []
tls: false
existingSecret: ""
Expand Down Expand Up @@ -282,6 +282,50 @@ containerSecurityContext:
# seccompProfile:
# type: "RuntimeDefault"

# -- Configure horizontal pod autoscale (hpa)
# ref: <https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/>
autoscaling:
# -- Enable Horizontal Pod Autoscaler
enabled: false
# -- Minimum number of replicas
minReplicas: 1
# -- Maximum number of replicas
maxReplicas: 5
# -- Average CPU utilization percentage
targetCPUUtilizationPercentage: 50
# -- Average memory utilization percentage
targetMemoryUtilizationPercentage: 90
# -- Configures the scaling behavior of the target in both Up and Down directions.
behavior: {}
# scaleDown:
# stabilizationWindowSeconds: 300
# policies:
# - type: Pods
# value: 1
# periodSeconds: 180
# scaleUp:
# stabilizationWindowSeconds: 300
# policies:
# - type: Pods
# value: 2
# periodSeconds: 60
metrics: []

# -- Deploy a PodDisruptionBudget
# ref: <https://kubernetes.io/docs/tasks/run-application/configure-pdb/>
pdb:
# -- Enable PodDisruptionBudget
enabled: false
# -- Labels to be added to pdb
labels: {}
# -- Annotations to be added to pdb
annotations: {}
# -- Number of pods that are available after eviction as number or percentage (eg.: 50%)
minAvailable: 1
# -- Number of pods that are unavailable after eviction as number or percentage (eg.: 50%).
## Has higher precedence over `controller.pdb.minAvailable`
maxUnavailable: ""

# -- Extra resources to deploy with Open WebUI
extraResources:
[]
Expand Down
Loading