From 27b6de3641ac039d8179453671cada899200f33e Mon Sep 17 00:00:00 2001 From: aggarwalakshun Date: Sun, 28 Dec 2025 07:31:21 +0530 Subject: [PATCH] add db, ingress, pvc, secrets, svc, and deployment for jellystat --- .../monitoring/jellystat/jellystat-db.yml | 46 ++++++++++++++++ .../jellystat/jellystat-ingress.yml | 27 +++++++++ .../monitoring/jellystat/jellystat-pvc.yml | 14 +++++ .../jellystat/jellystat-secret-sealed.yml | 15 +++++ .../monitoring/jellystat/jellystat-svc.yml | 27 +++++++++ .../ipv6/monitoring/jellystat/jellystat.yml | 55 +++++++++++++++++++ 6 files changed, 184 insertions(+) create mode 100644 clusters/ipv6/monitoring/jellystat/jellystat-db.yml create mode 100644 clusters/ipv6/monitoring/jellystat/jellystat-ingress.yml create mode 100644 clusters/ipv6/monitoring/jellystat/jellystat-pvc.yml create mode 100644 clusters/ipv6/monitoring/jellystat/jellystat-secret-sealed.yml create mode 100644 clusters/ipv6/monitoring/jellystat/jellystat-svc.yml create mode 100644 clusters/ipv6/monitoring/jellystat/jellystat.yml diff --git a/clusters/ipv6/monitoring/jellystat/jellystat-db.yml b/clusters/ipv6/monitoring/jellystat/jellystat-db.yml new file mode 100644 index 0000000..85bceff --- /dev/null +++ b/clusters/ipv6/monitoring/jellystat/jellystat-db.yml @@ -0,0 +1,46 @@ +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: jellystat-db + namespace: monitoring +spec: + selector: + matchLabels: + app: jellystat-db + serviceName: jellystat-db + replicas: 1 + template: + metadata: + labels: + app: jellystat-db + spec: + containers: + - name: jellystat-db + image: postgres:18-alpine + ports: + - containerPort: 5432 + env: + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: jellystat-secret + key: password + - name: POSTGRES_DB + value: "jfstat" + - name: POSTGRES_USER + value: "postgres" + - name: PGDATA + value: /mnt/postgres/data + volumeMounts: + - name: postgres-data + mountPath: /mnt/postgres + volumeClaimTemplates: + - metadata: + name: postgres-data + spec: + accessModes: ["ReadWriteOnce"] + resources: + requests: + storage: 1Gi + storageClassName: longhorn diff --git a/clusters/ipv6/monitoring/jellystat/jellystat-ingress.yml b/clusters/ipv6/monitoring/jellystat/jellystat-ingress.yml new file mode 100644 index 0000000..416ac89 --- /dev/null +++ b/clusters/ipv6/monitoring/jellystat/jellystat-ingress.yml @@ -0,0 +1,27 @@ +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: jellystat-ingress + namespace: monitoring + annotations: + cert-manager.io/cluster-issuer: letsencrypt-cloudflare + traefik.ingress.kubernetes.io/router.middlewares: tools-authelia@kubernetescrd + traefik.ingress.kubernetes.io/router.entrypoints: websecure +spec: + ingressClassName: traefik + tls: + - hosts: + - jellystat.akshun-lab.cc + secretName: jellystat-tls + rules: + - host: jellystat.akshun-lab.cc + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: jellystat-service + port: + number: 3000 diff --git a/clusters/ipv6/monitoring/jellystat/jellystat-pvc.yml b/clusters/ipv6/monitoring/jellystat/jellystat-pvc.yml new file mode 100644 index 0000000..c21e273 --- /dev/null +++ b/clusters/ipv6/monitoring/jellystat/jellystat-pvc.yml @@ -0,0 +1,14 @@ +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: jellystat-backups-longhorn + namespace: monitoring +spec: + accessModes: + - ReadWriteOnce + volumeMode: Filesystem + resources: + requests: + storage: 1Gi + storageClassName: longhorn diff --git a/clusters/ipv6/monitoring/jellystat/jellystat-secret-sealed.yml b/clusters/ipv6/monitoring/jellystat/jellystat-secret-sealed.yml new file mode 100644 index 0000000..34a1648 --- /dev/null +++ b/clusters/ipv6/monitoring/jellystat/jellystat-secret-sealed.yml @@ -0,0 +1,15 @@ +--- +apiVersion: bitnami.com/v1alpha1 +kind: SealedSecret +metadata: + name: jellystat-secret + namespace: monitoring +spec: + encryptedData: + jwt: AgB+LTIiJS3cLByJI92bP4ZxODj4XdmjQrVjv9BKb3TWnGRI3A84rh2uIQbOP1o6g8FzEFpat4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zynelm+4SoMXNJQW1o3EnJOu9DBec8cIBPGhwpo+QdLwgznI9vO2hOgTnp2amf1eGZIM4J959LRqiKKBNg02XZiE92orqmCaaxOfdUrVLho+JQQVsarx2qCN6lKU2Ev31OrTtUY0twS6P8W5/8iDVx1GeulUZZpVE1CMDuNSmlIi87sf8P844+hXr391gT6EiFXHLrcGG3JMHVePIbKGBda15Y7AlP/VEoJAZpmTrC6k8xbeRtAxZJIMLhl/NxGUXkQlpA3O9pUBY4XiJhlZIiQk6nCKg6YOQCTrZoB2/AkA1X1IOdGikyq+7OD0JtkrH9qwvY8dJfLLJc8kJXTR+e873MLQ== + template: + metadata: + name: jellystat-secret + namespace: monitoring + type: Opaque diff --git a/clusters/ipv6/monitoring/jellystat/jellystat-svc.yml b/clusters/ipv6/monitoring/jellystat/jellystat-svc.yml new file mode 100644 index 0000000..c3fdf7c --- /dev/null +++ b/clusters/ipv6/monitoring/jellystat/jellystat-svc.yml @@ -0,0 +1,27 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: jellystat-service + namespace: monitoring +spec: + selector: + app: jellystat + ports: + - port: 3000 + targetPort: 3000 + protocol: TCP + +--- +apiVersion: v1 +kind: Service +metadata: + name: jellystat-db + namespace: monitoring +spec: + selector: + app: jellystat-db + ports: + - port: 5432 + targetPort: 5432 + clusterIP: None diff --git a/clusters/ipv6/monitoring/jellystat/jellystat.yml b/clusters/ipv6/monitoring/jellystat/jellystat.yml new file mode 100644 index 0000000..606e309 --- /dev/null +++ b/clusters/ipv6/monitoring/jellystat/jellystat.yml @@ -0,0 +1,55 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: jellystat + namespace: monitoring +spec: + strategy: + type: Recreate + replicas: 1 + selector: + matchLabels: + app: jellystat + template: + metadata: + labels: + app: jellystat + spec: + containers: + - name: jellystat + image: cyfershepard/jellystat:1.1.7 + readinessProbe: + exec: + command: + - bash + - -c + - | + (echo >/dev/tcp/jellystat-db.monitoring.svc.cluster.local/5432) + initialDelaySeconds: 5 + periodSeconds: 5 + failureThreshold: 3 + env: + - name: JWT_SECRET + valueFrom: + secretKeyRef: + name: jellystat-secret + key: jwt + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: jellystat-secret + key: password + - name: POSTGRES_IP + value: "jellystat-db.monitoring.svc.cluster.local" + - name: POSTGRES_PORT + value: "5432" + - name: POSTGRES_USER + value: "postgres" + volumeMounts: + - name: backups + mountPath: /app/backend/backup-data + volumes: + - name: backups + persistentVolumeClaim: + claimName: jellystat-backups-longhorn