From 44061ff324819409d199e917a1416fa4f2c9f1fe Mon Sep 17 00:00:00 2001 From: alexlebens Date: Fri, 2 Aug 2024 19:29:00 -0500 Subject: [PATCH] add book bounty --- .../applications/book-bounty/Chart.yaml | 22 +++++ .../templates/external-secret.yaml | 82 +++++++++++++++++++ .../book-bounty/templates/ingress-route.yaml | 37 +++++++++ .../book-bounty/templates/middleware.yaml | 27 ++++++ .../templates/persistent-volume-claim.yaml | 19 +++++ .../templates/persistent-volume.yaml | 25 ++++++ .../templates/replication-source.yaml | 27 ++++++ .../applications/book-bounty/values.yaml | 59 +++++++++++++ .../cl01tl/applications/homepage/values.yaml | 6 ++ 9 files changed, 304 insertions(+) create mode 100644 clusters/cl01tl/applications/book-bounty/Chart.yaml create mode 100644 clusters/cl01tl/applications/book-bounty/templates/external-secret.yaml create mode 100644 clusters/cl01tl/applications/book-bounty/templates/ingress-route.yaml create mode 100644 clusters/cl01tl/applications/book-bounty/templates/middleware.yaml create mode 100644 clusters/cl01tl/applications/book-bounty/templates/persistent-volume-claim.yaml create mode 100644 clusters/cl01tl/applications/book-bounty/templates/persistent-volume.yaml create mode 100644 clusters/cl01tl/applications/book-bounty/templates/replication-source.yaml create mode 100644 clusters/cl01tl/applications/book-bounty/values.yaml diff --git a/clusters/cl01tl/applications/book-bounty/Chart.yaml b/clusters/cl01tl/applications/book-bounty/Chart.yaml new file mode 100644 index 000000000..e847a2900 --- /dev/null +++ b/clusters/cl01tl/applications/book-bounty/Chart.yaml @@ -0,0 +1,22 @@ +apiVersion: v2 +name: book-bounty +version: 1.0.0 +description: Book Bounty +keywords: + - book-bounty + - books + - readarr +home: https://wiki.alexlebens.dev/doc/book-bounty-92F75vR4O9 +sources: + - https://github.com/advplyr/audiobookshelf + - https://registry.hub.docker.com/r/thewicklowwolf/bookbounty + - https://github.com/bjw-s/helm-charts/tree/main/charts/other/app-template +maintainers: + - name: alexlebens +dependencies: + - name: app-template + alias: book-bounty + repository: https://bjw-s.github.io/helm-charts/ + version: 3.2.1 +icon: https://raw.githubusercontent.com/TheWicklowWolf/BookBounty/main/src/static/bookbounty.png +appVersion: v0.116 diff --git a/clusters/cl01tl/applications/book-bounty/templates/external-secret.yaml b/clusters/cl01tl/applications/book-bounty/templates/external-secret.yaml new file mode 100644 index 000000000..53584e43c --- /dev/null +++ b/clusters/cl01tl/applications/book-bounty/templates/external-secret.yaml @@ -0,0 +1,82 @@ +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: book-bounty-secret + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: book-bounty-secret + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: web + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + secretStoreRef: + kind: ClusterSecretStore + name: vault + data: + - secretKey: readarr_api_key + remoteRef: + conversionStrategy: Default + decodingStrategy: None + key: /cl01tl/readarr-books/key + metadataPolicy: None + property: key + +--- +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: book-bounty-config-backup-secret + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: book-bounty-config-backup-secret + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: backup + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + secretStoreRef: + kind: ClusterSecretStore + name: vault + target: + template: + mergePolicy: Merge + engineVersion: v2 + data: + RESTIC_REPOSITORY: "{{ `{{ .BUCKET_ENDPOINT }}` }}/book-bounty/book-bounty-config" + data: + - secretKey: BUCKET_ENDPOINT + remoteRef: + conversionStrategy: Default + decodingStrategy: None + key: /cl01tl/volsync/restic/config + metadataPolicy: None + property: S3_BUCKET_ENDPOINT + - secretKey: RESTIC_PASSWORD + remoteRef: + conversionStrategy: Default + decodingStrategy: None + key: /cl01tl/volsync/restic/config + metadataPolicy: None + property: RESTIC_PASSWORD + - secretKey: AWS_DEFAULT_REGION + remoteRef: + conversionStrategy: Default + decodingStrategy: None + key: /cl01tl/volsync/restic/config + metadataPolicy: None + property: AWS_DEFAULT_REGION + - secretKey: AWS_ACCESS_KEY_ID + remoteRef: + conversionStrategy: Default + decodingStrategy: None + key: /aws/keys/cl01tl-volsync-backups + metadataPolicy: None + property: access_key + - secretKey: AWS_SECRET_ACCESS_KEY + remoteRef: + conversionStrategy: Default + decodingStrategy: None + key: /aws/keys/cl01tl-volsync-backups + metadataPolicy: None + property: secret_key diff --git a/clusters/cl01tl/applications/book-bounty/templates/ingress-route.yaml b/clusters/cl01tl/applications/book-bounty/templates/ingress-route.yaml new file mode 100644 index 000000000..b3757828d --- /dev/null +++ b/clusters/cl01tl/applications/book-bounty/templates/ingress-route.yaml @@ -0,0 +1,37 @@ +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: book-bounty + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: book-bounty + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: web + app.kubernetes.io/part-of: {{ .Release.Name }} + annotations: + external-dns.alpha.kubernetes.io/hostname: bookbounty.alexlebens.net + external-dns.alpha.kubernetes.io/target: cl01tl-endpoint.alexlebens.net + kubernetes.io/ingress.class: traefik +spec: + entryPoints: + - websecure + routes: + - kind: Rule + match: Host(`bookbounty.alexlebens.net`) + middlewares: + - name: authentik-book-bounty + namespace: {{ .Release.Namespace }} + priority: 10 + services: + - kind: Service + name: book-bounty + port: 80 + - kind: Rule + match: Host(`bookbounty.alexlebens.net`) && PathPrefix(`/outpost.goauthentik.io/`)" + priority: 15 + services: + - kind: Service + name: authentik-outpost-proxy + port: 9000 + namespace: authentik diff --git a/clusters/cl01tl/applications/book-bounty/templates/middleware.yaml b/clusters/cl01tl/applications/book-bounty/templates/middleware.yaml new file mode 100644 index 000000000..73602c2b7 --- /dev/null +++ b/clusters/cl01tl/applications/book-bounty/templates/middleware.yaml @@ -0,0 +1,27 @@ +apiVersion: traefik.io/v1alpha1 +kind: Middleware +metadata: + name: authentik-book-bounty + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: authentik-book-bounty + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: auth + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + forwardAuth: + address: http://authentik-outpost-proxy.authentik:9000/outpost.goauthentik.io/auth/traefik + trustForwardHeader: true + authResponseHeaders: + - X-authentik-username + - X-authentik-groups + - X-authentik-email + - X-authentik-name + - X-authentik-uid + - X-authentik-jwt + - X-authentik-meta-jwks + - X-authentik-meta-outpost + - X-authentik-meta-provider + - X-authentik-meta-app + - X-authentik-meta-version diff --git a/clusters/cl01tl/applications/book-bounty/templates/persistent-volume-claim.yaml b/clusters/cl01tl/applications/book-bounty/templates/persistent-volume-claim.yaml new file mode 100644 index 000000000..d84943241 --- /dev/null +++ b/clusters/cl01tl/applications/book-bounty/templates/persistent-volume-claim.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: book-bounty-nfs-storage + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: book-bounty-nfs-storage + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: storage + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + volumeName: book-bounty-nfs-storage + storageClassName: nfs-client + accessModes: + - ReadWriteMany + resources: + requests: + storage: 1Gi diff --git a/clusters/cl01tl/applications/book-bounty/templates/persistent-volume.yaml b/clusters/cl01tl/applications/book-bounty/templates/persistent-volume.yaml new file mode 100644 index 000000000..60d7e7eca --- /dev/null +++ b/clusters/cl01tl/applications/book-bounty/templates/persistent-volume.yaml @@ -0,0 +1,25 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: book-bounty-nfs-storage + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: book-bounty-nfs-storage + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: storage + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + persistentVolumeReclaimPolicy: Retain + storageClassName: nfs-client + capacity: + storage: 1Gi + accessModes: + - ReadWriteMany + nfs: + path: /volume2/Storage/Calibre + server: synologybond.alexlebens.net + mountOptions: + - vers=4 + - minorversion=1 + - noac diff --git a/clusters/cl01tl/applications/book-bounty/templates/replication-source.yaml b/clusters/cl01tl/applications/book-bounty/templates/replication-source.yaml new file mode 100644 index 000000000..9ad5fb6e6 --- /dev/null +++ b/clusters/cl01tl/applications/book-bounty/templates/replication-source.yaml @@ -0,0 +1,27 @@ +apiVersion: volsync.backube/v1alpha1 +kind: ReplicationSource +metadata: + name: book-bounty-config-backup-source + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: book-bounty-config-backup-source + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: backup + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + sourcePVC: book-bounty-config + trigger: + schedule: 0 */6 * * * + restic: + pruneIntervalDays: 7 + repository: book-bounty-config-backup-secret + retain: + hourly: 1 + daily: 1 + weekly: 3 + monthly: 2 + yearly: 4 + copyMethod: Snapshot + storageClassName: ceph-block-delete + volumeSnapshotClassName: ceph-blockpool-snapshot diff --git a/clusters/cl01tl/applications/book-bounty/values.yaml b/clusters/cl01tl/applications/book-bounty/values.yaml new file mode 100644 index 000000000..3508ae3f0 --- /dev/null +++ b/clusters/cl01tl/applications/book-bounty/values.yaml @@ -0,0 +1,59 @@ +book-bounty: + controllers: + main: + type: deployment + replicas: 1 + strategy: Recreate + revisionHistoryLimit: 3 + containers: + main: + image: + repository: thewicklowwolf/bookbounty + tag: latest@sha256:bbf9a20ad88579067463bad999a6b82bdd457d37d6fa28096686a6d5992e746c + pullPolicy: IfNotPresent + env: + - name: readarr_address + value: http://readarr-books.readarr-books:80 + - name: readarr_api_key + valueFrom: + secretKeyRef: + name: book-bounty-secret + key: readarr_api_key + - name: sleep_interval + value: 360 + - name: sync_schedule + value: 4 + - name: selected_path_type + value: folder + resources: + requests: + cpu: 100m + memory: 256Mi + serviceAccount: + create: true + service: + main: + controller: main + ports: + http: + port: 80 + targetPort: 5000 + protocol: HTTP + persistence: + config: + storageClass: ceph-block + accessMode: ReadWriteOnce + size: 5Gi + retain: true + advancedMounts: + main: + main: + - path: /bookbounty/config + readOnly: false + books: + existingClaim: book-bounty-nfs-storage + advancedMounts: + main: + main: + - path: /bookbounty/downloads + readOnly: false diff --git a/clusters/cl01tl/applications/homepage/values.yaml b/clusters/cl01tl/applications/homepage/values.yaml index 57ee17f41..e53e71780 100644 --- a/clusters/cl01tl/applications/homepage/values.yaml +++ b/clusters/cl01tl/applications/homepage/values.yaml @@ -543,6 +543,12 @@ homepage: type: prowlarr url: http://prowlarr.prowlarr:80 key: {{ "{{HOMEPAGE_VAR_PROWLARR_KEY}}" }} + - Book Bounty: + icon: https://raw.githubusercontent.com/TheWicklowWolf/BookBounty/main/src/static/bookbounty.png + description: Searches for Books + href: https://bookbounty.alexlebens.net + siteMonitor: http://book-bounty.book-bounty:80 + statusStyle: dot bookmarks.yaml: | - External Services: - Github: