From 6f9073832c724e8cd5242fed1762efdcdd00d188 Mon Sep 17 00:00:00 2001 From: Tommy Date: Thu, 11 Apr 2024 21:39:13 +0200 Subject: [PATCH] feat: add the vikunja todo app --- README.org | 6 ++- charts/vikunja/Chart.yaml | 18 ++++++++ charts/vikunja/templates/_helpers.tpl | 30 ++++++++++++ charts/vikunja/templates/db-init.yaml | 20 ++++++++ charts/vikunja/templates/deployment.yaml | 48 ++++++++++++++++++++ charts/vikunja/templates/service.yaml | 13 ++++++ charts/vikunja/templates/serviceaccount.yaml | 7 +++ charts/vikunja/tests/values.yaml | 33 ++++++++++++++ charts/vikunja/values.yaml | 33 ++++++++++++++ 9 files changed, 206 insertions(+), 2 deletions(-) create mode 100644 charts/vikunja/Chart.yaml create mode 100644 charts/vikunja/templates/_helpers.tpl create mode 100644 charts/vikunja/templates/db-init.yaml create mode 100644 charts/vikunja/templates/deployment.yaml create mode 100644 charts/vikunja/templates/service.yaml create mode 100644 charts/vikunja/templates/serviceaccount.yaml create mode 100644 charts/vikunja/tests/values.yaml create mode 100644 charts/vikunja/values.yaml diff --git a/README.org b/README.org index 069db58..7c2a3a3 100644 --- a/README.org +++ b/README.org @@ -52,9 +52,11 @@ Below you'll find an overview of the charts and an intro to get you started. 🚧 [[charts/paperless-ngx][paperless-ngx]]: Document management system that transforms your physical documents into a searchable online archive. -🚧 [[charts/maubot][Maubot]]: A Matrix bot system. +🚧 [[charts/vikunja][Vikunja]]: Todo app with web and dav support. -🚧 [[charts/nfty-sh][nfty.sh]]: A push notification server for clients and phones. +🚧 [[charts/maubot][Maubot]]: Matrix bot system. + +🚧 [[charts/nfty-sh][nfty.sh]]: Push notification server for clients and phones. 🚧 [[charts/ollama-web][OLLAMA Web]]: User-friendly WebUI for LLMs (Formerly Ollama WebUI). A simplified chart of the original and wip, but it works. diff --git a/charts/vikunja/Chart.yaml b/charts/vikunja/Chart.yaml new file mode 100644 index 0000000..1590f40 --- /dev/null +++ b/charts/vikunja/Chart.yaml @@ -0,0 +1,18 @@ +apiVersion: v2 +name: vikunja +description: | + Todo app with web and dav support +appVersion: 0.23.0 +type: application +version: 0.1.0 +maintainers: +- name: Tommy Skaug + email: tommy@skaug.me +keywords: +- vikunja +- todo +- task +- project-management +sources: +- https://vikunja.io/ +- https://hub.docker.com/r/vikunja/vikunja diff --git a/charts/vikunja/templates/_helpers.tpl b/charts/vikunja/templates/_helpers.tpl new file mode 100644 index 0000000..4899525 --- /dev/null +++ b/charts/vikunja/templates/_helpers.tpl @@ -0,0 +1,30 @@ +# Define a template for the chart's full name. +{{/* +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). +*/}} +{{- define "vikunja.fullname" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- end }} + +# Define a template for standard labels. +{{/* +Common labels +*/}} +{{- define "vikunja.labels" -}} +helm.sh/chart: {{ include "vikunja.chart" . }} +app.kubernetes.io/name: {{ include "vikunja.fullname" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +app.kubernetes.io/version: {{ .Chart.Version | quote }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +# Define a template for the chart name and version. +{{/* +Generate basic labels +*/}} +{{- define "vikunja.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" -}} +{{- end }} + +# Optionally, add more helper templates as needed. diff --git a/charts/vikunja/templates/db-init.yaml b/charts/vikunja/templates/db-init.yaml new file mode 100644 index 0000000..d805333 --- /dev/null +++ b/charts/vikunja/templates/db-init.yaml @@ -0,0 +1,20 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ include "vikunja.fullname" . }}-db-init + labels: + {{- include "vikunja.labels" . | nindent 4 }} + annotations: + "helm.sh/hook": pre-install + "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded +spec: + template: + spec: + restartPolicy: Never + containers: + - name: general-db-init + image: "{{ .Values.initContainers.dbInit.image.repository }}:{{ .Values.initContainers.dbInit.image.tag }}" + envFrom: + - secretRef: + name: {{ .Values.postgres.secretName }} + backoffLimit: 3 diff --git a/charts/vikunja/templates/deployment.yaml b/charts/vikunja/templates/deployment.yaml new file mode 100644 index 0000000..7403392 --- /dev/null +++ b/charts/vikunja/templates/deployment.yaml @@ -0,0 +1,48 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "vikunja.fullname" . }} + labels: + {{- include "vikunja.labels" . | nindent 4 }} +spec: + replicas: 1 + selector: + matchLabels: + app: {{ include "vikunja.fullname" . }} + template: + metadata: + labels: + app: {{ include "vikunja.fullname" . }} + spec: + serviceAccountName: {{ include "vikunja.fullname" . }} + containers: + - name: {{ include "vikunja.fullname" . }} + image: {{ .Values.image.repository }}:{{ .Values.image.tag }} + envFrom: + - secretRef: + name: {{ .Values.envFromSecret }} + env: + - name: VIKUNJA_SERVICE_PUBLICURL + value: {{ .Values.config.externalUrl }} + - name: VIKUNJA_DATABASE_TYPE + value: postgres + resources: + {{- toYaml .Values.resources | nindent 10 }} + ports: + - containerPort: 29316 + name: http + volumeMounts: + - name: {{ include "vikunja.fullname" . }} + mountPath: "/app/vikunja/files" + readOnly: false + - name: config + mountPath: "/app/vikunja/config.yml" + subPath: config.yml + readOnly: true + volumes: + - name: {{ include "vikunja.fullname" . }} + persistentVolumeClaim: + claimName: {{ .Values.persistence.existingClaim }} + - name: config + secret: + secretName: {{ .Values.existingSecretConfigMap }} diff --git a/charts/vikunja/templates/service.yaml b/charts/vikunja/templates/service.yaml new file mode 100644 index 0000000..bdad015 --- /dev/null +++ b/charts/vikunja/templates/service.yaml @@ -0,0 +1,13 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ include "vikunja.fullname" . }} + labels: + {{- include "vikunja.labels" . | nindent 4 }} +spec: + selector: + app: {{ include "vikunja.fullname" . }} + ports: + - port: 8080 + targetPort: 3456 \ No newline at end of file diff --git a/charts/vikunja/templates/serviceaccount.yaml b/charts/vikunja/templates/serviceaccount.yaml new file mode 100644 index 0000000..1d40e60 --- /dev/null +++ b/charts/vikunja/templates/serviceaccount.yaml @@ -0,0 +1,7 @@ +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "vikunja.fullname" . }} + labels: + {{- include "vikunja.labels" . | nindent 4 }} \ No newline at end of file diff --git a/charts/vikunja/tests/values.yaml b/charts/vikunja/tests/values.yaml new file mode 100644 index 0000000..3008b60 --- /dev/null +++ b/charts/vikunja/tests/values.yaml @@ -0,0 +1,33 @@ +config: + externalUrl: https://vikunja.example.com/ + +existingSecretConfigMap: vikunja-secret + +persistence: + existingClaim: vikunja + +initContainers: + dbInit: + image: + repository: ghcr.io/onedr0p/postgres-init + tag: "16" + envFrom: + - secretRef: + name: vikunja-secret + +envFromSecret: vikunja-secret + +image: + repository: vikunja/vikunja + tag: 0.23.0 + +postgres: + secretName: vikunja-secret + +resources: + limits: + memory: "1Gi" + cpu: "500m" +# requests: +# cpu: 100m +# memory: 250Mi diff --git a/charts/vikunja/values.yaml b/charts/vikunja/values.yaml new file mode 100644 index 0000000..3008b60 --- /dev/null +++ b/charts/vikunja/values.yaml @@ -0,0 +1,33 @@ +config: + externalUrl: https://vikunja.example.com/ + +existingSecretConfigMap: vikunja-secret + +persistence: + existingClaim: vikunja + +initContainers: + dbInit: + image: + repository: ghcr.io/onedr0p/postgres-init + tag: "16" + envFrom: + - secretRef: + name: vikunja-secret + +envFromSecret: vikunja-secret + +image: + repository: vikunja/vikunja + tag: 0.23.0 + +postgres: + secretName: vikunja-secret + +resources: + limits: + memory: "1Gi" + cpu: "500m" +# requests: +# cpu: 100m +# memory: 250Mi