瀏覽代碼

feat(helm): adding lb class and labels for using it with Cilium CNI l2 annoncements mode

Zhecho Zhechev 1 年之前
父節點
當前提交
3c4cc60277
共有 2 個文件被更改,包括 13 次插入6 次删除
  1. 11 6
      kubernetes/helm/templates/webui-service.yaml
  2. 2 0
      kubernetes/helm/values.yaml

+ 11 - 6
kubernetes/helm/templates/webui-service.yaml

@@ -4,6 +4,9 @@ metadata:
   name: {{ include "open-webui.name" . }}
   name: {{ include "open-webui.name" . }}
   labels:
   labels:
     {{- include "open-webui.labels" . | nindent 4 }}
     {{- include "open-webui.labels" . | nindent 4 }}
+    {{- with .Values.webui.service.labels }}
+    {{- toYaml . | nindent 4 }}
+    {{- end }}
   {{- with .Values.webui.service.annotations }}
   {{- with .Values.webui.service.annotations }}
   annotations:
   annotations:
     {{- toYaml . | nindent 4 }}
     {{- toYaml . | nindent 4 }}
@@ -11,14 +14,16 @@ metadata:
 spec:
 spec:
   selector:
   selector:
     {{- include "open-webui.selectorLabels" . | nindent 4 }}
     {{- include "open-webui.selectorLabels" . | nindent 4 }}
-{{- with .Values.webui.service }}
-  type: {{ .type }}
+  type: {{ .Values.webui.service.type | default "ClusterIP" }}
   ports:
   ports:
   - protocol: TCP
   - protocol: TCP
     name: http
     name: http
-    port: {{ .port }}
+    port: {{ .Values.webui.service.port }}
     targetPort: http
     targetPort: http
-    {{- if .nodePort }}
-    nodePort: {{ .nodePort | int }}
+    {{- if .Values.webui.service.nodePort }}
+    nodePort: {{ .Values.webui.service.nodePort | int }}
     {{- end }}
     {{- end }}
-{{- end }}
+  {{- if .Values.webui.service.loadBalancerClass }}
+  loadBalancerClass: {{ .Values.webui.service.loadBalancerClass | quote }}
+  {{- end }}
+

+ 2 - 0
kubernetes/helm/values.yaml

@@ -70,3 +70,5 @@ webui:
     port: 80
     port: 80
     containerPort: 8080
     containerPort: 8080
     nodePort: ""
     nodePort: ""
+    labels: {}
+    loadBalancerClass: ""