From 0b7d221180f8d11ae5121dc5769de2775218a1f2 Mon Sep 17 00:00:00 2001 From: Morten Olsen Date: Sun, 18 Jan 2026 13:02:13 +0100 Subject: [PATCH] add komga --- apps/charts/komga/Chart.yaml | 7 +++ apps/charts/komga/templates/deployment.yaml | 1 + apps/charts/komga/templates/pvc.yaml | 1 + apps/charts/komga/templates/service.yaml | 1 + .../komga/templates/virtual-service.yaml | 1 + apps/charts/komga/values.yaml | 55 +++++++++++++++++++ apps/charts/volumes/values.yaml | 4 ++ apps/common/README.md | 12 ++++ apps/common/templates/_helpers.tpl | 4 ++ 9 files changed, 86 insertions(+) create mode 100644 apps/charts/komga/Chart.yaml create mode 100644 apps/charts/komga/templates/deployment.yaml create mode 100644 apps/charts/komga/templates/pvc.yaml create mode 100644 apps/charts/komga/templates/service.yaml create mode 100644 apps/charts/komga/templates/virtual-service.yaml create mode 100644 apps/charts/komga/values.yaml diff --git a/apps/charts/komga/Chart.yaml b/apps/charts/komga/Chart.yaml new file mode 100644 index 0000000..854fc34 --- /dev/null +++ b/apps/charts/komga/Chart.yaml @@ -0,0 +1,7 @@ +apiVersion: v2 +version: 1.0.0 +name: komga +dependencies: + - name: common + version: 1.0.0 + repository: file://../../common diff --git a/apps/charts/komga/templates/deployment.yaml b/apps/charts/komga/templates/deployment.yaml new file mode 100644 index 0000000..4508e33 --- /dev/null +++ b/apps/charts/komga/templates/deployment.yaml @@ -0,0 +1 @@ +{{ include "common.deployment" . }} diff --git a/apps/charts/komga/templates/pvc.yaml b/apps/charts/komga/templates/pvc.yaml new file mode 100644 index 0000000..379bad9 --- /dev/null +++ b/apps/charts/komga/templates/pvc.yaml @@ -0,0 +1 @@ +{{ include "common.pvc" . }} diff --git a/apps/charts/komga/templates/service.yaml b/apps/charts/komga/templates/service.yaml new file mode 100644 index 0000000..f024c64 --- /dev/null +++ b/apps/charts/komga/templates/service.yaml @@ -0,0 +1 @@ +{{ include "common.service" . }} diff --git a/apps/charts/komga/templates/virtual-service.yaml b/apps/charts/komga/templates/virtual-service.yaml new file mode 100644 index 0000000..766f6b9 --- /dev/null +++ b/apps/charts/komga/templates/virtual-service.yaml @@ -0,0 +1 @@ +{{ include "common.virtualService" . }} diff --git a/apps/charts/komga/values.yaml b/apps/charts/komga/values.yaml new file mode 100644 index 0000000..15e134e --- /dev/null +++ b/apps/charts/komga/values.yaml @@ -0,0 +1,55 @@ +image: + repository: gotson/komga + tag: latest + pullPolicy: IfNotPresent + +subdomain: komga + +deployment: + strategy: Recreate + replicas: 1 + +container: + port: 25600 + securityContext: + runAsUser: 1000 + runAsGroup: 1000 + healthProbe: + type: tcpSocket + port: "25600" + +service: + port: 80 + targetPort: 25600 + type: ClusterIP + +volumes: + - name: config + mountPath: /config + persistentVolumeClaim: komga-config + - name: comics + mountPath: /data/comics + persistentVolumeClaim: comics + - name: downloads + mountPath: /data/downloads + persistentVolumeClaim: downloads + +persistentVolumeClaims: + - name: config + size: 1Gi + +initContainers: + - name: fix-permissions + image: busybox + command: ["sh", "-c", "chown -R 1000:1000 /config"] + securityContext: + runAsUser: 0 + volumeMounts: + - name: config + mountPath: /config + +virtualService: + enabled: true + gateways: + public: true + private: true diff --git a/apps/charts/volumes/values.yaml b/apps/charts/volumes/values.yaml index 70986a9..7b796f7 100644 --- a/apps/charts/volumes/values.yaml +++ b/apps/charts/volumes/values.yaml @@ -14,6 +14,8 @@ shares: path: /mnt/HDD/Pictures backups: path: /mnt/HDD/Backups + downloads: + path: /mnt/HDD/Downloads youtube: path: /mnt/HDD/Youtube misc: @@ -24,3 +26,5 @@ shares: path: /mnt/HDD/images kidsyoutube: path: /mnt/HDD/Kids/YouTube + comics: + path: /mnt/HDD/Comics diff --git a/apps/common/README.md b/apps/common/README.md index ad5df41..656ae39 100644 --- a/apps/common/README.md +++ b/apps/common/README.md @@ -107,6 +107,18 @@ container: runAsUser: 1000 runAsGroup: 1000 +# Init Containers (optional) +# Add init containers, for example to fix permissions +initContainers: + - name: fix-permissions + image: busybox + command: ["sh", "-c", "chown -R 1000:1000 /data"] + volumeMounts: + - name: data + mountPath: /data + securityContext: + runAsUser: 0 + # Command and args (optional) # Override the container's default command/entrypoint # Useful for initialization scripts or custom startup logic diff --git a/apps/common/templates/_helpers.tpl b/apps/common/templates/_helpers.tpl index 361e1d7..556aa88 100644 --- a/apps/common/templates/_helpers.tpl +++ b/apps/common/templates/_helpers.tpl @@ -344,6 +344,10 @@ spec: hostNetwork: {{ .Values.deployment.hostNetwork }} {{- end }} {{- include "common.dnsConfig" . | nindent 6 }} + {{- if .Values.initContainers }} + initContainers: + {{- toYaml .Values.initContainers | nindent 8 }} + {{- end }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"