diff --git a/kubernetes/apps/default/kustomization.yaml b/kubernetes/apps/default/kustomization.yaml index 674e5cc0..b2b72bee 100644 --- a/kubernetes/apps/default/kustomization.yaml +++ b/kubernetes/apps/default/kustomization.yaml @@ -7,6 +7,7 @@ resources: - ./jellyfin/ks.yaml - ./prowlarr/ks.yaml - ./radarr/ks.yaml + - ./recyclarr/ks.yaml - ./sabnzbd/ks.yaml - ./sonarr/ks.yaml - ./tautulli/ks.yaml diff --git a/kubernetes/apps/default/recyclarr/app/externalsecret.yaml b/kubernetes/apps/default/recyclarr/app/externalsecret.yaml new file mode 100644 index 00000000..380172c2 --- /dev/null +++ b/kubernetes/apps/default/recyclarr/app/externalsecret.yaml @@ -0,0 +1,30 @@ +--- +# yaml-language-server: $schema=https://ks.hsn.dev/external-secrets.io/externalsecret_v1beta1.json +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: recyclarr +spec: + secretStoreRef: + kind: ClusterSecretStore + name: onepassword-connect + target: + name: recyclarr-secret + template: + engineVersion: v2 + data: + RADARR_API_KEY: "{{ .radarr_api_key }}" + SONARR_API_KEY: "{{ .sonarr_api_key }}" + dataFrom: + - extract: + key: radarr + rewrite: + - regexp: + source: "(.*)" + target: "radarr_$1" + - extract: + key: sonarr + rewrite: + - regexp: + source: "(.*)" + target: "sonarr_$1" diff --git a/kubernetes/apps/default/recyclarr/app/helmrelease.yaml b/kubernetes/apps/default/recyclarr/app/helmrelease.yaml new file mode 100644 index 00000000..7364c907 --- /dev/null +++ b/kubernetes/apps/default/recyclarr/app/helmrelease.yaml @@ -0,0 +1,82 @@ +--- +# yaml-language-server: $schema=https://ks.hsn.dev/helm.toolkit.fluxcd.io/helmrelease_v2beta2.json +apiVersion: helm.toolkit.fluxcd.io/v2beta2 +kind: HelmRelease +metadata: + name: recyclarr +spec: + interval: 30m + chart: + spec: + chart: app-template + version: 2.5.0 + sourceRef: + kind: HelmRepository + name: bjw-s + namespace: flux-system + install: + remediation: + retries: 3 + upgrade: + cleanupOnFail: true + remediation: + retries: 3 + uninstall: + keepHistory: false + dependsOn: + - name: rook-ceph-cluster + namespace: rook-ceph + - name: volsync + namespace: storage + values: + controllers: + main: + type: cronjob + annotations: + reloader.stakater.com/auto: "true" + cronjob: + schedule: "@daily" + containers: + main: + image: + repository: ghcr.io/recyclarr/recyclarr + tag: 6.0.2@sha256:02add40feae0569401b5020528e06419b47046723d0bb4bef1e82325e9eefdad + env: + # Ref: https://github.com/Radarr/Radarr/issues/7030#issuecomment-1039689518 + # Ref: https://github.com/dotnet/runtime/issues/9336 + COMPlus_EnableDiagnostics: "0" + TZ: America/Chicago + envFrom: + - secretRef: + name: recyclarr-secret + args: ["sync"] + securityContext: + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true + capabilities: { drop: ["ALL"] } + resources: + requests: + cpu: 10m + limits: + memory: 128Mi + pod: + securityContext: + runAsUser: 568 + runAsGroup: 568 + runAsNonRoot: true + fsGroup: 568 + fsGroupChangePolicy: OnRootMismatch + service: + main: + enabled: false + persistence: + config: + enabled: true + existingClaim: recyclarr + config-file: + type: configMap + name: recyclarr-configmap + globalMounts: + - path: /config/recyclarr.yml + subPath: recyclarr.yml + readOnly: true diff --git a/kubernetes/apps/default/recyclarr/app/kustomization.yaml b/kubernetes/apps/default/recyclarr/app/kustomization.yaml new file mode 100644 index 00000000..bdf68404 --- /dev/null +++ b/kubernetes/apps/default/recyclarr/app/kustomization.yaml @@ -0,0 +1,14 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/kustomization +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ./externalsecret.yaml + - ./helmrelease.yaml + - ../../../../templates/volsync +configMapGenerator: + - name: recyclarr-configmap + files: + - recyclarr.yml=./resources/recyclarr.yml +generatorOptions: + disableNameSuffixHash: true diff --git a/kubernetes/apps/default/recyclarr/ks.yaml b/kubernetes/apps/default/recyclarr/ks.yaml new file mode 100644 index 00000000..dcbd7d4d --- /dev/null +++ b/kubernetes/apps/default/recyclarr/ks.yaml @@ -0,0 +1,27 @@ +--- +# yaml-language-server: $schema=https://ks.hsn.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: &app recyclarr + namespace: flux-system +spec: + targetNamespace: default + commonMetadata: + labels: + app.kubernetes.io/name: *app + dependsOn: + - name: external-secrets-stores + path: ./kubernetes/apps/default/recyclarr/app + prune: true + sourceRef: + kind: GitRepository + name: homelab + wait: false + interval: 30m + retryInterval: 1m + timeout: 5m + postBuild: + substitute: + APP: *app + VOLSYNC_CAPACITY: 1Gi