Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(media/prowlarr): migrate prowlarr #3414

Merged
merged 1 commit into from
Jun 23, 2024
Merged

feat(media/prowlarr): migrate prowlarr #3414

merged 1 commit into from
Jun 23, 2024

Conversation

blackjid
Copy link
Owner

No description provided.

@bot-x-mod
Copy link
Contributor

bot-x-mod bot commented Jun 23, 2024

--- kubernetes/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/radarr

+++ kubernetes/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/radarr

@@ -13,13 +13,12 @@

       app.kubernetes.io/name: radarr
   decryption:
     provider: sops
     secretRef:
       name: sops-age
   dependsOn:
-  - name: cloudnative-pg-cluster
   - name: external-secrets-stores
   interval: 30m
   path: ./kubernetes/apps/media/radarr/app
   postBuild:
     substitute:
       APP: radarr
--- kubernetes/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/prowlarr

+++ kubernetes/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/prowlarr

@@ -0,0 +1,45 @@

+---
+apiVersion: kustomize.toolkit.fluxcd.io/v1
+kind: Kustomization
+metadata:
+  labels:
+    kustomize.toolkit.fluxcd.io/name: cluster-apps
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: prowlarr
+  namespace: flux-system
+spec:
+  commonMetadata:
+    labels:
+      app.kubernetes.io/name: prowlarr
+  decryption:
+    provider: sops
+    secretRef:
+      name: sops-age
+  dependsOn:
+  - name: external-secrets-stores
+  interval: 30m
+  path: ./kubernetes/apps/media/prowlarr/app
+  postBuild:
+    substitute:
+      APP: prowlarr
+      VOLSYNC_CAPACITY: 1Gi
+    substituteFrom:
+    - kind: ConfigMap
+      name: cluster-settings
+    - kind: Secret
+      name: cluster-secrets
+    - kind: ConfigMap
+      name: cluster-user-settings
+      optional: true
+    - kind: Secret
+      name: cluster-user-secrets
+      optional: true
+  prune: true
+  retryInterval: 1m
+  sourceRef:
+    kind: GitRepository
+    name: home-kubernetes
+  targetNamespace: media
+  timeout: 5m
+  wait: false
+
--- kubernetes/apps/media/prowlarr/app Kustomization: flux-system/prowlarr ExternalSecret: media/prowlarr

+++ kubernetes/apps/media/prowlarr/app Kustomization: flux-system/prowlarr ExternalSecret: media/prowlarr

@@ -0,0 +1,24 @@

+---
+apiVersion: external-secrets.io/v1beta1
+kind: ExternalSecret
+metadata:
+  labels:
+    app.kubernetes.io/name: prowlarr
+    kustomize.toolkit.fluxcd.io/name: prowlarr
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: prowlarr
+  namespace: media
+spec:
+  dataFrom:
+  - extract:
+      key: prowlarr
+  secretStoreRef:
+    kind: ClusterSecretStore
+    name: onepassword-connect
+  target:
+    name: prowlarr-secret
+    template:
+      data:
+        PROWLARR__AUTH__APIKEY: '{{ .PROWLARR_API_KEY }}'
+      engineVersion: v2
+
--- kubernetes/apps/media/prowlarr/app Kustomization: flux-system/prowlarr HelmRelease: media/prowlarr

+++ kubernetes/apps/media/prowlarr/app Kustomization: flux-system/prowlarr HelmRelease: media/prowlarr

@@ -0,0 +1,118 @@

+---
+apiVersion: helm.toolkit.fluxcd.io/v2
+kind: HelmRelease
+metadata:
+  labels:
+    app.kubernetes.io/name: prowlarr
+    kustomize.toolkit.fluxcd.io/name: prowlarr
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: prowlarr
+  namespace: media
+spec:
+  chart:
+    spec:
+      chart: app-template
+      sourceRef:
+        kind: HelmRepository
+        name: bjw-s
+        namespace: flux-system
+      version: 3.2.1
+  install:
+    remediation:
+      retries: 3
+  interval: 30m
+  upgrade:
+    cleanupOnFail: true
+    remediation:
+      retries: 3
+      strategy: rollback
+  values:
+    controllers:
+      prowlarr:
+        annotations:
+          reloader.stakater.com/auto: 'true'
+        containers:
+          app:
+            env:
+              PROWLARR__APP__INSTANCENAME: Prowlarr
+              PROWLARR__APP__THEME: dark
+              PROWLARR__AUTH__METHOD: External
+              PROWLARR__AUTH__REQUIRED: DisabledForLocalAddresses
+              PROWLARR__LOG__DBENABLED: 'False'
+              PROWLARR__LOG__LEVEL: info
+              PROWLARR__SERVER__PORT: 80
+              PROWLARR__UPDATE__BRANCH: develop
+              TZ: America/Santiago
+            envFrom:
+            - secretRef:
+                name: prowlarr-secret
+            image:
+              repository: ghcr.io/onedr0p/prowlarr-develop
+              tag: 1.19.0.4568@sha256:59a1b3f3f5df0f0d112a338d8b155737736ae506aaf2f227fa8bdf54b1bd634d
+            probes:
+              liveness:
+                custom: true
+                enabled: true
+                spec:
+                  failureThreshold: 3
+                  httpGet:
+                    path: /ping
+                    port: 80
+                  initialDelaySeconds: 0
+                  periodSeconds: 10
+                  timeoutSeconds: 1
+              readiness:
+                custom: true
+                enabled: true
+                spec:
+                  failureThreshold: 3
+                  httpGet:
+                    path: /ping
+                    port: 80
+                  initialDelaySeconds: 0
+                  periodSeconds: 10
+                  timeoutSeconds: 1
+            resources:
+              limits:
+                memory: 1Gi
+              requests:
+                cpu: 10m
+            securityContext:
+              allowPrivilegeEscalation: false
+              capabilities:
+                drop:
+                - ALL
+              readOnlyRootFilesystem: true
+    defaultPodOptions:
+      securityContext:
+        fsGroup: 568
+        fsGroupChangePolicy: OnRootMismatch
+        runAsGroup: 568
+        runAsNonRoot: true
+        runAsUser: 568
+        seccompProfile:
+          type: RuntimeDefault
+    ingress:
+      app:
+        annotations:
+          external-dns.alpha.kubernetes.io/target: internal.donoso.family
+        className: internal
+        hosts:
+        - host: '{{ .Release.Name }}.donoso.family'
+          paths:
+          - path: /
+            service:
+              identifier: app
+              port: http
+    persistence:
+      config:
+        existingClaim: prowlarr
+      tmp:
+        type: emptyDir
+    service:
+      app:
+        controller: prowlarr
+        ports:
+          http:
+            port: 80
+
--- kubernetes/apps/media/prowlarr/app Kustomization: flux-system/prowlarr PersistentVolumeClaim: media/prowlarr

+++ kubernetes/apps/media/prowlarr/app Kustomization: flux-system/prowlarr PersistentVolumeClaim: media/prowlarr

@@ -0,0 +1,22 @@

+---
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+  labels:
+    app.kubernetes.io/name: prowlarr
+    kustomize.toolkit.fluxcd.io/name: prowlarr
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: prowlarr
+  namespace: media
+spec:
+  accessModes:
+  - ReadWriteOnce
+  dataSourceRef:
+    apiGroup: volsync.backube
+    kind: ReplicationDestination
+    name: prowlarr-dst
+  resources:
+    requests:
+      storage: 1Gi
+  storageClassName: longhorn
+
--- kubernetes/apps/media/prowlarr/app Kustomization: flux-system/prowlarr ExternalSecret: media/prowlarr-volsync

+++ kubernetes/apps/media/prowlarr/app Kustomization: flux-system/prowlarr ExternalSecret: media/prowlarr-volsync

@@ -0,0 +1,29 @@

+---
+apiVersion: external-secrets.io/v1beta1
+kind: ExternalSecret
+metadata:
+  labels:
+    app.kubernetes.io/name: prowlarr
+    kustomize.toolkit.fluxcd.io/name: prowlarr
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: prowlarr-volsync
+  namespace: media
+spec:
+  dataFrom:
+  - extract:
+      key: minio
+  - extract:
+      key: volsync-minio-template
+  secretStoreRef:
+    kind: ClusterSecretStore
+    name: onepassword-connect
+  target:
+    name: prowlarr-volsync-secret
+    template:
+      data:
+        AWS_ACCESS_KEY_ID: '{{ .MINIO_ROOT_USER }}'
+        AWS_SECRET_ACCESS_KEY: '{{ .MINIO_ROOT_PASSWORD }}'
+        RESTIC_PASSWORD: '{{ .RESTIC_PASSWORD }}'
+        RESTIC_REPOSITORY: '{{ .REPOSITORY_TEMPLATE }}/prowlarr'
+      engineVersion: v2
+
--- kubernetes/apps/media/prowlarr/app Kustomization: flux-system/prowlarr ReplicationSource: media/prowlarr

+++ kubernetes/apps/media/prowlarr/app Kustomization: flux-system/prowlarr ReplicationSource: media/prowlarr

@@ -0,0 +1,35 @@

+---
+apiVersion: volsync.backube/v1alpha1
+kind: ReplicationSource
+metadata:
+  labels:
+    app.kubernetes.io/name: prowlarr
+    kustomize.toolkit.fluxcd.io/name: prowlarr
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: prowlarr
+  namespace: media
+spec:
+  restic:
+    accessModes:
+    - ReadWriteOnce
+    cacheAccessModes:
+    - ReadWriteOnce
+    cacheCapacity: 4Gi
+    cacheStorageClassName: longhorn-cache
+    copyMethod: Snapshot
+    moverSecurityContext:
+      fsGroup: 568
+      runAsGroup: 568
+      runAsUser: 568
+    pruneIntervalDays: 7
+    repository: prowlarr-volsync-secret
+    retain:
+      daily: 7
+      hourly: 24
+      weekly: 5
+    storageClassName: longhorn-snapshot
+    volumeSnapshotClassName: longhorn-snapclass
+  sourcePVC: prowlarr
+  trigger:
+    schedule: 0 * * * *
+
--- kubernetes/apps/media/prowlarr/app Kustomization: flux-system/prowlarr ReplicationDestination: media/prowlarr-dst

+++ kubernetes/apps/media/prowlarr/app Kustomization: flux-system/prowlarr ReplicationDestination: media/prowlarr-dst

@@ -0,0 +1,30 @@

+---
+apiVersion: volsync.backube/v1alpha1
+kind: ReplicationDestination
+metadata:
+  labels:
+    app.kubernetes.io/name: prowlarr
+    kustomize.toolkit.fluxcd.io/name: prowlarr
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: prowlarr-dst
+  namespace: media
+spec:
+  restic:
+    accessModes:
+    - ReadWriteOnce
+    cacheAccessModes:
+    - ReadWriteOnce
+    cacheCapacity: 8Gi
+    cacheStorageClassName: longhorn-cache
+    capacity: 1Gi
+    copyMethod: Snapshot
+    moverSecurityContext:
+      fsGroup: 568
+      runAsGroup: 568
+      runAsUser: 568
+    repository: prowlarr-volsync-secret
+    storageClassName: longhorn-snapshot
+    volumeSnapshotClassName: longhorn-snapclass
+  trigger:
+    manual: restore-once
+

@bot-x-mod
Copy link
Contributor

bot-x-mod bot commented Jun 23, 2024

--- HelmRelease: media/prowlarr Service: media/prowlarr

+++ HelmRelease: media/prowlarr Service: media/prowlarr

@@ -0,0 +1,22 @@

+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: prowlarr
+  labels:
+    app.kubernetes.io/instance: prowlarr
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: prowlarr
+    app.kubernetes.io/service: prowlarr
+spec:
+  type: ClusterIP
+  ports:
+  - port: 80
+    targetPort: 80
+    protocol: TCP
+    name: http
+  selector:
+    app.kubernetes.io/component: prowlarr
+    app.kubernetes.io/instance: prowlarr
+    app.kubernetes.io/name: prowlarr
+
--- HelmRelease: media/prowlarr Deployment: media/prowlarr

+++ HelmRelease: media/prowlarr Deployment: media/prowlarr

@@ -0,0 +1,108 @@

+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: prowlarr
+  labels:
+    app.kubernetes.io/component: prowlarr
+    app.kubernetes.io/instance: prowlarr
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: prowlarr
+  annotations:
+    reloader.stakater.com/auto: 'true'
+spec:
+  revisionHistoryLimit: 3
+  replicas: 1
+  strategy:
+    type: Recreate
+  selector:
+    matchLabels:
+      app.kubernetes.io/component: prowlarr
+      app.kubernetes.io/name: prowlarr
+      app.kubernetes.io/instance: prowlarr
+  template:
+    metadata:
+      labels:
+        app.kubernetes.io/component: prowlarr
+        app.kubernetes.io/instance: prowlarr
+        app.kubernetes.io/name: prowlarr
+    spec:
+      enableServiceLinks: false
+      serviceAccountName: default
+      automountServiceAccountToken: true
+      securityContext:
+        fsGroup: 568
+        fsGroupChangePolicy: OnRootMismatch
+        runAsGroup: 568
+        runAsNonRoot: true
+        runAsUser: 568
+        seccompProfile:
+          type: RuntimeDefault
+      hostIPC: false
+      hostNetwork: false
+      hostPID: false
+      dnsPolicy: ClusterFirst
+      containers:
+      - env:
+        - name: PROWLARR__APP__INSTANCENAME
+          value: Prowlarr
+        - name: PROWLARR__APP__THEME
+          value: dark
+        - name: PROWLARR__AUTH__METHOD
+          value: External
+        - name: PROWLARR__AUTH__REQUIRED
+          value: DisabledForLocalAddresses
+        - name: PROWLARR__LOG__DBENABLED
+          value: 'False'
+        - name: PROWLARR__LOG__LEVEL
+          value: info
+        - name: PROWLARR__SERVER__PORT
+          value: '80'
+        - name: PROWLARR__UPDATE__BRANCH
+          value: develop
+        - name: TZ
+          value: America/Santiago
+        envFrom:
+        - secretRef:
+            name: prowlarr-secret
+        image: ghcr.io/onedr0p/prowlarr-develop:1.19.0.4568@sha256:59a1b3f3f5df0f0d112a338d8b155737736ae506aaf2f227fa8bdf54b1bd634d
+        livenessProbe:
+          failureThreshold: 3
+          httpGet:
+            path: /ping
+            port: 80
+          initialDelaySeconds: 0
+          periodSeconds: 10
+          timeoutSeconds: 1
+        name: app
+        readinessProbe:
+          failureThreshold: 3
+          httpGet:
+            path: /ping
+            port: 80
+          initialDelaySeconds: 0
+          periodSeconds: 10
+          timeoutSeconds: 1
+        resources:
+          limits:
+            memory: 1Gi
+          requests:
+            cpu: 10m
+        securityContext:
+          allowPrivilegeEscalation: false
+          capabilities:
+            drop:
+            - ALL
+          readOnlyRootFilesystem: true
+        volumeMounts:
+        - mountPath: /config
+          name: config
+        - mountPath: /tmp
+          name: tmp
+      volumes:
+      - name: config
+        persistentVolumeClaim:
+          claimName: prowlarr
+      - emptyDir: {}
+        name: tmp
+
--- HelmRelease: media/prowlarr Ingress: media/prowlarr

+++ HelmRelease: media/prowlarr Ingress: media/prowlarr

@@ -0,0 +1,25 @@

+---
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+  name: prowlarr
+  labels:
+    app.kubernetes.io/instance: prowlarr
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: prowlarr
+  annotations:
+    external-dns.alpha.kubernetes.io/target: internal.donoso.family
+spec:
+  ingressClassName: internal
+  rules:
+  - host: prowlarr.donoso.family
+    http:
+      paths:
+      - path: /
+        pathType: Prefix
+        backend:
+          service:
+            name: prowlarr
+            port:
+              number: 80
+

@blackjid blackjid merged commit 9ae68e0 into main Jun 23, 2024
4 of 5 checks passed
@blackjid blackjid deleted the migrate_prowlarr branch June 23, 2024 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant