From 86d24f7799fa394bedd5955f10f4a2b7c76b1ec2 Mon Sep 17 00:00:00 2001 From: SeanOMik Date: Mon, 3 Apr 2023 01:02:32 -0400 Subject: [PATCH] Add sonarr --- cluster/apps/kustomization.yaml | 4 +- cluster/apps/media/sonarr/deployment.yaml | 60 +++++++++++--------- cluster/apps/media/sonarr/helm.yaml | 32 +++++++++++ cluster/apps/media/sonarr/ingress.yaml | 19 +++++++ cluster/apps/media/sonarr/kustomization.yaml | 4 +- cluster/apps/media/sonarr/service.yaml | 16 ++++++ 6 files changed, 106 insertions(+), 29 deletions(-) create mode 100644 cluster/apps/media/sonarr/helm.yaml create mode 100644 cluster/apps/media/sonarr/ingress.yaml create mode 100644 cluster/apps/media/sonarr/service.yaml diff --git a/cluster/apps/kustomization.yaml b/cluster/apps/kustomization.yaml index 806c68c..b49ce52 100644 --- a/cluster/apps/kustomization.yaml +++ b/cluster/apps/kustomization.yaml @@ -1,4 +1,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization -resources: [] -#- ./media \ No newline at end of file +resources: +- ./media \ No newline at end of file diff --git a/cluster/apps/media/sonarr/deployment.yaml b/cluster/apps/media/sonarr/deployment.yaml index e15eeda..2d5a00b 100644 --- a/cluster/apps/media/sonarr/deployment.yaml +++ b/cluster/apps/media/sonarr/deployment.yaml @@ -1,31 +1,39 @@ -apiVersion: source.toolkit.fluxcd.io/v1beta2 -kind: HelmRepository -metadata: - name: aste88-charts - namespace: flux-system -spec: - interval: 1m - url: https://aste88.github.io/helm-charts/ ---- -apiVersion: helm.toolkit.fluxcd.io/v2beta1 -kind: HelmRelease +apiVersion: extensions/v1beta1 +kind: Deployment metadata: name: sonarr namespace: media + + labels: + app: sonarr + kubernetes.io/name: "sonarr" spec: - interval: 5m - chart: + replicas: 1 + template: + metadata: + labels: + app: sonarr spec: - chart: sonarr - version: '17.x.x' - sourceRef: - kind: HelmRepository - name: aste88-charts - namespace: flux-system - interval: 1m - values: - env: - TZ: America/New_York - ingress: - -# metrics.enabled: true \ No newline at end of file + containers: + - name: sonarr + image: linuxserver/sonarr + imagePullPolicy: Always + ports: + - containerPort: 8989 + env: + - name: PGID + value: "1000" + - name: PUID + value: "1000" + volumeMounts: + - name: sonarr + mountPath: /config + - name: sonarr-media-storage + mountPath: /storage + volumes: + - name: sonarr + hostPath: + path: /mnt/MainPool/Kubernetes/sonarr + - name: sonarr-media-storage + hostPath: + path: /mnt/MainPool/Media \ No newline at end of file diff --git a/cluster/apps/media/sonarr/helm.yaml b/cluster/apps/media/sonarr/helm.yaml new file mode 100644 index 0000000..a792738 --- /dev/null +++ b/cluster/apps/media/sonarr/helm.yaml @@ -0,0 +1,32 @@ +apiVersion: source.toolkit.fluxcd.io/v1beta2 +kind: HelmRepository +metadata: + name: aste88-charts + namespace: flux-system +spec: + interval: 1m + url: https://aste88.github.io/helm-charts/ +--- +apiVersion: helm.toolkit.fluxcd.io/v2beta1 +kind: HelmRelease +metadata: + name: sonarr + namespace: media +spec: + interval: 5m + chart: + spec: + chart: sonarr + version: '17.x.x' + sourceRef: + kind: HelmRepository + name: aste88-charts + namespace: flux-system + interval: 1m + values: + env: + TZ: America/New_York + metrics: + enabled: false + +# metrics.enabled: true \ No newline at end of file diff --git a/cluster/apps/media/sonarr/ingress.yaml b/cluster/apps/media/sonarr/ingress.yaml new file mode 100644 index 0000000..57e9167 --- /dev/null +++ b/cluster/apps/media/sonarr/ingress.yaml @@ -0,0 +1,19 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: sonarr-ingress + namespace: media + annotations: + traefik.ingress.kubernetes.io/router.entrypoints: websecure +spec: + rules: + - host: "k3sson.***REMOVED***" + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: sonarr + port: + number: 8989 \ No newline at end of file diff --git a/cluster/apps/media/sonarr/kustomization.yaml b/cluster/apps/media/sonarr/kustomization.yaml index 5388f4d..b81e0e0 100644 --- a/cluster/apps/media/sonarr/kustomization.yaml +++ b/cluster/apps/media/sonarr/kustomization.yaml @@ -1,4 +1,6 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: -- ./sonarr.yaml \ No newline at end of file +- ./deployment.yaml +- ./ingress.yaml +- ./service.yaml \ No newline at end of file diff --git a/cluster/apps/media/sonarr/service.yaml b/cluster/apps/media/sonarr/service.yaml new file mode 100644 index 0000000..435f8f2 --- /dev/null +++ b/cluster/apps/media/sonarr/service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: sonarr + namespace: media + + labels: + app: sonarr + kubernetes.io/name: "sonarr" +spec: + selector: + app: sonarr + ports: + - name: sonarr + port: 80 + targetPort: 8989 \ No newline at end of file