From 659669467c94518739bc6bfe567ae960aadc7007 Mon Sep 17 00:00:00 2001 From: MRColor <72873425+MRColorR@users.noreply.github.com> Date: Tue, 14 Jan 2025 00:56:55 +0100 Subject: [PATCH] Add option to set nodePort value for helm charts (#362) ## Summary Enhanced `kubeai` and `openwebui` Helm charts to support `NodePort` and `LoadBalancer` types with optional custom `nodePort` values for consistent and flexible service exposure. --- charts/kubeai/charts/openwebui/templates/service.yaml | 7 +++++-- charts/kubeai/charts/openwebui/values.yaml | 2 ++ charts/kubeai/templates/service.yaml | 11 +++++------ charts/kubeai/values.yaml | 9 ++++++++- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/charts/kubeai/charts/openwebui/templates/service.yaml b/charts/kubeai/charts/openwebui/templates/service.yaml index 518efda0..afd1e608 100644 --- a/charts/kubeai/charts/openwebui/templates/service.yaml +++ b/charts/kubeai/charts/openwebui/templates/service.yaml @@ -7,9 +7,12 @@ metadata: spec: type: {{ .Values.service.type }} ports: - - port: {{ .Values.service.port }} + - name: http + port: {{ .Values.service.port }} targetPort: http protocol: TCP - name: http + {{- with .Values.service.nodePort }} + nodePort: {{ . }} + {{- end }} selector: {{- include "openwebui.selectorLabels" . | nindent 4 }} diff --git a/charts/kubeai/charts/openwebui/values.yaml b/charts/kubeai/charts/openwebui/values.yaml index 6631afa9..7da4064a 100644 --- a/charts/kubeai/charts/openwebui/values.yaml +++ b/charts/kubeai/charts/openwebui/values.yaml @@ -42,6 +42,8 @@ securityContext: {} service: type: ClusterIP port: 80 + # openwebui nodeport (Optional): Specify NodePort for openwebui if Nodeport or LoadBalancer service type (leave empty for random assignment) + nodePort: "" ingress: enabled: false diff --git a/charts/kubeai/templates/service.yaml b/charts/kubeai/templates/service.yaml index e4ad1737..a24197ea 100644 --- a/charts/kubeai/templates/service.yaml +++ b/charts/kubeai/templates/service.yaml @@ -7,13 +7,12 @@ metadata: spec: type: {{ .Values.service.type }} ports: - - port: {{ .Values.service.port }} + - name: http + port: {{ .Values.service.port }} targetPort: http protocol: TCP - name: http - - port: 8080 - targetPort: 8080 - protocol: TCP - name: http-metrics + {{- with .Values.service.nodePort }} + nodePort: {{ . }} + {{- end }} selector: {{- include "kubeai.selectorLabels" . | nindent 4 }} diff --git a/charts/kubeai/values.yaml b/charts/kubeai/values.yaml index 14bd59e5..3f287692 100644 --- a/charts/kubeai/values.yaml +++ b/charts/kubeai/values.yaml @@ -198,6 +198,11 @@ messaging: # Configure the openwebui subchart. openwebui: fullnameOverride: "openwebui" + service: + type: ClusterIP # ClusterIP, NodePort, LoadBalancer + port: 80 + # openwebui nodeport (Optional): Specify NodePort for openwebui if Nodeport or LoadBalancer service type (leave empty for random assignment) + nodePort: "" image: tag: v0.3.19 env: @@ -284,8 +289,10 @@ securityContext: # runAsUser: 1000 service: - type: ClusterIP + type: ClusterIP # ClusterIP, NodePort, LoadBalancer port: 80 + # kubeai nodeport (Optional): Specify NodePort for kubeai if Nodeport or LoadBalancer service type (leave empty for random assignment) + nodePort: "" ingress: enabled: false