Refactor paperless-ai Helm chart for improved configuration
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
		
			
				
	
				Build Helm Chart / helm-package (push) Failing after 3s
				
			
		
		
	
	
				
					
				
			
		
			Some checks failed
		
		
	
	Build Helm Chart / helm-package (push) Failing after 3s
				
			This update substantially refactors the paperless-ai Helm chart. Key changes include: - Complete removal of outdated files: `.helmignore`, `LICENSE`, `README.adoc`, and several template files like `configfileConfigmap.yaml`, `configmap.yaml`, `dataPvc.yaml`, `envfileSecret.yaml`, `openAiApiSecret.yaml`, `paperlessApiSecret.yaml`, and others. - Introduction of a new Persistent Volume Claim configuration in `pvc.yaml` to simplify storage management. - Significant updates to `Chart.yaml` for better metadata, including a new maintainer and project description in German. - Enhancements to the main deployment template in `deployment.yaml`, focusing on clarity and proper utilization of Kubernetes security contexts, environment variables, and container properties. - Updated service definitions in `service.yaml` with better labels and service properties. - Refined the `ingress.yaml` to improve external service access management, including annotations for potential customization. These changes were implemented to modernize the Helm chart based on the current best practices, improve user experience, and set a foundation for future enhancements. There are no breaking changes to the existing user configurations.
This commit is contained in:
		@@ -1,79 +1,67 @@
 | 
			
		||||
{{/*
 | 
			
		||||
Expand the name of the chart.
 | 
			
		||||
_helpers.tpl
 | 
			
		||||
Enthält nützliche Template-Funktionen, die in anderen Chart-Templates verwendet werden.
 | 
			
		||||
*/}}
 | 
			
		||||
 | 
			
		||||
{{/*
 | 
			
		||||
Erweitert den Namen des Charts.
 | 
			
		||||
*/}}
 | 
			
		||||
{{- define "paperless-ai.name" -}}
 | 
			
		||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
 | 
			
		||||
{{- end -}}
 | 
			
		||||
 | 
			
		||||
{{/*
 | 
			
		||||
Create a default fully qualified app name.
 | 
			
		||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
 | 
			
		||||
If release name contains chart name it will be used as a full name.
 | 
			
		||||
Erstellt einen vollständig qualifizierten App-Namen.
 | 
			
		||||
Wir kürzen auf 63 Zeichen, da einige Kubernetes-Namenfelder darauf beschränkt sind (gemäß DNS-Namensspezifikation).
 | 
			
		||||
Wenn der Release-Name den Chart-Namen enthält, wird er als vollständiger Name verwendet.
 | 
			
		||||
*/}}
 | 
			
		||||
{{- define "paperless-ai.fullname" -}}
 | 
			
		||||
{{- if .Values.fullnameOverride }}
 | 
			
		||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
 | 
			
		||||
{{- else }}
 | 
			
		||||
{{- $name := default .Chart.Name .Values.nameOverride }}
 | 
			
		||||
{{- if contains $name .Release.Name }}
 | 
			
		||||
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
 | 
			
		||||
{{- else }}
 | 
			
		||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
{{- if .Values.fullnameOverride -}}
 | 
			
		||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
 | 
			
		||||
{{- else -}}
 | 
			
		||||
{{- $name := default .Chart.Name .Values.nameOverride -}}
 | 
			
		||||
{{- if contains $name .Release.Name -}}
 | 
			
		||||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
 | 
			
		||||
{{- else -}}
 | 
			
		||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
 | 
			
		||||
{{- end -}}
 | 
			
		||||
{{- end -}}
 | 
			
		||||
{{- end -}}
 | 
			
		||||
 | 
			
		||||
{{/*
 | 
			
		||||
Create chart name and version as used by the chart label.
 | 
			
		||||
Erstellt den Chart-Namen und die Version, wie sie vom Chart-Label verwendet werden.
 | 
			
		||||
*/}}
 | 
			
		||||
{{- define "paperless-ai.chart" -}}
 | 
			
		||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
 | 
			
		||||
{{- end -}}
 | 
			
		||||
 | 
			
		||||
{{/*
 | 
			
		||||
Common labels
 | 
			
		||||
Gängige Labels, die allen Ressourcen hinzugefügt werden.
 | 
			
		||||
*/}}
 | 
			
		||||
{{- define "paperless-ai.labels" -}}
 | 
			
		||||
helm.sh/chart: {{ include "paperless-ai.chart" . }}
 | 
			
		||||
{{ include "paperless-ai.selectorLabels" . }}
 | 
			
		||||
{{- if .Chart.AppVersion }}
 | 
			
		||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
 | 
			
		||||
app.kubernetes.io/app-version: {{ .Chart.AppVersion | quote }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
{{- end -}}
 | 
			
		||||
 | 
			
		||||
{{/*
 | 
			
		||||
Selector labels
 | 
			
		||||
Selector-Labels, die für die Auswahl von Pods verwendet werden.
 | 
			
		||||
*/}}
 | 
			
		||||
{{- define "paperless-ai.selectorLabels" -}}
 | 
			
		||||
app.kubernetes.io/name: {{ include "paperless-ai.name" . }}
 | 
			
		||||
app.kubernetes.io/instance: {{ .Release.Name }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
{{- end -}}
 | 
			
		||||
 | 
			
		||||
{{/*
 | 
			
		||||
Create the name of the service account to use
 | 
			
		||||
Erstellt den Namen des zu verwendenden Service Accounts.
 | 
			
		||||
*/}}
 | 
			
		||||
{{- define "paperless-ai.serviceAccountName" -}}
 | 
			
		||||
{{- if .Values.serviceAccount.create }}
 | 
			
		||||
{{- default (include "paperless-ai.fullname" .) .Values.serviceAccount.name }}
 | 
			
		||||
{{- else }}
 | 
			
		||||
{{- default "default" .Values.serviceAccount.name }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
 | 
			
		||||
{{/*
 | 
			
		||||
Generiert den Inhalt der .env-Datei aus den Werten in .Values.secretEnv
 | 
			
		||||
*/}}
 | 
			
		||||
{{- define "generateEnv" -}}
 | 
			
		||||
{{- if .Values.paperless.apiUrl }}PAPERLESS_API_URL={{ .Values.paperless.apiUrl }}{{ "\n" }}{{- end }}
 | 
			
		||||
{{- if .Values.ai.provider }}AI_PROVIDER={{ .Values.ai.provider }}{{ "\n" }}{{- end }}
 | 
			
		||||
{{- if .Values.ai.addProcessedTag }}ADD_AI_PROCESSED_TAG={{ .Values.ai.addProcessedTag }}{{ "\n" }}{{- end }}
 | 
			
		||||
{{- if .Values.ai.processedTagName }}AI_PROCESSED_TAG_NAME={{ .Values.ai.processedTagName }}{{ "\n" }}{{- end }}
 | 
			
		||||
{{- if .Values.prompt.useTags }}USE_PROMPT_TAGS={{ .Values.prompt.useTags }}{{ "\n" }}{{- end }}
 | 
			
		||||
{{- if .Values.prompt.tags }}PROMPT_TAGS={{ .Values.prompt.tags }}{{ "\n" }}{{- end }}
 | 
			
		||||
{{- if .Values.scanInterval }}SCAN_INTERVAL={{ .Values.scanInterval }}{{ "\n" }}{{- end }}
 | 
			
		||||
{{- if .Values.systemPrompt }}SYSTEM_PROMPT=`{{ .Values.systemPrompt }}`{{ "\n" }}{{- end }}
 | 
			
		||||
{{- if .Values.processPredefinedDocuments }}PROCESS_PREDEFINED_DOCUMENTS={{ .Values.processPredefinedDocuments }}{{ "\n" }}{{- end }}
 | 
			
		||||
TAGS={{ .Values.tags }}{{ "\n" }}
 | 
			
		||||
{{- if .Values.openAi.model }}OPENAI_MODEL={{ .Values.openAi.model }}{{ "\n" }}{{- end }}
 | 
			
		||||
{{- end }}
 | 
			
		||||
{{- if .Values.serviceAccount.create -}}
 | 
			
		||||
    {{ default (include "paperless-ai.fullname" .) .Values.serviceAccount.name }}
 | 
			
		||||
{{- else -}}
 | 
			
		||||
    {{ default "default" .Values.serviceAccount.name }}
 | 
			
		||||
{{- end -}}
 | 
			
		||||
{{- end -}}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user