feat: support open-webui charts
This commit is contained in:
65
open-webui/charts/pipelines/templates/_helpers.tpl
Normal file
65
open-webui/charts/pipelines/templates/_helpers.tpl
Normal file
@ -0,0 +1,65 @@
|
||||
{{/*
|
||||
Allow the release namespace to be overridden for multi-namespace deployments in combined charts
|
||||
*/}}
|
||||
{{- define "pipelines.namespace" -}}
|
||||
{{- if .Values.namespaceOverride -}}
|
||||
{{- .Values.namespaceOverride -}}
|
||||
{{- else -}}
|
||||
{{- .Release.Namespace -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Set the name of the Pipelines resources
|
||||
*/}}
|
||||
{{- define "pipelines.name" -}}
|
||||
{{- default .Release.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create the chart name and version for the chart label
|
||||
*/}}
|
||||
{{- define "chart.name" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the base labels to include on chart resources
|
||||
*/}}
|
||||
{{- define "base.labels" -}}
|
||||
helm.sh/chart: {{ include "chart.name" . }}
|
||||
{{- if .Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create selector labels to include on all resources
|
||||
*/}}
|
||||
{{- define "base.selectorLabels" -}}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create selector labels to include on all Pipelines resources
|
||||
*/}}
|
||||
{{- define "pipelines.selectorLabels" -}}
|
||||
{{ include "base.selectorLabels" . }}
|
||||
app.kubernetes.io/component: {{ .Chart.Name }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create labels to include on all Pipelines resources
|
||||
*/}}
|
||||
{{- define "pipelines.labels" -}}
|
||||
{{ include "base.labels" . }}
|
||||
{{ include "pipelines.selectorLabels" . }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the default port to use on the service if none is defined in values
|
||||
*/}}
|
||||
{{- define "pipelines.servicePort" -}}
|
||||
{{- .Values.service.port | default 9099 }}
|
||||
{{- end }}
|
||||
111
open-webui/charts/pipelines/templates/deployment.yaml
Normal file
111
open-webui/charts/pipelines/templates/deployment.yaml
Normal file
@ -0,0 +1,111 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "pipelines.name" . }}
|
||||
namespace: {{ include "pipelines.namespace" . }}
|
||||
labels:
|
||||
{{- include "pipelines.labels" . | nindent 4 }}
|
||||
{{- with .Values.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "pipelines.selectorLabels" . | nindent 6 }}
|
||||
{{- with .Values.strategy }}
|
||||
strategy:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "pipelines.labels" . | nindent 8 }}
|
||||
{{- with .Values.podLabels }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.podAnnotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.extraInitContainers }}
|
||||
initContainers:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
enableServiceLinks: false
|
||||
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken | default false }}
|
||||
{{- if .Values.serviceAccount.enable }}
|
||||
serviceAccountName: {{ .Values.serviceAccount.name | default (include "pipelines.name" .) }}
|
||||
{{- end }}
|
||||
{{- with .Values.podSecurityContext }}
|
||||
securityContext:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
{{- with .Values.image }}
|
||||
image: {{ .repository }}:{{ .tag | default $.Chart.AppVersion }}
|
||||
imagePullPolicy: {{ .pullPolicy }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: {{ .Values.service.containerPort }}
|
||||
{{- with .Values.resources }}
|
||||
resources: {{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
{{- with .Values.containerSecurityContext }}
|
||||
securityContext:
|
||||
{{- toYaml . | nindent 10 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /app/pipelines
|
||||
{{- with .Values.volumeMounts }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
env:
|
||||
{{- if .Values.extraEnvVars }}
|
||||
{{- toYaml .Values.extraEnvVars | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonEnvVars }}
|
||||
{{- toYaml .Values.commonEnvVars | nindent 8 }}
|
||||
{{- end }}
|
||||
tty: true
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.hostAliases }}
|
||||
hostAliases:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
{{- if and .Values.persistence.enabled .Values.persistence.existingClaim }}
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .Values.persistence.existingClaim }}
|
||||
{{- else if not .Values.persistence.enabled }}
|
||||
- name: data
|
||||
emptyDir: {}
|
||||
{{- else if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ include "pipelines.name" . }}
|
||||
{{- end }}
|
||||
{{- with .Values.volumes }}
|
||||
{{- toYaml . | nindent 6 }}
|
||||
{{- end }}
|
||||
@ -0,0 +1,6 @@
|
||||
{{- if .Values.extraResources }}
|
||||
{{- range .Values.extraResources }}
|
||||
---
|
||||
{{ toYaml . | nindent 0 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
28
open-webui/charts/pipelines/templates/pvc.yaml
Normal file
28
open-webui/charts/pipelines/templates/pvc.yaml
Normal file
@ -0,0 +1,28 @@
|
||||
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: {{ include "pipelines.name" . }}
|
||||
namespace: {{ include "pipelines.namespace" . }}
|
||||
labels:
|
||||
{{- include "pipelines.selectorLabels" . | nindent 4 }}
|
||||
{{- with .Values.persistence.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes:
|
||||
{{- range .Values.persistence.accessModes }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.persistence.size }}
|
||||
{{- if .Values.persistence.storageClass }}
|
||||
storageClassName: {{ .Values.persistence.storageClass }}
|
||||
{{- end }}
|
||||
{{- with .Values.persistence.selector }}
|
||||
selector:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
13
open-webui/charts/pipelines/templates/service-account.yaml
Normal file
13
open-webui/charts/pipelines/templates/service-account.yaml
Normal file
@ -0,0 +1,13 @@
|
||||
{{- if .Values.serviceAccount.enable }}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ .Values.serviceAccount.name | default (include "pipelines.name" .) }}
|
||||
namespace: {{ include "pipelines.namespace" . }}
|
||||
labels:
|
||||
{{- include "pipelines.labels" . | nindent 4 }}
|
||||
{{- with .Values.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
30
open-webui/charts/pipelines/templates/service.yaml
Normal file
30
open-webui/charts/pipelines/templates/service.yaml
Normal file
@ -0,0 +1,30 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "pipelines.name" . }}
|
||||
namespace: {{ include "pipelines.namespace" . }}
|
||||
labels:
|
||||
{{- include "pipelines.labels" . | nindent 4 }}
|
||||
{{- with .Values.service.labels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.service.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
selector:
|
||||
{{- include "pipelines.selectorLabels" . | nindent 4 }}
|
||||
type: {{ .Values.service.type | default "ClusterIP" }}
|
||||
ports:
|
||||
- protocol: TCP
|
||||
name: http
|
||||
port: {{ .Values.service.port }}
|
||||
targetPort: http
|
||||
{{- if .Values.service.nodePort }}
|
||||
nodePort: {{ .Values.service.nodePort | int }}
|
||||
{{- end }}
|
||||
{{- if .Values.service.loadBalancerClass }}
|
||||
loadBalancerClass: {{ .Values.service.loadBalancerClass | quote }}
|
||||
{{- end }}
|
||||
|
||||
Reference in New Issue
Block a user