From 89740b5bb16c2ee6caf30673fbaa3edbe1b53770 Mon Sep 17 00:00:00 2001 From: Kyle Bartz Date: Sun, 17 Nov 2024 04:43:04 +0000 Subject: [PATCH] Added komf --- .../media/komf/app/config/application.yml | 49 ++++++++ .../apps/media/komf/app/externalsecret.yaml | 15 +++ .../main/apps/media/komf/app/helmrelease.yaml | 109 ++++++++++++++++++ .../apps/media/komf/app/kustomization.yaml | 14 +++ kubernetes/main/apps/media/komf/ks.yaml | 32 +++++ kubernetes/main/apps/media/kustomization.yaml | 3 +- 6 files changed, 221 insertions(+), 1 deletion(-) create mode 100644 kubernetes/main/apps/media/komf/app/config/application.yml create mode 100644 kubernetes/main/apps/media/komf/app/externalsecret.yaml create mode 100644 kubernetes/main/apps/media/komf/app/helmrelease.yaml create mode 100644 kubernetes/main/apps/media/komf/app/kustomization.yaml create mode 100644 kubernetes/main/apps/media/komf/ks.yaml diff --git a/kubernetes/main/apps/media/komf/app/config/application.yml b/kubernetes/main/apps/media/komf/app/config/application.yml new file mode 100644 index 00000000..42152bc5 --- /dev/null +++ b/kubernetes/main/apps/media/komf/app/config/application.yml @@ -0,0 +1,49 @@ +kavita: + eventListener: + enabled: true + metadataLibraryFilter: + - 1 # Manga + - 2 # Light Novels + metadataUpdate: + default: + updateModes: [ API ] + aggregate: true + mergeTags: true + mergeGenres: true + bookCovers: true + seriesCovers: true + postProcessing: + seriesTitle: true + seriesTitleLanguage: "en" + alternativeSeriesTitles: false + alternativeSeriesTitleLanguages: + - "en" + - "ja" + - "ja-ro" + orderBooks: true + scoreTag: true + library: + 1: + mediaType: MANGA + 2: + mediaType: NOVEL + +database: + file: ./database.sqlite + +metadataProviders: + malClientId: "${SECRET_KOMF_MAL_CLIENT_ID}" # required for mal provider. See https://myanimelist.net/forum/?topicid=1973077 + defaultProviders: + mangaUpdates: + priority: 10 + enabled: true + mediaType: MANGA + authorRoles: [ "WRITER" ] + artistRoles: [ "PENCILLER","INKER","COLORIST","LETTERER","COVER" ] + mal: + priority: 20 + enabled: true + mediaType: MANGA + nautiljon: + priority: 30 + enabled: true diff --git a/kubernetes/main/apps/media/komf/app/externalsecret.yaml b/kubernetes/main/apps/media/komf/app/externalsecret.yaml new file mode 100644 index 00000000..ddb185f3 --- /dev/null +++ b/kubernetes/main/apps/media/komf/app/externalsecret.yaml @@ -0,0 +1,15 @@ +--- +# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/external-secrets.io/externalsecret_v1beta1.json +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: komf +spec: + secretStoreRef: + kind: ClusterSecretStore + name: onepassword-connect + target: + name: komf-secret + dataFrom: + - extract: + key: komf \ No newline at end of file diff --git a/kubernetes/main/apps/media/komf/app/helmrelease.yaml b/kubernetes/main/apps/media/komf/app/helmrelease.yaml new file mode 100644 index 00000000..cc2825b5 --- /dev/null +++ b/kubernetes/main/apps/media/komf/app/helmrelease.yaml @@ -0,0 +1,109 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/helmrelease-helm-v2beta2.json +apiVersion: helm.toolkit.fluxcd.io/v2beta2 +kind: HelmRelease +metadata: + name: komf +spec: + interval: 30m + chart: + spec: + chart: app-template + version: 2.4.0 + sourceRef: + kind: HelmRepository + name: bjw-s + namespace: flux-system + install: + remediation: + retries: 3 + upgrade: + cleanupOnFail: true + remediation: + retries: 3 + uninstall: + keepHistory: false + values: + controllers: + main: + annotations: + reloader.stakater.com/auto: "true" + + containers: + main: + image: + repository: sndxr/komf + tag: 1.1.0@sha256:ba6a9080f74e7c17a360112977ca633b202215ea801515bf2e03bc3dfe68f32e + env: + KOMF_KAVITA_BASE_URI: http://kavita.media.svc.cluster.local:5000 + KOMF_LOG_LEVEL: INFO + JAVA_TOOL_OPTIONS: >- + -XX:+UnlockExperimentalVMOptions + -XX:+UseShenandoahGC + -XX:ShenandoahGCHeuristics=compact + -XX:ShenandoahGuaranteedGCInterval=3600000 + -XX:TrimNativeHeapInterval=3600000 + envFrom: + - secretRef: + name: komf-secret + probes: + liveness: &probes + enabled: true + custom: true + spec: + httpGet: + path: /config + port: &port 8085 + initialDelaySeconds: 0 + periodSeconds: 10 + timeoutSeconds: 1 + failureThreshold: 3 + readiness: *probes + startup: + enabled: false + securityContext: + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true + capabilities: { drop: ["ALL"] } + resources: + requests: + memory: 4282M + cpu: 15m + limits: + memory: 4282M + + service: + main: + ports: + http: + port: *port + + ingress: + main: + enabled: true + className: internal + hosts: + - host: &host "{{ .Release.Name }}.kyle.fail" + paths: + - path: / + service: + name: main + port: *port + tls: + - hosts: + - *host + + persistence: + config: + enabled: true + existingClaim: komf + globalMounts: + - path: /config + configmap: + enabled: true + type: configMap + name: komf-configmap + globalMounts: + - path: /config/application.yml + readOnly: true + subPath: application.yml \ No newline at end of file diff --git a/kubernetes/main/apps/media/komf/app/kustomization.yaml b/kubernetes/main/apps/media/komf/app/kustomization.yaml new file mode 100644 index 00000000..d6cc0828 --- /dev/null +++ b/kubernetes/main/apps/media/komf/app/kustomization.yaml @@ -0,0 +1,14 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/kustomization +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ./externalsecret.yaml + - ./helmrelease.yaml + - ../../../../templates/volsync +configMapGenerator: + - name: komf-configmap + files: + - ./config/application.yml +generatorOptions: + disableNameSuffixHash: true \ No newline at end of file diff --git a/kubernetes/main/apps/media/komf/ks.yaml b/kubernetes/main/apps/media/komf/ks.yaml new file mode 100644 index 00000000..d92e609a --- /dev/null +++ b/kubernetes/main/apps/media/komf/ks.yaml @@ -0,0 +1,32 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/kustomization-kustomize-v1.json +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: &app komf + namespace: flux-system +spec: + targetNamespace: media + commonMetadata: + labels: + app.kubernetes.io/name: *app + dependsOn: + - name: external-secrets-stores + - name: rook-ceph-cluster + - name: volsync + - name: kavita + path: ./kubernetes/main/apps/media/komf/app + prune: true + sourceRef: + kind: GitRepository + name: home-kubernetes + wait: false + interval: 30m + retryInterval: 1m + timeout: 5m + postBuild: + substitute: + APP: *app + APP_UID: "568" + APP_GID: "568" + VOLSYNC_CAPACITY: 2Gi \ No newline at end of file diff --git a/kubernetes/main/apps/media/kustomization.yaml b/kubernetes/main/apps/media/kustomization.yaml index f2b3f4cd..e8c03466 100644 --- a/kubernetes/main/apps/media/kustomization.yaml +++ b/kubernetes/main/apps/media/kustomization.yaml @@ -9,4 +9,5 @@ resources: - ./tautulli/ks.yaml - ./wizarr/ks.yaml - ./overseerr/ks.yaml - - ./kavita/ks.yaml \ No newline at end of file + - ./kavita/ks.yaml + - ./komf/ks.yaml \ No newline at end of file