From 02a039b199f2c32977f880d98106ea6f1d545d46 Mon Sep 17 00:00:00 2001 From: Joseph Hanson Date: Thu, 5 Sep 2024 03:35:08 -0500 Subject: [PATCH] add sabnzbd --- kubernetes/apps/default/kustomization.yaml | 1 + .../default/sabnzbd/app/externalsecret.yaml | 20 ++++ .../apps/default/sabnzbd/app/helmrelease.yaml | 112 ++++++++++++++++++ .../default/sabnzbd/app/kustomization.yaml | 8 ++ kubernetes/apps/default/sabnzbd/ks.yaml | 29 +++++ 5 files changed, 170 insertions(+) create mode 100644 kubernetes/apps/default/sabnzbd/app/externalsecret.yaml create mode 100644 kubernetes/apps/default/sabnzbd/app/helmrelease.yaml create mode 100644 kubernetes/apps/default/sabnzbd/app/kustomization.yaml create mode 100644 kubernetes/apps/default/sabnzbd/ks.yaml diff --git a/kubernetes/apps/default/kustomization.yaml b/kubernetes/apps/default/kustomization.yaml index 56c36e7e..0b5f25a1 100644 --- a/kubernetes/apps/default/kustomization.yaml +++ b/kubernetes/apps/default/kustomization.yaml @@ -11,3 +11,4 @@ resources: - ./maintainerr/ks.yaml - ./radarr/ks.yaml - ./sonarr/ks.yaml + - ./sabnzbd/ks.yaml diff --git a/kubernetes/apps/default/sabnzbd/app/externalsecret.yaml b/kubernetes/apps/default/sabnzbd/app/externalsecret.yaml new file mode 100644 index 00000000..6cd24098 --- /dev/null +++ b/kubernetes/apps/default/sabnzbd/app/externalsecret.yaml @@ -0,0 +1,20 @@ +--- +# yaml-language-server: $schema=https://ks.hsn.dev/external-secrets.io/externalsecret_v1beta1.json +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: sabnzbd +spec: + secretStoreRef: + kind: ClusterSecretStore + name: onepassword-connect + target: + name: sabnzbd-secret + template: + engineVersion: v2 + data: + SABNZBD__API_KEY: "{{ .api_key }}" + SABNZBD__NZB_KEY: "{{ .nzb_key }}" + dataFrom: + - extract: + key: sabnzbd diff --git a/kubernetes/apps/default/sabnzbd/app/helmrelease.yaml b/kubernetes/apps/default/sabnzbd/app/helmrelease.yaml new file mode 100644 index 00000000..39895ec6 --- /dev/null +++ b/kubernetes/apps/default/sabnzbd/app/helmrelease.yaml @@ -0,0 +1,112 @@ +--- +# yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s/helm-charts/main/charts/other/app-template/schemas/helmrelease-helm-v2beta2.schema.json +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: sabnzbd +spec: + interval: 30m + chart: + spec: + chart: app-template + version: 3.4.0 + sourceRef: + kind: HelmRepository + name: bjw-s + namespace: flux-system + install: + remediation: + retries: 3 + upgrade: + cleanupOnFail: true + remediation: + retries: 3 + strategy: rollback + values: + controllers: + sabnzbd: + annotations: + reloader.stakater.com/auto: "true" + containers: + app: + image: + repository: ghcr.io/onedr0p/sabnzbd + tag: 4.3.3@sha256:4ad73733ae11eb03852ba99d6e49bff93f8087f9f77b9b193a1063c3f6f31482 + env: + TZ: America/Chicago + SABNZBD__PORT: &port 80 + SABNZBD__HOST_WHITELIST_ENTRIES: >- + sabnzbd, + sabnzbd.default, + sabnzbd.default.svc, + sabnzbd.default.svc.cluster, + sabnzbd.default.svc.cluster.local, + sabz.jahanson.tech, + sabnzbd.jahanson.tech + envFrom: + - secretRef: + name: sabnzbd-secret + probes: + liveness: &probes + enabled: true + custom: true + spec: + httpGet: + path: /api?mode=version + port: *port + initialDelaySeconds: 0 + periodSeconds: 10 + timeoutSeconds: 1 + failureThreshold: 3 + readiness: *probes + startup: + enabled: false + securityContext: + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true + capabilities: { drop: ["ALL"] } + resources: + requests: + cpu: 100m + limits: + memory: 16Gi + pod: + securityContext: + runAsUser: 568 + runAsGroup: 568 + runAsNonRoot: true + fsGroup: 568 + fsGroupChangePolicy: OnRootMismatch + supplementalGroups: [10000] + service: + app: + controller: sabnzbd + ports: + http: + port: *port + ingress: + app: + enabled: true + className: internal-nginx + hosts: + - host: &host sabz.jahanson.tech + paths: + - path: / + service: + identifier: app + port: http + tls: + - hosts: + - *host + persistence: + config: + enabled: true + existingClaim: sabnzbd + tmp: + type: emptyDir + media: + type: nfs + server: 10.1.1.13 + path: /eru/media + globalMounts: + - path: /data/nas-media diff --git a/kubernetes/apps/default/sabnzbd/app/kustomization.yaml b/kubernetes/apps/default/sabnzbd/app/kustomization.yaml new file mode 100644 index 00000000..be13d2db --- /dev/null +++ b/kubernetes/apps/default/sabnzbd/app/kustomization.yaml @@ -0,0 +1,8 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/kustomization +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ./externalsecret.yaml + - ./helmrelease.yaml + - ../../../../templates/volsync diff --git a/kubernetes/apps/default/sabnzbd/ks.yaml b/kubernetes/apps/default/sabnzbd/ks.yaml new file mode 100644 index 00000000..863453f7 --- /dev/null +++ b/kubernetes/apps/default/sabnzbd/ks.yaml @@ -0,0 +1,29 @@ +--- +# 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 sabnzbd + namespace: flux-system +spec: + targetNamespace: default + commonMetadata: + labels: + app.kubernetes.io/name: *app + dependsOn: + - name: external-secrets-stores + - name: openebs + - name: volsync + path: ./kubernetes/apps/default/sabnzbd/app + prune: true + sourceRef: + kind: GitRepository + name: theshire + wait: false + interval: 30m + retryInterval: 1m + timeout: 5m + postBuild: + substitute: + APP: *app + VOLSYNC_CAPACITY: 1Gi