Add Helm chart for paperless-ai document management system
This commit introduces a new Helm chart for deploying paperless-ai, an AI- enhanced document management system based on paperless-ngx. The chart includes: - Complete deployment configuration with configurable replicas - Persistent volume support for data storage - Secret management for API tokens and keys - Environment variable configuration via ConfigMaps and Secrets - Ingress configuration options - Support for both OpenAI and Ollama AI providers - Customizable system prompts and document processing settings - CI workflow for automated chart packaging and publishing The chart enables Kubernetes users to easily deploy and configure the paperless-ai system with proper separation of configuration and secrets.
This commit is contained in:
43
.gitea/workflows/build-chart-paperless-ai.yml
Normal file
43
.gitea/workflows/build-chart-paperless-ai.yml
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
name: "Build Helm Chart"
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths:
|
||||||
|
- "charts/paperless-ai/Chart.yaml"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
helm-package:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
APP: charts/paperless-ai
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set Helm Chart App Name and Version
|
||||||
|
id: get_version
|
||||||
|
run: |
|
||||||
|
APP_NAME=$(grep -oP '(?<=^name: ).*' ${{ env.APP }}/Chart.yaml)
|
||||||
|
echo "Helm Chart App Name: $APP_NAME"
|
||||||
|
echo "::set-output name=app::$APP_NAME"
|
||||||
|
|
||||||
|
CHART_VERSION=$(grep -oP '(?<=^version: ).*' ${{ env.APP }}/Chart.yaml)
|
||||||
|
echo "Helm Chart version: $CHART_VERSION"
|
||||||
|
echo "::set-output name=tag::$CHART_VERSION"
|
||||||
|
|
||||||
|
- name: Setup Helm
|
||||||
|
run: |
|
||||||
|
#curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
|
||||||
|
curl -kSso /usr/local/bin/helm https://debmirror.cooltux.net/helm-v3.18.3 && chmod +x /usr/local/bin/helm
|
||||||
|
helm version
|
||||||
|
|
||||||
|
- name: Package Helm Chart
|
||||||
|
run: |
|
||||||
|
helm dependency update ${{ env.APP }}
|
||||||
|
helm lint ${{ env.APP }}
|
||||||
|
helm package ${{ env.APP }}
|
||||||
|
|
||||||
|
- name: Upload Helm Package to repo
|
||||||
|
run: |
|
||||||
|
curl --user ${{ secrets.USER }}:${{ secrets.TOKEN }} -X POST --upload-file ./${{ steps.get_version.outputs.app }}-${{ steps.get_version.outputs.tag }}.tgz ${{ vars.HELMREGISTRY }}/api/packages/${{ vars.OWNER }}/helm/api/charts
|
23
charts/paperless-ai/paperless-ai/.helmignore
Normal file
23
charts/paperless-ai/paperless-ai/.helmignore
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Patterns to ignore when building packages.
|
||||||
|
# This supports shell glob matching, relative path matching, and
|
||||||
|
# negation (prefixed with !). Only one pattern per line.
|
||||||
|
.DS_Store
|
||||||
|
# Common VCS dirs
|
||||||
|
.git/
|
||||||
|
.gitignore
|
||||||
|
.bzr/
|
||||||
|
.bzrignore
|
||||||
|
.hg/
|
||||||
|
.hgignore
|
||||||
|
.svn/
|
||||||
|
# Common backup files
|
||||||
|
*.swp
|
||||||
|
*.bak
|
||||||
|
*.tmp
|
||||||
|
*.orig
|
||||||
|
*~
|
||||||
|
# Various IDEs
|
||||||
|
.project
|
||||||
|
.idea/
|
||||||
|
*.tmproj
|
||||||
|
.vscode/
|
26
charts/paperless-ai/paperless-ai/Chart.yaml
Normal file
26
charts/paperless-ai/paperless-ai/Chart.yaml
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
apiVersion: v2
|
||||||
|
name: paperless-ai
|
||||||
|
description: A Helm chart for deploying clusterzx/paperless-ai on Kubernetes.
|
||||||
|
type: application
|
||||||
|
home: https://github.com/ChiliChonka/paperless-ai-helm-chart
|
||||||
|
keywords:
|
||||||
|
- paperless-ngx
|
||||||
|
- paperless
|
||||||
|
- paperless-ai
|
||||||
|
- Content Management System
|
||||||
|
- Document Management System
|
||||||
|
- Machine Learning
|
||||||
|
- Artificial Intelligence
|
||||||
|
- Ollama
|
||||||
|
- OpenAI API
|
||||||
|
- Automated Document Analyzer
|
||||||
|
maintainers:
|
||||||
|
- name: ChiliChonka
|
||||||
|
url: https://github.com/ChiliChonka
|
||||||
|
sources:
|
||||||
|
- https://github.com/ChiliChonka/paperless-ai-helm-chart
|
||||||
|
- https://github.com/clusterzx/paperless-ai
|
||||||
|
- https://github.com/paperless-ngx/paperless-ngx
|
||||||
|
- https://github.com/ChiliChonka/paperless-ngx-helm-chart
|
||||||
|
version: 0.1.0
|
||||||
|
appVersion: "2.1.3"
|
21
charts/paperless-ai/paperless-ai/LICENSE
Normal file
21
charts/paperless-ai/paperless-ai/LICENSE
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2025 Marko Oldenburg
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
33
charts/paperless-ai/paperless-ai/README.adoc
Normal file
33
charts/paperless-ai/paperless-ai/README.adoc
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
= paperless-ai-helm-chart
|
||||||
|
|
||||||
|
A Helm chart for deploying https://github.com/clusterzx/paperless-ai[clusterzx/paperless-ai] on Kubernetes.
|
||||||
|
|
||||||
|
== 🚧 Under Construction 🚧
|
||||||
|
|
||||||
|
Thank you for visiting the *paperless-ai Helm Chart* repository! 🎉
|
||||||
|
|
||||||
|
This project is currently under construction, and we are actively working on setting it up.
|
||||||
|
Please check back soon for updates, or feel free to follow the repository to stay informed about our progress.
|
||||||
|
|
||||||
|
In the meantime, if you have any questions or suggestions, don't hesitate to open an issue or reach out.
|
||||||
|
|
||||||
|
Thank you for your patience and support!
|
||||||
|
|
||||||
|
The paperless-ai-helm-chart Team ❤️
|
||||||
|
|
||||||
|
|
||||||
|
== Helm Chart
|
||||||
|
|
||||||
|
=== Repository
|
||||||
|
|
||||||
|
The helm chart is not deployed to a repository yet.
|
||||||
|
|
||||||
|
=== Installation
|
||||||
|
|
||||||
|
You can define your custom values files based on `paperless-ai/values.yaml`. Just copy and update the values, which should be overwritten and delete the other parts out of your customized values.yaml file.
|
||||||
|
|
||||||
|
Install the helm chart with the following command:
|
||||||
|
|
||||||
|
`helm upgrade --install MY-RELEASE ./paperless-ai -f YOUR-CUSTOM-VALUES-FILE.yaml`
|
||||||
|
|
||||||
|
Please keep in mind to set the paperless configuration. See current values.yaml file.
|
17
charts/paperless-ai/paperless-ai/files/config.js
Normal file
17
charts/paperless-ai/paperless-ai/files/config.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
require('dotenv').config();
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
paperless: {
|
||||||
|
apiUrl: process.env.PAPERLESS_API_URL,
|
||||||
|
apiToken: process.env.PAPERLESS_API_TOKEN
|
||||||
|
},
|
||||||
|
openai: {
|
||||||
|
apiKey: process.env.OPENAI_API_KEY
|
||||||
|
},
|
||||||
|
ollama: {
|
||||||
|
apiUrl: process.env.OLLAMA_API_URL || 'http://localhost:11434',
|
||||||
|
model: process.env.OLLAMA_MODEL || 'llama2'
|
||||||
|
},
|
||||||
|
aiProvider: process.env.AI_PROVIDER || 'openai',
|
||||||
|
scanInterval: process.env.SCAN_INTERVAL || '*/30 * * * *'
|
||||||
|
};
|
22
charts/paperless-ai/paperless-ai/templates/NOTES.txt
Normal file
22
charts/paperless-ai/paperless-ai/templates/NOTES.txt
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
1. Get the application URL by running these commands:
|
||||||
|
{{- if .Values.ingress.enabled }}
|
||||||
|
{{- range $host := .Values.ingress.hosts }}
|
||||||
|
{{- range .paths }}
|
||||||
|
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- else if contains "NodePort" .Values.service.type }}
|
||||||
|
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "paperless-ai.fullname" . }})
|
||||||
|
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
||||||
|
echo http://$NODE_IP:$NODE_PORT
|
||||||
|
{{- else if contains "LoadBalancer" .Values.service.type }}
|
||||||
|
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
||||||
|
You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "paperless-ai.fullname" . }}'
|
||||||
|
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "paperless-ai.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
|
||||||
|
echo http://$SERVICE_IP:{{ .Values.service.port }}
|
||||||
|
{{- else if contains "ClusterIP" .Values.service.type }}
|
||||||
|
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "paperless-ai.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
|
||||||
|
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
|
||||||
|
echo "Visit http://127.0.0.1:8080 to use your application"
|
||||||
|
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
|
||||||
|
{{- end }}
|
79
charts/paperless-ai/paperless-ai/templates/_helpers.tpl
Normal file
79
charts/paperless-ai/paperless-ai/templates/_helpers.tpl
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
{{/*
|
||||||
|
Expand the name of the chart.
|
||||||
|
*/}}
|
||||||
|
{{- define "paperless-ai.name" -}}
|
||||||
|
{{- 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.
|
||||||
|
*/}}
|
||||||
|
{{- 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 }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create chart name and version as used by the chart label.
|
||||||
|
*/}}
|
||||||
|
{{- define "paperless-ai.chart" -}}
|
||||||
|
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Common labels
|
||||||
|
*/}}
|
||||||
|
{{- 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 }}
|
||||||
|
{{- end }}
|
||||||
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Selector labels
|
||||||
|
*/}}
|
||||||
|
{{- define "paperless-ai.selectorLabels" -}}
|
||||||
|
app.kubernetes.io/name: {{ include "paperless-ai.name" . }}
|
||||||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create the name of the service account to use
|
||||||
|
*/}}
|
||||||
|
{{- 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 }}
|
@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: {{ include "paperless-ai.fullname" . }}-config-file
|
||||||
|
labels:
|
||||||
|
{{- include "paperless-ai.labels" . | nindent 4 }}
|
||||||
|
data:
|
||||||
|
config.js: |
|
||||||
|
{{- (.Files.Get "files/config.js") | nindent 4 }}
|
22
charts/paperless-ai/paperless-ai/templates/configmap.yaml
Normal file
22
charts/paperless-ai/paperless-ai/templates/configmap.yaml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: {{ include "paperless-ai.fullname" . }}-config
|
||||||
|
labels:
|
||||||
|
{{- include "paperless-ai.labels" . | nindent 4 }}
|
||||||
|
data:
|
||||||
|
{{- if .Values.paperless.apiUrl }}
|
||||||
|
PAPERLESS_API_URL: "{{ .Values.paperless.apiUrl }}"
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.aiProvider }}
|
||||||
|
AI_PROVIDER: "{{ .Values.aiProvider }}"
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.ollama.apiUrl }}
|
||||||
|
OLLAMA_API_URL: "{{ .Values.ollama.apiUrl }}"
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.ollama.model }}
|
||||||
|
OLLAMA_MODEL: "{{ .Values.ollama.model }}"
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.scanInterval }}
|
||||||
|
SCAN_INTERVAL: "{{ .Values.scanInterval }}"
|
||||||
|
{{- end }}
|
15
charts/paperless-ai/paperless-ai/templates/dataPvc.yaml
Normal file
15
charts/paperless-ai/paperless-ai/templates/dataPvc.yaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{{- if .Values.persistence.data.enabled }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: {{ include "paperless-ai.fullname" . }}-pvc-data
|
||||||
|
labels:
|
||||||
|
{{- include "paperless-ai.labels" . | nindent 4 }}
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: {{ .Values.persistence.data.size }}
|
||||||
|
storageClassName: {{ .Values.persistence.data.storageClass }}
|
||||||
|
{{- end }}
|
99
charts/paperless-ai/paperless-ai/templates/deployment.yaml
Normal file
99
charts/paperless-ai/paperless-ai/templates/deployment.yaml
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: {{ include "paperless-ai.fullname" . }}
|
||||||
|
labels:
|
||||||
|
{{- include "paperless-ai.labels" . | nindent 4 }}
|
||||||
|
spec:
|
||||||
|
replicas: {{ .Values.replicaCount }}
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
{{- include "paperless-ai.selectorLabels" . | nindent 6 }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
{{- with .Values.podAnnotations }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
labels:
|
||||||
|
{{- include "paperless-ai.labels" . | nindent 8 }}
|
||||||
|
{{- with .Values.podLabels }}
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- with .Values.imagePullSecrets }}
|
||||||
|
imagePullSecrets:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
securityContext:
|
||||||
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||||
|
containers:
|
||||||
|
- name: {{ .Chart.Name }}
|
||||||
|
securityContext:
|
||||||
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||||
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
||||||
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
containerPort: {{ .Values.service.port }}
|
||||||
|
protocol: TCP
|
||||||
|
livenessProbe:
|
||||||
|
{{- toYaml .Values.livenessProbe | nindent 12 }}
|
||||||
|
readinessProbe:
|
||||||
|
{{- toYaml .Values.readinessProbe | nindent 12 }}
|
||||||
|
resources:
|
||||||
|
{{- toYaml .Values.resources | nindent 12 }}
|
||||||
|
{{- with .Values.envs }}
|
||||||
|
envs:
|
||||||
|
{{- toYaml . | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
|
envFrom:
|
||||||
|
# - configMapRef:
|
||||||
|
# name: {{ include "paperless-ai.fullname" . }}-config
|
||||||
|
{{- if .Values.openAi.apiKey }}
|
||||||
|
- secretRef:
|
||||||
|
name: {{ include "paperless-ai.fullname" . }}-open-ai-api
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.paperless.apiToken }}
|
||||||
|
- secretRef:
|
||||||
|
name: {{ include "paperless-ai.fullname" . }}-paperless-api
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.persistence.config.enabled .Values.persistence.data.enabled }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: {{ include "paperless-ai.fullname" . }}-volume-config
|
||||||
|
mountPath: {{ .Values.persistence.config.mountPath }}
|
||||||
|
subPath: {{ .Values.persistence.config.subPath }}
|
||||||
|
- name: {{ include "paperless-ai.fullname" . }}-volume-envfile
|
||||||
|
mountPath: {{ .Values.persistence.envfile.mountPath }}
|
||||||
|
subPath: {{ .Values.persistence.envfile.subPath }}
|
||||||
|
{{- if .Values.persistence.data.enabled }}
|
||||||
|
- name: {{ include "paperless-ai.fullname" . }}-volume-data
|
||||||
|
mountPath: {{ .Values.persistence.data.mountPath }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if or .Values.persistence.config.enabled .Values.persistence.data.enabled }}
|
||||||
|
volumes:
|
||||||
|
- name: {{ include "paperless-ai.fullname" . }}-volume-config
|
||||||
|
configMap:
|
||||||
|
name: {{ include "paperless-ai.fullname" . }}-config-file
|
||||||
|
- name: {{ include "paperless-ai.fullname" . }}-volume-envfile
|
||||||
|
secret:
|
||||||
|
secretName: {{ include "paperless-ai.fullname" . }}-env-file
|
||||||
|
{{- if .Values.persistence.data.enabled }}
|
||||||
|
- name: {{ include "paperless-ai.fullname" . }}-volume-data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: {{ include "paperless-ai.fullname" . }}-pvc-data
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.nodeSelector }}
|
||||||
|
nodeSelector:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.affinity }}
|
||||||
|
affinity:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.tolerations }}
|
||||||
|
tolerations:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
@ -0,0 +1,9 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
type: Opaque
|
||||||
|
metadata:
|
||||||
|
name: {{ include "paperless-ai.fullname" . }}-env-file
|
||||||
|
labels:
|
||||||
|
{{- include "paperless-ai.labels" . | nindent 4 }}
|
||||||
|
data:
|
||||||
|
.env: {{ include "generateEnv" . | b64enc }}
|
43
charts/paperless-ai/paperless-ai/templates/ingress.yaml
Normal file
43
charts/paperless-ai/paperless-ai/templates/ingress.yaml
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
{{- if .Values.ingress.enabled -}}
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: {{ include "paperless-ai.fullname" . }}
|
||||||
|
labels:
|
||||||
|
{{- include "paperless-ai.labels" . | nindent 4 }}
|
||||||
|
{{- with .Values.ingress.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- with .Values.ingress.className }}
|
||||||
|
ingressClassName: {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.ingress.tls }}
|
||||||
|
tls:
|
||||||
|
{{- range .Values.ingress.tls }}
|
||||||
|
- hosts:
|
||||||
|
{{- range .hosts }}
|
||||||
|
- {{ . | quote }}
|
||||||
|
{{- end }}
|
||||||
|
secretName: {{ .secretName }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
rules:
|
||||||
|
{{- range .Values.ingress.hosts }}
|
||||||
|
- host: {{ .host | quote }}
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
{{- range .paths }}
|
||||||
|
- path: {{ .path }}
|
||||||
|
{{- with .pathType }}
|
||||||
|
pathType: {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: {{ include "paperless-ai.fullname" $ }}
|
||||||
|
port:
|
||||||
|
number: {{ $.Values.service.port }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
@ -0,0 +1,11 @@
|
|||||||
|
{{- if .Values.openAi.apiKey }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ include "paperless-ai.fullname" . }}-open-ai-api
|
||||||
|
labels:
|
||||||
|
{{- include "paperless-ai.labels" . | nindent 4 }}
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
OPENAI_API_KEY: {{ .Values.openAi.apiKey | b64enc | quote }}
|
||||||
|
{{- end }}
|
@ -0,0 +1,11 @@
|
|||||||
|
{{- if .Values.paperless.apiToken }}
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: {{ include "paperless-ai.fullname" . }}-paperless-api
|
||||||
|
labels:
|
||||||
|
{{- include "paperless-ai.labels" . | nindent 4 }}
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
PAPERLESS_API_TOKEN: {{ .Values.paperless.apiToken | b64enc | quote }}
|
||||||
|
{{- end }}
|
15
charts/paperless-ai/paperless-ai/templates/service.yaml
Normal file
15
charts/paperless-ai/paperless-ai/templates/service.yaml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ include "paperless-ai.fullname" . }}
|
||||||
|
labels:
|
||||||
|
{{- include "paperless-ai.labels" . | nindent 4 }}
|
||||||
|
spec:
|
||||||
|
type: {{ .Values.service.type }}
|
||||||
|
ports:
|
||||||
|
- port: {{ .Values.service.port }}
|
||||||
|
targetPort: http
|
||||||
|
protocol: TCP
|
||||||
|
name: http
|
||||||
|
selector:
|
||||||
|
{{- include "paperless-ai.selectorLabels" . | nindent 4 }}
|
@ -0,0 +1,15 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: "{{ include "paperless-ai.fullname" . }}-test-connection"
|
||||||
|
labels:
|
||||||
|
{{- include "paperless-ai.labels" . | nindent 4 }}
|
||||||
|
annotations:
|
||||||
|
"helm.sh/hook": test
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: wget
|
||||||
|
image: busybox
|
||||||
|
command: ['wget']
|
||||||
|
args: ['{{ include "paperless-ai.fullname" . }}:{{ .Values.service.port }}']
|
||||||
|
restartPolicy: Never
|
152
charts/paperless-ai/paperless-ai/values.yaml
Normal file
152
charts/paperless-ai/paperless-ai/values.yaml
Normal file
@ -0,0 +1,152 @@
|
|||||||
|
# Default values for paperless-ai.
|
||||||
|
# This is a YAML-formatted file.
|
||||||
|
# Declare variables to be passed into your templates.
|
||||||
|
|
||||||
|
# This will set the replicaset count more information can be found here: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/
|
||||||
|
# Please keep this value to 1, while many instances running a crontab could lead to unknown results.
|
||||||
|
replicaCount: 1
|
||||||
|
|
||||||
|
# This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/
|
||||||
|
image:
|
||||||
|
repository: clusterzx/paperless-ai
|
||||||
|
# This sets the pull policy for images.
|
||||||
|
pullPolicy: IfNotPresent
|
||||||
|
# Overrides the image tag whose default is the chart appVersion.
|
||||||
|
# Use latest or nightly to be up2date.
|
||||||
|
tag: ""
|
||||||
|
|
||||||
|
# This is for the secretes for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
|
||||||
|
imagePullSecrets: []
|
||||||
|
# This is to override the chart name.
|
||||||
|
nameOverride: ""
|
||||||
|
fullnameOverride: ""
|
||||||
|
|
||||||
|
# This is for setting Kubernetes Annotations to a Pod.
|
||||||
|
# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
|
||||||
|
podAnnotations: {}
|
||||||
|
# This is for setting Kubernetes Labels to a Pod.
|
||||||
|
# For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
|
||||||
|
podLabels: {}
|
||||||
|
|
||||||
|
podSecurityContext: {}
|
||||||
|
# fsGroup: 2000
|
||||||
|
|
||||||
|
securityContext: {}
|
||||||
|
# capabilities:
|
||||||
|
# drop:
|
||||||
|
# - ALL
|
||||||
|
# readOnlyRootFilesystem: true
|
||||||
|
# runAsNonRoot: true
|
||||||
|
# runAsUser: 1000
|
||||||
|
|
||||||
|
# This is for setting up a service more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/
|
||||||
|
service:
|
||||||
|
# This sets the service type more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
|
||||||
|
type: ClusterIP
|
||||||
|
# This sets the ports more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports
|
||||||
|
port: 3000
|
||||||
|
|
||||||
|
# This block is for setting up the ingress for more information can be found here: https://kubernetes.io/docs/concepts/services-networking/ingress/
|
||||||
|
ingress:
|
||||||
|
enabled: false
|
||||||
|
className: ""
|
||||||
|
annotations: {}
|
||||||
|
# kubernetes.io/ingress.class: nginx
|
||||||
|
# kubernetes.io/tls-acme: "true"
|
||||||
|
hosts:
|
||||||
|
- host: chart-example.local
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: ImplementationSpecific
|
||||||
|
tls: []
|
||||||
|
# - secretName: chart-example-tls
|
||||||
|
# hosts:
|
||||||
|
# - chart-example.local
|
||||||
|
|
||||||
|
resources: {}
|
||||||
|
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||||
|
# choice for the user. This also increases chances charts run on environments with little
|
||||||
|
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||||
|
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
||||||
|
# limits:
|
||||||
|
# cpu: 100m
|
||||||
|
# memory: 128Mi
|
||||||
|
# requests:
|
||||||
|
# cpu: 100m
|
||||||
|
# memory: 128Mi
|
||||||
|
|
||||||
|
# This is to setup the liveness and readiness probes more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
|
||||||
|
livenessProbe:
|
||||||
|
initialDelaySeconds: 90
|
||||||
|
httpGet:
|
||||||
|
path: /
|
||||||
|
# path: /health
|
||||||
|
port: http
|
||||||
|
readinessProbe:
|
||||||
|
initialDelaySeconds: 90
|
||||||
|
httpGet:
|
||||||
|
path: /
|
||||||
|
# path: /health
|
||||||
|
port: http
|
||||||
|
|
||||||
|
# paperless-ai config
|
||||||
|
paperless:
|
||||||
|
apiUrl: "http://paperless-ngx:8000"
|
||||||
|
apiToken:
|
||||||
|
|
||||||
|
ai:
|
||||||
|
provider: "openai"
|
||||||
|
addProcessedTag: yes
|
||||||
|
processedTagName: ai-processed
|
||||||
|
|
||||||
|
prompt:
|
||||||
|
useTags: yes
|
||||||
|
tags: Rechnung,Kontoauszug,Vertrag,Arbeitgeber
|
||||||
|
|
||||||
|
openAi:
|
||||||
|
apiKey:
|
||||||
|
model: "gpt-4o-mini"
|
||||||
|
|
||||||
|
ollama:
|
||||||
|
apiUrl: ""
|
||||||
|
model: ""
|
||||||
|
|
||||||
|
scanInterval: "*/30 * * * *"
|
||||||
|
|
||||||
|
systemPrompt: |-
|
||||||
|
Return the result EXCLUSIVELY as a JSON object. The Tags and Title MUST be in the language that is used in the document.:
|
||||||
|
|
||||||
|
{
|
||||||
|
"title": "xxxxx",
|
||||||
|
"correspondent": "xxxxxxxx",
|
||||||
|
"tags": ["Tag1", "Tag2", "Tag3", "Tag4"],
|
||||||
|
"document_date": "YYYY-MM-DD",
|
||||||
|
"language": "en/de/es/..."
|
||||||
|
}
|
||||||
|
processPredefinedDocuments: "no"
|
||||||
|
tags: "indexed,indexed2"
|
||||||
|
|
||||||
|
# additional envs, if neccessary
|
||||||
|
envs: []
|
||||||
|
# - name: CONFIG_PATH
|
||||||
|
# value: "/app/config"
|
||||||
|
|
||||||
|
nodeSelector: {}
|
||||||
|
|
||||||
|
tolerations: []
|
||||||
|
|
||||||
|
affinity: {}
|
||||||
|
|
||||||
|
# persistence volumes needed for configuration and processing data directory
|
||||||
|
persistence:
|
||||||
|
config:
|
||||||
|
mountPath: "/app/config/config.js"
|
||||||
|
subPath: "config.js"
|
||||||
|
envfile:
|
||||||
|
mountPath: "app/.env"
|
||||||
|
subPath: ".env"
|
||||||
|
data:
|
||||||
|
enabled: true
|
||||||
|
size: 1Gi
|
||||||
|
storageClass: standard
|
||||||
|
mountPath: "/app/data"
|
Reference in New Issue
Block a user