From ce90d8201bb9d74ca0b6aa0c83b10a718de040a9 Mon Sep 17 00:00:00 2001 From: Alex Lebens Date: Sat, 23 Nov 2024 19:37:35 -0600 Subject: [PATCH] add jellyplist --- .../cl01tl/applications/jellyplist/Chart.yaml | 32 +++ .../jellyplist/templates/external-secret.yaml | 83 ++++++ .../templates/persistent-volume-claim.yaml | 19 ++ .../templates/persistent-volume.yaml | 25 ++ .../applications/jellyplist/values.yaml | 255 ++++++++++++++++++ 5 files changed, 414 insertions(+) create mode 100644 clusters/cl01tl/applications/jellyplist/Chart.yaml create mode 100644 clusters/cl01tl/applications/jellyplist/templates/external-secret.yaml create mode 100644 clusters/cl01tl/applications/jellyplist/templates/persistent-volume-claim.yaml create mode 100644 clusters/cl01tl/applications/jellyplist/templates/persistent-volume.yaml create mode 100644 clusters/cl01tl/applications/jellyplist/values.yaml diff --git a/clusters/cl01tl/applications/jellyplist/Chart.yaml b/clusters/cl01tl/applications/jellyplist/Chart.yaml new file mode 100644 index 000000000..f83b40fb0 --- /dev/null +++ b/clusters/cl01tl/applications/jellyplist/Chart.yaml @@ -0,0 +1,32 @@ +apiVersion: v2 +name: jellyplist +version: 1.0.0 +description: Jellyplist +keywords: + - Jellyplist + - jellyfin +home: https://wiki.alexlebens.dev/doc/jellyplist-LnO1zUKXaD +sources: + - https://github.com/kamilkosek/jellyplist + - https://github.com/valkey-io/valkey + - https://github.com/cloudnative-pg/cloudnative-pg + - https://github.com/kamilkosek/jellyplist/pkgs/container/jellyplist + - https://github.com/bjw-s/helm-charts/tree/main/charts/other/app-template + - https://github.com/bitnami/charts/tree/main/bitnami/valkey + - https://github.com/alexlebens/helm-charts/charts/postgres-cluster +maintainers: + - name: alexlebens +dependencies: + - name: app-template + alias: jellyplist + repository: https://bjw-s.github.io/helm-charts/ + version: 3.5.1 + - name: valkey + version: 1.0.3 + repository: https://charts.bitnami.com/bitnami + - name: postgres-cluster + alias: postgres-16-cluster + version: 3.12.1 + repository: http://alexlebens.github.io/helm-charts +icon: https://raw.githubusercontent.com/kamilkosek/jellyplist/main/static/images/logo_large.png +appVersion: 0.1.5 diff --git a/clusters/cl01tl/applications/jellyplist/templates/external-secret.yaml b/clusters/cl01tl/applications/jellyplist/templates/external-secret.yaml new file mode 100644 index 000000000..2e4da7fc0 --- /dev/null +++ b/clusters/cl01tl/applications/jellyplist/templates/external-secret.yaml @@ -0,0 +1,83 @@ +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: jellyplist-secret + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: jellyplist-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: secret-key + remoteRef: + conversionStrategy: Default + decodingStrategy: None + key: /cl01tl/jellyplist + metadataPolicy: None + property: secret-key + - secretKey: cookies.txt + remoteRef: + conversionStrategy: Default + decodingStrategy: None + key: /cl01tl/jellyplist + metadataPolicy: None + property: cookies.txt + - secretKey: spotify-client-id + remoteRef: + conversionStrategy: Default + decodingStrategy: None + key: /cl01tl/jellyplist + metadataPolicy: None + property: spotify-client-id + - secretKey: spotify-client-secret + remoteRef: + conversionStrategy: Default + decodingStrategy: None + key: /cl01tl/jellyplist + metadataPolicy: None + property: spotify-client-secret + - secretKey: jellyfin-admin-password + remoteRef: + conversionStrategy: Default + decodingStrategy: None + key: /cl01tl/jellyplist + metadataPolicy: None + property: jellyfin-admin-password + +--- +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: jellyplist-postgresql-16-cluster-backup-secret + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: jellyplist-postgresql-16-cluster-backup-secret + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion }} + app.kubernetes.io/component: database + app.kubernetes.io/part-of: {{ .Release.Name }} +spec: + secretStoreRef: + kind: ClusterSecretStore + name: vault + data: + - secretKey: ACCESS_KEY_ID + remoteRef: + conversionStrategy: Default + decodingStrategy: None + key: /aws/keys/cl01tl-jellyplist-postgresql + metadataPolicy: None + property: access_key + - secretKey: ACCESS_SECRET_KEY + remoteRef: + conversionStrategy: Default + decodingStrategy: None + key: /aws/keys/cl01tl-jellyplist-postgresql + metadataPolicy: None + property: secret_key diff --git a/clusters/cl01tl/applications/jellyplist/templates/persistent-volume-claim.yaml b/clusters/cl01tl/applications/jellyplist/templates/persistent-volume-claim.yaml new file mode 100644 index 000000000..f2b33caad --- /dev/null +++ b/clusters/cl01tl/applications/jellyplist/templates/persistent-volume-claim.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: jellyplist-nfs-storage + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: jellyplist-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: jellyplist-nfs-storage + storageClassName: nfs-client + accessModes: + - ReadWriteMany + resources: + requests: + storage: 1Gi diff --git a/clusters/cl01tl/applications/jellyplist/templates/persistent-volume.yaml b/clusters/cl01tl/applications/jellyplist/templates/persistent-volume.yaml new file mode 100644 index 000000000..43d12108d --- /dev/null +++ b/clusters/cl01tl/applications/jellyplist/templates/persistent-volume.yaml @@ -0,0 +1,25 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: jellyplist-nfs-storage + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: jellyplist-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/Music Downloads + server: synologybond.alexlebens.net + mountOptions: + - vers=4 + - minorversion=1 + - noac diff --git a/clusters/cl01tl/applications/jellyplist/values.yaml b/clusters/cl01tl/applications/jellyplist/values.yaml new file mode 100644 index 000000000..4949015ae --- /dev/null +++ b/clusters/cl01tl/applications/jellyplist/values.yaml @@ -0,0 +1,255 @@ +jellyplist: + controllers: + main: + type: deployment + replicas: 1 + strategy: Recreate + revisionHistoryLimit: 3 + containers: + main: + image: + repository: ghcr.io/kamilkosek/jellyplist + tag: 0.1.5 + pullPolicy: IfNotPresent + env: + - name: SECRET_KEY + valueFrom: + secretKeyRef: + name: jellyplist-secret + key: secret-key + - name: JELLYFIN_SERVER_URL + value: https://jellyfin-main.jellyfin:80 + - name: JELLYFIN_SERVER_URL + value: jellyplist + - name: JELLYFIN_ADMIN_PASSWORD + valueFrom: + secretKeyRef: + name: jellystat-secret + key: jellyfin-admin-password + - name: SPOTIFY_CLIENT_ID + valueFrom: + secretKeyRef: + name: jellystat-secret + key: spotify-client-id + - name: SPOTIFY_CLIENT_SECRET + valueFrom: + secretKeyRef: + name: jellystat-secret + key: spotify-client-secret + - name: REDIS_URL + value: redis://valkey.jellyplist:6379/0 + - name: JELLYPLIST_DB_USER + valueFrom: + secretKeyRef: + name: jellyplist-postgresql-16-cluster-app + key: username + - name: JELLYPLIST_DB_PASSWORD + valueFrom: + secretKeyRef: + name: jellyplist-postgresql-16-cluster-app + key: password + - name: JELLYPLIST_DB + valueFrom: + secretKeyRef: + name: jellyplist-postgresql-16-cluster-app + key: dbname + - name: JELLYPLIST_DB_HOST + valueFrom: + secretKeyRef: + name: jellyplist-postgresql-16-cluster-app + key: host + resources: + requests: + cpu: 100m + memory: 256Mi + worker: + image: + repository: ghcr.io/kamilkosek/jellyplist + tag: 0.1.5 + pullPolicy: IfNotPresent + args: + - celery + - -A + - app.celery + - worker + - --loglevel=info + env: + - name: SECRET_KEY + valueFrom: + secretKeyRef: + name: jellyplist-secret + key: secret-key + - name: JELLYFIN_SERVER_URL + value: https://jellyfin-main.jellyfin:80 + - name: JELLYFIN_SERVER_URL + value: admin + - name: JELLYFIN_ADMIN_PASSWORD + valueFrom: + secretKeyRef: + name: jellystat-secret + key: jellyfin-admin-password + - name: SPOTIFY_CLIENT_ID + valueFrom: + secretKeyRef: + name: jellystat-secret + key: spotify-client-id + - name: SPOTIFY_CLIENT_SECRET + valueFrom: + secretKeyRef: + name: jellystat-secret + key: spotify-client-secret + - name: REDIS_URL + value: redis://valkey.jellyplist:6379/0 + - name: JELLYPLIST_DB_USER + valueFrom: + secretKeyRef: + name: jellyplist-postgresql-16-cluster-app + key: username + - name: JELLYPLIST_DB_PASSWORD + valueFrom: + secretKeyRef: + name: jellyplist-postgresql-16-cluster-app + key: password + - name: JELLYPLIST_DB + valueFrom: + secretKeyRef: + name: jellyplist-postgresql-16-cluster-app + key: dbname + - name: JELLYPLIST_DB_HOST + valueFrom: + secretKeyRef: + name: jellyplist-postgresql-16-cluster-app + key: host + resources: + requests: + cpu: 100m + memory: 256Mi + beat: + image: + repository: ghcr.io/kamilkosek/jellyplist + tag: 0.1.5 + pullPolicy: IfNotPresent + args: + - celery + - -A + - app.celery + - beat + - --loglevel=info + env: + - name: SECRET_KEY + valueFrom: + secretKeyRef: + name: jellyplist-secret + key: secret-key + - name: JELLYFIN_SERVER_URL + value: https://jellyfin-main.jellyfin:80 + - name: JELLYFIN_SERVER_URL + value: admin + - name: JELLYFIN_ADMIN_PASSWORD + valueFrom: + secretKeyRef: + name: jellystat-secret + key: jellyfin-admin-password + - name: SPOTIFY_CLIENT_ID + valueFrom: + secretKeyRef: + name: jellystat-secret + key: spotify-client-id + - name: SPOTIFY_CLIENT_SECRET + valueFrom: + secretKeyRef: + name: jellystat-secret + key: spotify-client-secret + - name: REDIS_URL + value: redis://valkey.jellyplist:6379/0 + - name: JELLYPLIST_DB_USER + valueFrom: + secretKeyRef: + name: jellyplist-postgresql-16-cluster-app + key: username + - name: JELLYPLIST_DB_PASSWORD + valueFrom: + secretKeyRef: + name: jellyplist-postgresql-16-cluster-app + key: password + - name: JELLYPLIST_DB + valueFrom: + secretKeyRef: + name: jellyplist-postgresql-16-cluster-app + key: dbname + - name: JELLYPLIST_DB_HOST + valueFrom: + secretKeyRef: + name: jellyplist-postgresql-16-cluster-app + key: host + resources: + requests: + cpu: 100m + memory: 256Mi + serviceAccount: + create: true + service: + main: + controller: main + ports: + http: + port: 5055 + targetPort: 5055 + protocol: HTTP + ingress: + tailscale: + enabled: true + className: tailscale + hosts: + - host: jellyplist-cl01tl + paths: + - path: / + pathType: Prefix + service: + name: jellyplist + port: 5055 + tls: + - hosts: + - jellyplist-cl01tl + persistence: + cookies: + enabled: true + type: Secret + name: jellyplist-spotdl-cookies-secret + advancedMounts: + main: + main: + - path: /jellyplist/cookies.txt + readOnly: true + mountPropagation: None + subPath: cookies.txt + music: + existingClaim: jellyplist-nfs-storage + advancedMounts: + main: + main: + - path: /jellyplist_downloads + readOnly: true +postgres-16-cluster: + mode: standalone + cluster: + walStorage: + storageClass: local-path + storage: + storageClass: local-path + monitoring: + enabled: true + prometheusRule: + enabled: false + backup: + enabled: true + endpointURL: https://s3.us-east-2.amazonaws.com + destinationPath: s3://cl01tl-postgresql-backups/jellyplist + endpointCredentials: jellyplist-postgresql-16-cluster-backup-secret + backupIndex: 1 + tags: + backupRetentionPolicy: "expire" + user: "cl01tl-jellyplist-postgresql" + historyTags: + backupRetentionPolicy: "keep" + user: "cl01tl-jellyplist-postgresql"