From da59646a32018218c2433d3cba4c855964304e13 Mon Sep 17 00:00:00 2001 From: alexlebens Date: Wed, 14 Aug 2024 10:29:10 -0500 Subject: [PATCH] add jellystat --- .../cl01tl/applications/homepage/values.yaml | 8 +- .../cl01tl/applications/jellystat/Chart.yaml | 25 ++++ .../jellystat/templates/external-secret.yaml | 128 ++++++++++++++++++ .../templates/replication-source.yaml | 27 ++++ .../cl01tl/applications/jellystat/values.yaml | 119 ++++++++++++++++ 5 files changed, 303 insertions(+), 4 deletions(-) create mode 100644 clusters/cl01tl/applications/jellystat/Chart.yaml create mode 100644 clusters/cl01tl/applications/jellystat/templates/external-secret.yaml create mode 100644 clusters/cl01tl/applications/jellystat/templates/replication-source.yaml create mode 100644 clusters/cl01tl/applications/jellystat/values.yaml diff --git a/clusters/cl01tl/applications/homepage/values.yaml b/clusters/cl01tl/applications/homepage/values.yaml index a42b62281..9a80e4684 100644 --- a/clusters/cl01tl/applications/homepage/values.yaml +++ b/clusters/cl01tl/applications/homepage/values.yaml @@ -338,11 +338,11 @@ homepage: href: https://tautulli.alexlebens.net siteMonitor: http://tautulli.tautulli:80 statusStyle: dot - - Jellystats: - icon: jellystats.png - href: https://jellystats.alexlebens.net + - jellystat: + icon: jellystat.png + href: https://jellystat.alexlebens.net description: Jellyfin Monitoring - siteMonitor: http://jellystats.jellystats:80 + siteMonitor: http://jellystat.jellystat:80 statusStyle: dot - Services: - Auth (External): diff --git a/clusters/cl01tl/applications/jellystat/Chart.yaml b/clusters/cl01tl/applications/jellystat/Chart.yaml new file mode 100644 index 000000000..766ed1340 --- /dev/null +++ b/clusters/cl01tl/applications/jellystat/Chart.yaml @@ -0,0 +1,25 @@ +apiVersion: v2 +name: jellystat +version: 1.0.0 +description: Jellystat +keywords: + - jellystat + - jellyfin +home: https://wiki.alexlebens.dev/doc/jellystat-0FixP7GqGZ +sources: + - https://github.com/CyferShepard/Jellystat + - https://hub.docker.com/r/cyfershepard/jellystat + - https://github.com/bjw-s/helm-charts/tree/main/charts/other/app-template +maintainers: + - name: alexlebens +dependencies: + - name: app-template + alias: jellystat + repository: https://bjw-s.github.io/helm-charts/ + version: 3.3.2 + - name: postgres-cluster + alias: postgres-16-cluster + version: 3.8.4 + repository: http://alexlebens.github.io/helm-charts +icon: https://raw.githubusercontent.com/walkxcode/dashboard-icons/main/png/jellystat.png +appVersion: 1.1.0 diff --git a/clusters/cl01tl/applications/jellystat/templates/external-secret.yaml b/clusters/cl01tl/applications/jellystat/templates/external-secret.yaml new file mode 100644 index 000000000..8a70b7790 --- /dev/null +++ b/clusters/cl01tl/applications/jellystat/templates/external-secret.yaml @@ -0,0 +1,128 @@ +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: jellystat-secret + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: jellystat-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/jellystat + metadataPolicy: None + property: secret-key + - secretKey: user + remoteRef: + conversionStrategy: Default + decodingStrategy: None + key: /cl01tl/jellystat + metadataPolicy: None + property: user + - secretKey: password + remoteRef: + conversionStrategy: Default + decodingStrategy: None + key: /cl01tl/jellystat + metadataPolicy: None + property: password + +--- +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: jellystat-data-backup-secret + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: jellystat-data-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 }}` }}/jellystat/jellystat-data" + 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 + +--- +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: jellystat-postgresql-16-cluster-backup-secret + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: jellystat-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-jellystat-postgresql + metadataPolicy: None + property: access_key + - secretKey: ACCESS_SECRET_KEY + remoteRef: + conversionStrategy: Default + decodingStrategy: None + key: /aws/keys/cl01tl-jellystat-postgresql + metadataPolicy: None + property: secret_key diff --git a/clusters/cl01tl/applications/jellystat/templates/replication-source.yaml b/clusters/cl01tl/applications/jellystat/templates/replication-source.yaml new file mode 100644 index 000000000..a64e3e0b7 --- /dev/null +++ b/clusters/cl01tl/applications/jellystat/templates/replication-source.yaml @@ -0,0 +1,27 @@ +apiVersion: volsync.backube/v1alpha1 +kind: ReplicationSource +metadata: + name: jellystat-data-backup-source + namespace: {{ .Release.Namespace }} + labels: + app.kubernetes.io/name: jellystat-data-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: jellystat-data + trigger: + schedule: 0 0 * * * + restic: + pruneIntervalDays: 7 + repository: jellystat-data-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/jellystat/values.yaml b/clusters/cl01tl/applications/jellystat/values.yaml new file mode 100644 index 000000000..1363dc03e --- /dev/null +++ b/clusters/cl01tl/applications/jellystat/values.yaml @@ -0,0 +1,119 @@ +jellystat: + controllers: + main: + type: deployment + replicas: 1 + strategy: Recreate + revisionHistoryLimit: 3 + containers: + main: + image: + repository: cyfershepard/jellystat + tag: 1.1.0 + pullPolicy: IfNotPresent + env: + - name: TZ + value: US/Central + - name: JWT_SECRET + valueFrom: + secretKeyRef: + name: jellystat-secret + key: secret-key + - name: JS_USER + valueFrom: + secretKeyRef: + name: jellystat-secret + key: user + - name: JS_PASSWORD + valueFrom: + secretKeyRef: + name: jellystat-secret + key: password + - name: POSTGRES_USER + valueFrom: + secretKeyRef: + name: jellystat-postgresql-16-cluster-app + key: username + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: jellystat-postgresql-16-cluster-app + key: password + - name: POSTGRES_DB + valueFrom: + secretKeyRef: + name: jellystat-postgresql-16-cluster-app + key: dbname + - name: POSTGRES_IP + valueFrom: + secretKeyRef: + name: jellystat-postgresql-16-cluster-app + key: host + - name: POSTGRES_PORT + valueFrom: + secretKeyRef: + name: jellystat-postgresql-16-cluster-app + key: port + resources: + requests: + cpu: 100m + memory: 256Mi + serviceAccount: + create: true + service: + main: + controller: main + ports: + http: + port: 80 + targetPort: 3000 + protocol: HTTP + ingress: + main: + enabled: true + className: traefik + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: websecure + traefik.ingress.kubernetes.io/router.tls: "true" + cert-manager.io/cluster-issuer: letsencrypt-issuer + hosts: + - host: jellystat.alexlebens.net + paths: + - path: / + pathType: Prefix + service: + name: jellystat + port: 80 + tls: + - secretName: jellystat-secret-tls + hosts: + - jellystat.alexlebens.net + persistence: + data: + storageClass: ceph-block + accessMode: ReadWriteOnce + size: 5Gi + retain: true + advancedMounts: + main: + main: + - path: /app/backend/backup-data + readOnly: false +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/jellystat + endpointCredentials: jellystat-postgresql-16-cluster-backup-secret + backupIndex: 1 + retentionPolicy: 14d