From e4a532e704d4ff4aa9eb36358c2c0f620652573f Mon Sep 17 00:00:00 2001 From: Joe Monk Date: Tue, 6 Aug 2024 20:57:49 +0100 Subject: [PATCH] Hooray sonarr --- apps/sonarr/deployment.yaml | 54 ++++++++++++++++++++++++++++++++++ apps/sonarr/ingress.yaml | 16 ++++++++++ apps/sonarr/kustomization.yaml | 7 +++++ apps/sonarr/pvc.yaml | 11 +++++++ apps/sonarr/service.yaml | 12 ++++++++ 5 files changed, 100 insertions(+) create mode 100644 apps/sonarr/deployment.yaml create mode 100644 apps/sonarr/ingress.yaml create mode 100644 apps/sonarr/kustomization.yaml create mode 100644 apps/sonarr/pvc.yaml create mode 100644 apps/sonarr/service.yaml diff --git a/apps/sonarr/deployment.yaml b/apps/sonarr/deployment.yaml new file mode 100644 index 0000000..b026330 --- /dev/null +++ b/apps/sonarr/deployment.yaml @@ -0,0 +1,54 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: sonarr +spec: + minReadySeconds: 3 + revisionHistoryLimit: 5 + progressDeadlineSeconds: 60 + strategy: + type: Recreate + selector: + matchLabels: + app: sonarr + template: + metadata: + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9797" + labels: + app: sonarr + spec: + containers: + - name: sonarr + image: lscr.io/linuxserver/sonarr:4.0.8 + imagePullPolicy: IfNotPresent + ports: + - name: http + containerPort: 8989 + livenessProbe: + httpGet: + path: /ping + port: 8989 + initialDelaySeconds: 5 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /ping + port: 8989 + initialDelaySeconds: 5 + timeoutSeconds: 5 + resources: + limits: + cpu: 1000m + memory: 2Gi + requests: + cpu: 10m + memory: 64Mi + volumeMounts: + - name: config + mountPath: /config + volumes: + - name: config + persistentVolumeClaim: + claimName: sonarr-pvc \ No newline at end of file diff --git a/apps/sonarr/ingress.yaml b/apps/sonarr/ingress.yaml new file mode 100644 index 0000000..aa2554a --- /dev/null +++ b/apps/sonarr/ingress.yaml @@ -0,0 +1,16 @@ +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: sonarr +spec: + entryPoints: + - web + routes: + - match: Host(`sonarr.k3s`) + kind: Rule + services: + - name: sonarr + namespace: apps + nativeLB: true + kind: Service + port: 8989 \ No newline at end of file diff --git a/apps/sonarr/kustomization.yaml b/apps/sonarr/kustomization.yaml new file mode 100644 index 0000000..425b057 --- /dev/null +++ b/apps/sonarr/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: +- deployment.yaml +- service.yaml +- ingress.yaml +- pvc.yaml \ No newline at end of file diff --git a/apps/sonarr/pvc.yaml b/apps/sonarr/pvc.yaml new file mode 100644 index 0000000..98dc42d --- /dev/null +++ b/apps/sonarr/pvc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: sonarr-pvc +spec: + accessModes: + - ReadWriteOncePod + storageClassName: longhorn + resources: + requests: + storage: 2Gi \ No newline at end of file diff --git a/apps/sonarr/service.yaml b/apps/sonarr/service.yaml new file mode 100644 index 0000000..5431a7b --- /dev/null +++ b/apps/sonarr/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: sonarr +spec: + type: ClusterIP + selector: + app: sonarr + ports: + - name: http + port: 8989 + targetPort: 8989 \ No newline at end of file