From 51a9d16592e413f873eaa88129aa975ba8c4ba57 Mon Sep 17 00:00:00 2001 From: Joseph Hanson Date: Thu, 15 Aug 2024 09:30:24 -0500 Subject: [PATCH] add omegabrr --- kubernetes/apps/default/kustomization.yaml | 1 + .../default/omegabrr/app/externalsecret.yaml | 54 +++++++++++++++ .../default/omegabrr/app/helmrelease.yaml | 65 +++++++++++++++++++ .../default/omegabrr/app/kustomization.yaml | 8 +++ kubernetes/apps/default/omegabrr/ks.yaml | 26 ++++++++ 5 files changed, 154 insertions(+) create mode 100644 kubernetes/apps/default/omegabrr/app/externalsecret.yaml create mode 100644 kubernetes/apps/default/omegabrr/app/helmrelease.yaml create mode 100644 kubernetes/apps/default/omegabrr/app/kustomization.yaml create mode 100644 kubernetes/apps/default/omegabrr/ks.yaml diff --git a/kubernetes/apps/default/kustomization.yaml b/kubernetes/apps/default/kustomization.yaml index 2f5e0768..039a7d52 100644 --- a/kubernetes/apps/default/kustomization.yaml +++ b/kubernetes/apps/default/kustomization.yaml @@ -11,6 +11,7 @@ resources: - ./excalidraw/ks.yaml - ./jellyseerr/ks.yaml - ./maintainerr/ks.yaml + - ./omegabrr/ks.yaml - ./overseerr/ks.yaml - ./prowlarr/ks.yaml - ./radarr/ks.yaml diff --git a/kubernetes/apps/default/omegabrr/app/externalsecret.yaml b/kubernetes/apps/default/omegabrr/app/externalsecret.yaml new file mode 100644 index 00000000..f676a235 --- /dev/null +++ b/kubernetes/apps/default/omegabrr/app/externalsecret.yaml @@ -0,0 +1,54 @@ +--- +# yaml-language-server: $schema=https://ks.hsn.dev/external-secrets.io/externalsecret_v1beta1.json +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: omegabrr +spec: + refreshInterval: 5m + secretStoreRef: + kind: ClusterSecretStore + name: onepassword-connect + target: + name: omegabrr-secret + template: + engineVersion: v2 + data: + config.yaml: | + server: + host: 0.0.0.0 + port: 80 + apiToken: {{ .OMEGABRR_API_KEY }} + clients: + autobrr: + host: http://autobrr.default.svc.cluster.local + apikey: {{ .AUTOBRR_API_KEY }} + arr: + - name: radarr + type: radarr + host: http://radarr.default.svc.cluster.local + apikey: {{ .radarr_api_key }} + filters: [1] + - name: sonarr + type: sonarr + host: http://sonarr.default.svc.cluster.local + apikey: {{ .sonarr_api_key }} + filters: [2] + excludeAlternateTitles: true + dataFrom: + - extract: + key: omegabrr + - extract: + key: autobrr + - extract: + key: radarr + rewrite: + - regexp: + source: "(.*)" + target: "radarr_$1" + - extract: + key: sonarr + rewrite: + - regexp: + source: "(.*)" + target: "sonarr_$1" diff --git a/kubernetes/apps/default/omegabrr/app/helmrelease.yaml b/kubernetes/apps/default/omegabrr/app/helmrelease.yaml new file mode 100644 index 00000000..6e185157 --- /dev/null +++ b/kubernetes/apps/default/omegabrr/app/helmrelease.yaml @@ -0,0 +1,65 @@ +--- +# 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: omegabrr +spec: + interval: 30m + chart: + spec: + chart: app-template + version: 3.3.2 + sourceRef: + kind: HelmRepository + name: bjw-s + namespace: flux-system + install: + remediation: + retries: 3 + upgrade: + cleanupOnFail: true + remediation: + strategy: rollback + retries: 3 + values: + controllers: + omegabrr: + annotations: + reloader.stakater.com/auto: "true" + containers: + app: + image: + repository: ghcr.io/autobrr/omegabrr + tag: v1.13.1@sha256:ea3fca614459b6ffa0cd6b86c52195eb2a0705bfe0d9a2d88588afaa83762494 + env: + TZ: America/Chicago + securityContext: + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true + capabilities: { drop: ["ALL"] } + resources: + requests: + cpu: 10m + limits: + memory: 256Mi + defaultPodOptions: + securityContext: + runAsNonRoot: true + runAsUser: 568 + runAsGroup: 568 + seccompProfile: { type: RuntimeDefault } + service: + app: + controller: omegabrr + ports: + http: + port: 80 + persistence: + config-file: + type: secret + name: omegabrr-secret + globalMounts: + - path: /config/config.yaml + subPath: config.yaml + readOnly: true diff --git a/kubernetes/apps/default/omegabrr/app/kustomization.yaml b/kubernetes/apps/default/omegabrr/app/kustomization.yaml new file mode 100644 index 00000000..85e530b3 --- /dev/null +++ b/kubernetes/apps/default/omegabrr/app/kustomization.yaml @@ -0,0 +1,8 @@ +--- +# yaml-language-server: $schema=https://json.schemastore.org/kustomization +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: default +resources: + - ./externalsecret.yaml + - ./helmrelease.yaml diff --git a/kubernetes/apps/default/omegabrr/ks.yaml b/kubernetes/apps/default/omegabrr/ks.yaml new file mode 100644 index 00000000..27d95950 --- /dev/null +++ b/kubernetes/apps/default/omegabrr/ks.yaml @@ -0,0 +1,26 @@ +--- +# 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 omegabrr + namespace: flux-system +spec: + targetNamespace: default + commonMetadata: + labels: + app.kubernetes.io/name: *app + dependsOn: + - name: external-secrets-stores + path: ./kubernetes/apps/default/omegabrr/app + prune: true + sourceRef: + kind: GitRepository + name: homelab + wait: false + interval: 30m + retryInterval: 1m + timeout: 5m + postBuild: + substitute: + APP: *app