# yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s/helm-charts/main/charts/other/app-template/schemas/helmrelease-helm-v2.schema.json
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
  name: jellyseerr
spec:
  chart:
    spec:
      chart: app-template
      version: 3.3.2
      interval: 30m
      sourceRef:
        kind: HelmRepository
        name: bjw-s
        namespace: flux-system
  install:
    remediation:
      retries: 3
  upgrade:
    cleanupOnFail: true
    remediation:
      retries: 3
      strategy: rollback
  interval: 30m
  values:
    controllers:
      jellyseerr:
        annotations:
          reloader.stakater.com/auto: "true"
        containers:
          app:
            envFrom:
              - secretRef:
                  name: jellyseerr-secret
            env:
              NODE_ENV: production
            image:
              repository: ghcr.io/jahanson/jellyseerr
              tag: v1.9.2-postgresql
            probes:
              liveness:
                enabled: true
              readiness:
                enabled: true
            resources:
              limits:
                memory: 390Mi
              requests:
                cpu: 50m
                memory: 390Mi
            securityContext:
              allowPrivilegeEscalation: false
              capabilities:
                drop:
                  - ALL
              readOnlyRootFilesystem: true
        type: statefulset
    ingress:
      app:
        annotations:
          external-dns.alpha.kubernetes.io/cloudflare-proxied: "true"
          external-dns.alpha.kubernetes.io/target: external.hsn.dev
        className: external-nginx
        hosts:
          - host: &host jellyseerr.hsn.dev
            paths:
              - path: /
                service:
                  identifier: app
                  port: http
        tls:
          - hosts:
              - *host
    service:
      app:
        controller: jellyseerr
        ports:
          http:
            port: 5055
    persistence:
      config:
        enabled: true
        existingClaim: jellyseerr
        globalMounts:
          - path: /app/config
            readOnly: false
      logs:
        type: emptyDir
        globalMounts:
          - path: /app/config/logs/
          - path: /app/.next/cache
            readOnly: false