diff --git a/apps/arr/00-arr.yaml b/apps/arr/00-arr.yaml deleted file mode 100644 index 022d064..0000000 --- a/apps/arr/00-arr.yaml +++ /dev/null @@ -1,404 +0,0 @@ ---- -## Namespace -apiVersion: v1 -kind: Namespace -metadata: - name: arr - labels: - name: arr ---- -# Qbittorrent ---- -## Service for exposing Qbittorrent -apiVersion: v1 -kind: Service -metadata: - namespace: arr - name: qbittorrent -spec: - type: LoadBalancer - ports: - - name: web - port: 8112 - - name: a - port: 11010 - protocol: TCP - - name: b - port: 11011 - protocol: TCP - - name: c - port: 11012 - protocol: TCP - - name: d - port: 11013 - protocol: TCP - - name: e - port: 11014 - protocol: TCP - - name: f - port: 11015 - protocol: TCP - - name: a1 - port: 11010 - protocol: UDP - - name: b1 - port: 11011 - protocol: UDP - - name: c1 - port: 11012 - protocol: UDP - - name: d1 - port: 11013 - protocol: UDP - - name: e1 - port: 11014 - protocol: UDP - - name: f1 - port: 11015 - protocol: UDP - selector: - app: qbittorrent ---- -## Deployment for QbitTorrent -kind: Deployment -apiVersion: apps/v1 -metadata: - namespace: arr - name: qbittorrent - labels: - app: qbittorrent -spec: - replicas: 1 - selector: - matchLabels: - app: qbittorrent - template: - metadata: - labels: - app: qbittorrent - spec: - volumes: - - name: qbittorrent-config - hostPath: - path: "/mnt/sdb1/homelab/config/qbittorrent" - - name: media-data - hostPath: - path: "/mnt/sdb1/data" - containers: - - name: qbittorrent - image: lscr.io/linuxserver/qbittorrent:14.3.9.99202110311443-7435-01519b5e7ubuntu20.04.1-ls166 - volumeMounts: - - mountPath: "/config" - name: qbittorrent-config - - mountPath: "/app/data" - name: media-data - env: - - name: PUID - value: "1000" - - name: PGID - value: "1000" - - name: TZ - value: Europe/Oslo - - name: WEBUI_PORT - value: "8112" - ports: - - name: web - containerPort: 8112 - - containerPort: 11010 - protocol: TCP - - containerPort: 11011 - protocol: TCP - - containerPort: 11012 - protocol: TCP - - containerPort: 11013 - protocol: TCP - - containerPort: 11014 - protocol: TCP - - containerPort: 11015 - protocol: TCP - - containerPort: 11010 - protocol: UDP - - containerPort: 11011 - protocol: UDP - - containerPort: 11012 - protocol: UDP - - containerPort: 11013 - protocol: UDP - - containerPort: 11014 - protocol: UDP - - containerPort: 11015 - protocol: UDP ---- -# Prowlarr ---- -## Service for exposing Prowlarr -apiVersion: v1 -kind: Service -metadata: - namespace: arr - name: prowlarr -spec: - type: LoadBalancer - ports: - - name: web - port: 9696 - selector: - app: prowlarr ---- -## Deployment for Prowlarr -kind: Deployment -apiVersion: apps/v1 -metadata: - namespace: arr - name: prowlarr - labels: - app: prowlarr -spec: - replicas: 1 - selector: - matchLabels: - app: prowlarr - template: - metadata: - labels: - app: prowlarr - spec: - volumes: - - name: prowlarr-config - hostPath: - path: "/mnt/sdb1/homelab/config/prowlarr" - containers: - - name: prowlarr - image: lscr.io/linuxserver/prowlarr:develop - volumeMounts: - - mountPath: "/config" - name: prowlarr-config - env: - - name: PUID - value: "1000" - - name: PGID - value: "1000" - - name: TZ - value: Europe/Oslo - ports: - - name: web - containerPort: 9696 ---- -# Sonarr ---- -## Service for exposing Sonarr -apiVersion: v1 -kind: Service -metadata: - namespace: arr - name: sonarr -spec: - type: LoadBalancer - ports: - - name: web - port: 8989 - selector: - app: sonarr ---- -## Deployment for Sonarr -kind: Deployment -apiVersion: apps/v1 -metadata: - namespace: arr - name: sonarr - labels: - app: sonarr -spec: - replicas: 1 - selector: - matchLabels: - app: sonarr - template: - metadata: - labels: - app: sonarr - spec: - volumes: - - name: sonarr-config - hostPath: - path: "/mnt/sdb1/homelab/config/sonarr" - - name: media-data - hostPath: - path: "/mnt/sdb1/data" - containers: - - name: sonarr - image: lscr.io/linuxserver/sonarr - volumeMounts: - - mountPath: "/config" - name: sonarr-config - - mountPath: "/app/data" - name: media-data - env: - - name: PUID - value: "1000" - - name: PGID - value: "1000" - - name: TZ - value: Europe/Oslo - ports: - - name: web - containerPort: 8989 ---- -# Radarr ---- -## Service for exposing Radarr -apiVersion: v1 -kind: Service -metadata: - namespace: arr - name: radarr -spec: - type: LoadBalancer - ports: - - name: web - port: 7878 - selector: - app: radarr ---- -## Deployment for Radarr -kind: Deployment -apiVersion: apps/v1 -metadata: - namespace: arr - name: radarr - labels: - app: radarr -spec: - replicas: 1 - selector: - matchLabels: - app: radarr - template: - metadata: - labels: - app: radarr - spec: - volumes: - - name: radarr-config - hostPath: - path: "/mnt/sdb1/homelab/config/radarr" - - name: media-data - hostPath: - path: "/mnt/sdb1/data" - containers: - - name: radarr - image: lscr.io/linuxserver/radarr - volumeMounts: - - mountPath: "/config" - name: radarr-config - - mountPath: "/app/data" - name: media-data - env: - - name: PUID - value: "1000" - - name: PGID - value: "1000" - - name: TZ - value: Europe/Oslo - ports: - - name: web - containerPort: 7878 ---- -# Lidarr ---- -## Service for exposing Lidarr -apiVersion: v1 -kind: Service -metadata: - namespace: arr - name: lidarr -spec: - type: LoadBalancer - ports: - - name: web - port: 8686 - selector: - app: lidarr ---- -## Deployment for Lidarr -kind: Deployment -apiVersion: apps/v1 -metadata: - namespace: arr - name: lidarr - labels: - app: lidarr -spec: - replicas: 1 - selector: - matchLabels: - app: lidarr - template: - metadata: - labels: - app: lidarr - spec: - volumes: - - name: lidarr-config - hostPath: - path: "/mnt/sdb1/homelab/config/lidarr" - - name: media-data - hostPath: - path: "/mnt/sdb1/data" - containers: - - name: lidarr - image: lscr.io/linuxserver/lidarr - volumeMounts: - - mountPath: "/config" - name: lidarr-config - - mountPath: "/app/data" - name: media-data - env: - - name: PUID - value: "1000" - - name: PGID - value: "1000" - - name: TZ - value: Europe/Oslo - ports: - - name: web - containerPort: 8686 ---- -## IngressRoute ---- -apiVersion: traefik.containo.us/v1alpha1 -kind: IngressRoute -metadata: - namespace: arr - name: ingressroute-arr -spec: - entryPoints: - - websecure - routes: - - match: Host(`torrent.stonegarden.dev`) - kind: Rule - services: - - name: qbittorrent - port: 8112 - - match: Host(`prowlarr.stonegarden.dev`) - kind: Rule - services: - - name: prowlarr - port: 9696 - - match: Host(`sonarr.stonegarden.dev`) - kind: Rule - services: - - name: sonarr - port: 8989 - - match: Host(`radarr.stonegarden.dev`) - kind: Rule - services: - - name: radarr - port: 7878 - - match: Host(`lidarr.stonegarden.dev`) - kind: Rule - services: - - name: lidarr - port: 8686 - tls: - certResolver: letsencrypt \ No newline at end of file diff --git a/apps/arr/ingress.yaml b/apps/arr/ingress.yaml new file mode 100644 index 0000000..f3acda7 --- /dev/null +++ b/apps/arr/ingress.yaml @@ -0,0 +1,53 @@ +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + namespace: arr + name: ingressroute-arr +spec: + entryPoints: + - websecure + routes: + - match: Host(`auth-arr.stonegarden.dev`) + kind: Rule + services: + - name: traefik-forward-auth + port: 4181 + middlewares: + - name: traefik-forward-auth + - match: Host(`torrent.stonegarden.dev`) + kind: Rule + services: + - name: qbittorrent + port: 8112 + middlewares: + - name: traefik-forward-auth + - match: Host(`prowlarr.stonegarden.dev`) + kind: Rule + services: + - name: prowlarr + port: 9696 + middlewares: + - name: traefik-forward-auth + - match: Host(`sonarr.stonegarden.dev`) + kind: Rule + services: + - name: sonarr + port: 8989 + middlewares: + - name: traefik-forward-auth + - match: Host(`radarr.stonegarden.dev`) + kind: Rule + services: + - name: radarr + port: 7878 + middlewares: + - name: traefik-forward-auth + - match: Host(`lidarr.stonegarden.dev`) + kind: Rule + services: + - name: lidarr + port: 8686 + middlewares: + - name: traefik-forward-auth + tls: + certResolver: letsencrypt \ No newline at end of file diff --git a/apps/arr/kustomization.yaml b/apps/arr/kustomization.yaml new file mode 100644 index 0000000..8cf3efb --- /dev/null +++ b/apps/arr/kustomization.yaml @@ -0,0 +1,13 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: arr + +resources: + - namespace.yaml + - ingress.yaml + - traefik-forward-auth + - qbittorrent + - prowlarr + - sonarr + - radarr + - lidarr diff --git a/apps/arr/lidarr/deployment.yaml b/apps/arr/lidarr/deployment.yaml new file mode 100644 index 0000000..63d3af3 --- /dev/null +++ b/apps/arr/lidarr/deployment.yaml @@ -0,0 +1,42 @@ +kind: Deployment +apiVersion: apps/v1 +metadata: + namespace: arr + name: lidarr + labels: + app: lidarr +spec: + replicas: 1 + selector: + matchLabels: + app: lidarr + template: + metadata: + labels: + app: lidarr + spec: + volumes: + - name: lidarr-config + hostPath: + path: "/mnt/sdb1/homelab/config/lidarr" + - name: media-data + hostPath: + path: "/mnt/sdb1/data" + containers: + - name: lidarr + image: lscr.io/linuxserver/lidarr + volumeMounts: + - mountPath: "/config" + name: lidarr-config + - mountPath: "/app/data" + name: media-data + env: + - name: PUID + value: "1000" + - name: PGID + value: "1000" + - name: TZ + value: Europe/Oslo + ports: + - name: web + containerPort: 8686 \ No newline at end of file diff --git a/apps/arr/lidarr/kustomization.yaml b/apps/arr/lidarr/kustomization.yaml new file mode 100644 index 0000000..91d6e3f --- /dev/null +++ b/apps/arr/lidarr/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +commonLabels: + app: lidarr + +resources: + - service.yaml + - deployment.yaml \ No newline at end of file diff --git a/apps/arr/lidarr/service.yaml b/apps/arr/lidarr/service.yaml new file mode 100644 index 0000000..4f5e8d9 --- /dev/null +++ b/apps/arr/lidarr/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + namespace: arr + name: lidarr +spec: + type: LoadBalancer + ports: + - name: web + port: 8686 + selector: + app: lidarr \ No newline at end of file diff --git a/apps/arr/namespace.yaml b/apps/arr/namespace.yaml new file mode 100644 index 0000000..bb218a5 --- /dev/null +++ b/apps/arr/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: arr diff --git a/apps/arr/prowlarr/deployment.yaml b/apps/arr/prowlarr/deployment.yaml new file mode 100644 index 0000000..9efd2f9 --- /dev/null +++ b/apps/arr/prowlarr/deployment.yaml @@ -0,0 +1,37 @@ +kind: Deployment +apiVersion: apps/v1 +metadata: + namespace: arr + name: prowlarr + labels: + app: prowlarr +spec: + replicas: 1 + selector: + matchLabels: + app: prowlarr + template: + metadata: + labels: + app: prowlarr + spec: + volumes: + - name: prowlarr-config + hostPath: + path: "/mnt/sdb1/homelab/config/prowlarr" + containers: + - name: prowlarr + image: lscr.io/linuxserver/prowlarr:develop + volumeMounts: + - mountPath: "/config" + name: prowlarr-config + env: + - name: PUID + value: "1000" + - name: PGID + value: "1000" + - name: TZ + value: Europe/Oslo + ports: + - name: web + containerPort: 9696 \ No newline at end of file diff --git a/apps/arr/prowlarr/kustomization.yaml b/apps/arr/prowlarr/kustomization.yaml new file mode 100644 index 0000000..af9be5e --- /dev/null +++ b/apps/arr/prowlarr/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +commonLabels: + app: prowlarr + +resources: + - service.yaml + - deployment.yaml \ No newline at end of file diff --git a/apps/arr/prowlarr/service.yaml b/apps/arr/prowlarr/service.yaml new file mode 100644 index 0000000..bcbb8af --- /dev/null +++ b/apps/arr/prowlarr/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + namespace: arr + name: prowlarr +spec: + type: LoadBalancer + ports: + - name: web + port: 9696 + selector: + app: prowlarr \ No newline at end of file diff --git a/apps/arr/qbittorrent/deployment.yaml b/apps/arr/qbittorrent/deployment.yaml new file mode 100644 index 0000000..3a8d1eb --- /dev/null +++ b/apps/arr/qbittorrent/deployment.yaml @@ -0,0 +1,68 @@ +kind: Deployment +apiVersion: apps/v1 +metadata: + namespace: arr + name: qbittorrent + labels: + app: qbittorrent +spec: + replicas: 1 + selector: + matchLabels: + app: qbittorrent + template: + metadata: + labels: + app: qbittorrent + spec: + volumes: + - name: qbittorrent-config + hostPath: + path: "/mnt/sdb1/homelab/config/qbittorrent" + - name: media-data + hostPath: + path: "/mnt/sdb1/data" + containers: + - name: qbittorrent + image: lscr.io/linuxserver/qbittorrent:14.3.9.99202110311443-7435-01519b5e7ubuntu20.04.1-ls166 + volumeMounts: + - mountPath: "/config" + name: qbittorrent-config + - mountPath: "/app/data" + name: media-data + env: + - name: PUID + value: "1000" + - name: PGID + value: "1000" + - name: TZ + value: Europe/Oslo + - name: WEBUI_PORT + value: "8112" + ports: + - name: web + containerPort: 8112 + - containerPort: 11010 + protocol: TCP + - containerPort: 11011 + protocol: TCP + - containerPort: 11012 + protocol: TCP + - containerPort: 11013 + protocol: TCP + - containerPort: 11014 + protocol: TCP + - containerPort: 11015 + protocol: TCP + - containerPort: 11010 + protocol: UDP + - containerPort: 11011 + protocol: UDP + - containerPort: 11012 + protocol: UDP + - containerPort: 11013 + protocol: UDP + - containerPort: 11014 + protocol: UDP + - containerPort: 11015 + protocol: UDP \ No newline at end of file diff --git a/apps/arr/qbittorrent/kustomization.yaml b/apps/arr/qbittorrent/kustomization.yaml new file mode 100644 index 0000000..ee928c2 --- /dev/null +++ b/apps/arr/qbittorrent/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +commonLabels: + app: qbittorrent + +resources: + - service.yaml + - deployment.yaml \ No newline at end of file diff --git a/apps/arr/qbittorrent/service.yaml b/apps/arr/qbittorrent/service.yaml new file mode 100644 index 0000000..0e8a31f --- /dev/null +++ b/apps/arr/qbittorrent/service.yaml @@ -0,0 +1,48 @@ +apiVersion: v1 +kind: Service +metadata: + namespace: arr + name: qbittorrent +spec: + type: LoadBalancer + ports: + - name: web + port: 8112 + - name: a + port: 11010 + protocol: TCP + - name: b + port: 11011 + protocol: TCP + - name: c + port: 11012 + protocol: TCP + - name: d + port: 11013 + protocol: TCP + - name: e + port: 11014 + protocol: TCP + - name: f + port: 11015 + protocol: TCP + - name: a1 + port: 11010 + protocol: UDP + - name: b1 + port: 11011 + protocol: UDP + - name: c1 + port: 11012 + protocol: UDP + - name: d1 + port: 11013 + protocol: UDP + - name: e1 + port: 11014 + protocol: UDP + - name: f1 + port: 11015 + protocol: UDP + selector: + app: qbittorrent \ No newline at end of file diff --git a/apps/arr/radarr/deployment.yaml b/apps/arr/radarr/deployment.yaml new file mode 100644 index 0000000..089d2f8 --- /dev/null +++ b/apps/arr/radarr/deployment.yaml @@ -0,0 +1,42 @@ +kind: Deployment +apiVersion: apps/v1 +metadata: + namespace: arr + name: radarr + labels: + app: radarr +spec: + replicas: 1 + selector: + matchLabels: + app: radarr + template: + metadata: + labels: + app: radarr + spec: + volumes: + - name: radarr-config + hostPath: + path: "/mnt/sdb1/homelab/config/radarr" + - name: media-data + hostPath: + path: "/mnt/sdb1/data" + containers: + - name: radarr + image: lscr.io/linuxserver/radarr + volumeMounts: + - mountPath: "/config" + name: radarr-config + - mountPath: "/app/data" + name: media-data + env: + - name: PUID + value: "1000" + - name: PGID + value: "1000" + - name: TZ + value: Europe/Oslo + ports: + - name: web + containerPort: 7878 \ No newline at end of file diff --git a/apps/arr/radarr/kustomization.yaml b/apps/arr/radarr/kustomization.yaml new file mode 100644 index 0000000..893b06c --- /dev/null +++ b/apps/arr/radarr/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +commonLabels: + app: radarr + +resources: + - service.yaml + - deployment.yaml \ No newline at end of file diff --git a/apps/arr/radarr/service.yaml b/apps/arr/radarr/service.yaml new file mode 100644 index 0000000..7ab1d5e --- /dev/null +++ b/apps/arr/radarr/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + namespace: arr + name: radarr +spec: + type: LoadBalancer + ports: + - name: web + port: 7878 + selector: + app: radarr \ No newline at end of file diff --git a/apps/arr/sonarr/deployment.yaml b/apps/arr/sonarr/deployment.yaml new file mode 100644 index 0000000..f46eedd --- /dev/null +++ b/apps/arr/sonarr/deployment.yaml @@ -0,0 +1,42 @@ +kind: Deployment +apiVersion: apps/v1 +metadata: + namespace: arr + name: sonarr + labels: + app: sonarr +spec: + replicas: 1 + selector: + matchLabels: + app: sonarr + template: + metadata: + labels: + app: sonarr + spec: + volumes: + - name: sonarr-config + hostPath: + path: "/mnt/sdb1/homelab/config/sonarr" + - name: media-data + hostPath: + path: "/mnt/sdb1/data" + containers: + - name: sonarr + image: lscr.io/linuxserver/sonarr + volumeMounts: + - mountPath: "/config" + name: sonarr-config + - mountPath: "/app/data" + name: media-data + env: + - name: PUID + value: "1000" + - name: PGID + value: "1000" + - name: TZ + value: Europe/Oslo + ports: + - name: web + containerPort: 8989 \ No newline at end of file diff --git a/apps/arr/sonarr/kustomization.yaml b/apps/arr/sonarr/kustomization.yaml new file mode 100644 index 0000000..f001c48 --- /dev/null +++ b/apps/arr/sonarr/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +commonLabels: + app: sonarr + +resources: + - service.yaml + - deployment.yaml \ No newline at end of file diff --git a/apps/arr/sonarr/service.yaml b/apps/arr/sonarr/service.yaml new file mode 100644 index 0000000..d522062 --- /dev/null +++ b/apps/arr/sonarr/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + namespace: arr + name: sonarr +spec: + type: LoadBalancer + ports: + - name: web + port: 8989 + selector: + app: sonarr \ No newline at end of file diff --git a/apps/arr/traefik-forward-auth/configs/traefik-forward-auth.ini b/apps/arr/traefik-forward-auth/configs/traefik-forward-auth.ini new file mode 100644 index 0000000..ea61e81 --- /dev/null +++ b/apps/arr/traefik-forward-auth/configs/traefik-forward-auth.ini @@ -0,0 +1,5 @@ +cookie-name = "_arr_auth" +log-level = "error" +cookie-domain = "stonegarden.dev" +auth-host = "auth-arr.stonegarden.dev" +whitelist = "veghag@gmail.com" \ No newline at end of file diff --git a/apps/arr/traefik-forward-auth/deployment.yaml b/apps/arr/traefik-forward-auth/deployment.yaml new file mode 100644 index 0000000..5f8e92c --- /dev/null +++ b/apps/arr/traefik-forward-auth/deployment.yaml @@ -0,0 +1,55 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: traefik-forward-auth + labels: + app: traefik-forward-auth +spec: + replicas: 1 + selector: + matchLabels: + app: traefik-forward-auth + strategy: + type: Recreate + template: + metadata: + labels: + app: traefik-forward-auth + spec: + terminationGracePeriodSeconds: 60 + containers: + - image: thomseddon/traefik-forward-auth:2 + name: traefik-forward-auth + ports: + - containerPort: 4181 + protocol: TCP + env: + - name: CONFIG + value: "/config" + - name: PROVIDERS_GOOGLE_CLIENT_ID + valueFrom: + secretKeyRef: + name: traefik-forward-auth-secrets + key: google-client-id + - name: PROVIDERS_GOOGLE_CLIENT_SECRET + valueFrom: + secretKeyRef: + name: traefik-forward-auth-secrets + key: google-client-secret + - name: SECRET + valueFrom: + secretKeyRef: + name: traefik-forward-auth-secrets + key: secret + volumeMounts: + - name: configs + mountPath: /config + subPath: traefik-forward-auth.ini + + volumes: + - name: configs + configMap: + name: configs + - name: traefik-forward-auth-secrets + secret: + secretName: traefik-forward-auth-secrets \ No newline at end of file diff --git a/apps/arr/traefik-forward-auth/kustomization.yaml b/apps/arr/traefik-forward-auth/kustomization.yaml new file mode 100644 index 0000000..e1b2359 --- /dev/null +++ b/apps/arr/traefik-forward-auth/kustomization.yaml @@ -0,0 +1,25 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +commonLabels: + app: traefik-forward-auth + +resources: + - deployment.yaml + - service.yaml + - middleware.yaml + +# +# Configs +# +configMapGenerator: + - name: configs + files: + - configs/traefik-forward-auth.ini + +# +# Secrets +# +secretGenerator: + - name: traefik-forward-auth-secrets + envs: + - secrets/traefik-forward-auth.env \ No newline at end of file diff --git a/apps/arr/traefik-forward-auth/middleware.yaml b/apps/arr/traefik-forward-auth/middleware.yaml new file mode 100644 index 0000000..2531a15 --- /dev/null +++ b/apps/arr/traefik-forward-auth/middleware.yaml @@ -0,0 +1,10 @@ +apiVersion: traefik.containo.us/v1alpha1 +kind: Middleware +metadata: + name: traefik-forward-auth +spec: + forwardAuth: + address: http://traefik-forward-auth.arr.svc.cluster.local:4181 + authResponseHeaders: + - X-Forwarded-User + trustForwardHeader: true \ No newline at end of file diff --git a/apps/arr/traefik-forward-auth/service.yaml b/apps/arr/traefik-forward-auth/service.yaml new file mode 100644 index 0000000..18dc8ea --- /dev/null +++ b/apps/arr/traefik-forward-auth/service.yaml @@ -0,0 +1,16 @@ +# +# Auth Service +# +apiVersion: v1 +kind: Service +metadata: + name: traefik-forward-auth + labels: + app: traefik-forward-auth +spec: + type: ClusterIP + selector: + app: traefik-forward-auth + ports: + - name: auth-http + port: 4181 diff --git a/apps/plex/00-plex.yaml b/apps/plex/00-plex.yaml deleted file mode 100644 index 0d5d287..0000000 --- a/apps/plex/00-plex.yaml +++ /dev/null @@ -1,227 +0,0 @@ ---- -## Namespace -apiVersion: v1 -kind: Namespace -metadata: - name: plex - labels: - name: plex - ---- -### StorageClass for config -#apiVersion: storage.k8s.io/v1 -#kind: StorageClass -#metadata: -# name: plex-config -#provisioner: kubernetes.io/no-provisioner -#volumeBindingMode: WaitForFirstConsumer -#--- -### Config -#apiVersion: v1 -#kind: PersistentVolume -#metadata: -# name: plex-config-pv -#spec: -# capacity: -# storage: 2Gi -# volumeMode: Filesystem -# accessModes: -# - ReadWriteOnce -# persistentVolumeReclaimPolicy: Retain -# storageClassName: plex-config -# local: -# path: "/mnt/sdb1/homelab/config/plex" -# nodeAffinity: -# required: -# nodeSelectorTerms: -# - matchExpressions: -# - key: kubernetes.io/hostname -# operator: In -# values: -# - ratatoskr -#--- -### Persistent Volume Claim for config -#apiVersion: v1 -#kind: PersistentVolumeClaim -#metadata: -# name: plex-config -#spec: -# storageClassName: plex-config -# accessModes: -# - ReadWriteOnce -# resources: -# requests: -# storage: 2Gi -#--- -### StorageClass for media-data -#apiVersion: storage.k8s.io/v1 -#kind: StorageClass -#metadata: -# name: media-data -#provisioner: kubernetes.io/no-provisioner -#volumeBindingMode: WaitForFirstConsumer -#--- -### PersistentVolume for media-data -#apiVersion: v1 -#kind: PersistentVolume -#metadata: -# name: media-data-pv -#spec: -# capacity: -# storage: 1.8Ti -# volumeMode: Filesystem -# accessModes: -# - ReadWriteOnce -# persistentVolumeReclaimPolicy: Retain -# storageClassName: media-data -# local: -# path: "/mnt/sdb1/data" -# nodeAffinity: -# required: -# nodeSelectorTerms: -# - matchExpressions: -# - key: kubernetes.io/hostname -# operator: In -# values: -# - ratatoskr -#--- -### Persistent Volume Claim for media-data -#apiVersion: v1 -#kind: PersistentVolumeClaim -#metadata: -# name: media-data -#spec: -# storageClassName: media-data -# accessModes: -# - ReadWriteOnce -# resources: -# requests: -# storage: 1.8Ti ---- -## Service for exposing Plex -apiVersion: v1 -kind: Service -metadata: - namespace: plex - name: plex -spec: - type: LoadBalancer - ports: - - name: web - port: 32400 - - name: a - port: 1900 - protocol: UDP - - name: b - port: 3005 - - name: c - port: 8324 - - name: d - port: 32410 - protocol: UDP - - name: e - port: 32412 - protocol: UDP - - name: f - port: 32413 - protocol: UDP - - name: g - port: 32414 - protocol: UDP - - name: h - port: 32469 - selector: - app: plex ---- -## Deployment for Plex -kind: Deployment -apiVersion: apps/v1 -metadata: - namespace: plex - name: plex - labels: - app: plex -spec: - replicas: 1 - selector: - matchLabels: - app: plex - template: - metadata: - labels: - app: plex - spec: - volumes: - - name: plex-config - hostPath: - path: "/mnt/sdb1/homelab/config/plex" - - name: media-data - hostPath: - path: "/mnt/sdb1/data" - #- name: plex-config-pv - # persistentVolumeClaim: - # claimName: plex-config - #- name: media-data-pv - # persistentVolumeClaim: - # claimName: media-data - containers: - - name: plex - image: lscr.io/linuxserver/plex - volumeMounts: - - mountPath: "/config" - name: plex-config - - mountPath: "/app/data" - name: media-data - #- mountPath: "/config" - # name: plex-config-pv - #- mountPath: "/app/data" - # name: media-data-pv - env: - - name: PUID - value: "1000" - - name: PGID - value: "1000" - - name: TZ - value: Europe/Oslo - ports: - - name: web - containerPort: 32400 - - name: a - containerPort: 1900 - protocol: UDP - - name: b - containerPort: 3005 - - name: c - containerPort: 8324 - - name: d - containerPort: 32410 - protocol: UDP - - name: e - containerPort: 32412 - protocol: UDP - - name: f - containerPort: 32413 - protocol: UDP - - name: g - containerPort: 32414 - protocol: UDP - - name: h - containerPort: 32469 ---- -## IngressRoute for Plex -apiVersion: traefik.containo.us/v1alpha1 -kind: IngressRoute -metadata: - name: ingressroute-plex - namespace: plex -spec: - entryPoints: - - websecure - routes: - - match: Host(`plex.stonegarden.dev`) - kind: Rule - services: - - name: plex - port: 32400 - tls: - certResolver: letsencrypt diff --git a/apps/plex/deployment.yaml b/apps/plex/deployment.yaml new file mode 100644 index 0000000..99a6503 --- /dev/null +++ b/apps/plex/deployment.yaml @@ -0,0 +1,73 @@ +kind: Deployment +apiVersion: apps/v1 +metadata: + namespace: plex + name: plex + labels: + app: plex +spec: + replicas: 1 + selector: + matchLabels: + app: plex + template: + metadata: + labels: + app: plex + spec: + volumes: + - name: plex-config + hostPath: + path: "/mnt/sdb1/homelab/config/plex" + - name: media-data + hostPath: + path: "/mnt/sdb1/data" + #- name: plex-config-pv + # persistentVolumeClaim: + # claimName: plex-config + #- name: media-data-pv + # persistentVolumeClaim: + # claimName: media-data + containers: + - name: plex + image: lscr.io/linuxserver/plex + volumeMounts: + - mountPath: "/config" + name: plex-config + - mountPath: "/app/data" + name: media-data + #- mountPath: "/config" + # name: plex-config-pv + #- mountPath: "/app/data" + # name: media-data-pv + env: + - name: PUID + value: "1000" + - name: PGID + value: "1000" + - name: TZ + value: Europe/Oslo + ports: + - name: web + containerPort: 32400 + - name: a + containerPort: 1900 + protocol: UDP + - name: b + containerPort: 3005 + - name: c + containerPort: 8324 + - name: d + containerPort: 32410 + protocol: UDP + - name: e + containerPort: 32412 + protocol: UDP + - name: f + containerPort: 32413 + protocol: UDP + - name: g + containerPort: 32414 + protocol: UDP + - name: h + containerPort: 32469 \ No newline at end of file diff --git a/apps/plex/ingress.yaml b/apps/plex/ingress.yaml new file mode 100644 index 0000000..c264643 --- /dev/null +++ b/apps/plex/ingress.yaml @@ -0,0 +1,16 @@ +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + name: ingressroute-plex + namespace: plex +spec: + entryPoints: + - websecure + routes: + - match: Host(`plex.stonegarden.dev`) + kind: Rule + services: + - name: plex + port: 32400 + tls: + certResolver: letsencrypt \ No newline at end of file diff --git a/apps/plex/kustomization.yaml b/apps/plex/kustomization.yaml new file mode 100644 index 0000000..d335937 --- /dev/null +++ b/apps/plex/kustomization.yaml @@ -0,0 +1,11 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: arr + +resources: + - namespace.yaml +# - pv.yaml +# - pvc.yaml + - service.yaml + - deployment.yaml + - ingress.yaml diff --git a/apps/plex/namespace.yaml b/apps/plex/namespace.yaml new file mode 100644 index 0000000..0a7b854 --- /dev/null +++ b/apps/plex/namespace.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: plex + labels: + name: plex \ No newline at end of file diff --git a/apps/plex/pv.yaml b/apps/plex/pv.yaml new file mode 100644 index 0000000..2d6f420 --- /dev/null +++ b/apps/plex/pv.yaml @@ -0,0 +1,45 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: plex-config-pv +spec: + capacity: + storage: 2Gi + volumeMode: Filesystem + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + storageClassName: plex-config + local: + path: "/mnt/sdb1/homelab/config/plex" + nodeAffinity: + required: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/hostname + operator: In + values: + - ratatoskr +--- +apiVersion: v1 +kind: PersistentVolume +metadata: + name: media-data-pv +spec: + capacity: + storage: 1.8Ti + volumeMode: Filesystem + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + storageClassName: media-data + local: + path: "/mnt/sdb1/data" + nodeAffinity: + required: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/hostname + operator: In + values: + - ratatoskr \ No newline at end of file diff --git a/apps/plex/pvc.yaml b/apps/plex/pvc.yaml new file mode 100644 index 0000000..f34902c --- /dev/null +++ b/apps/plex/pvc.yaml @@ -0,0 +1,23 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: plex-config +spec: + storageClassName: plex-config + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 2Gi +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: media-data +spec: + storageClassName: media-data + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1.8Ti \ No newline at end of file diff --git a/apps/plex/sc.yaml b/apps/plex/sc.yaml new file mode 100644 index 0000000..04a4c43 --- /dev/null +++ b/apps/plex/sc.yaml @@ -0,0 +1,13 @@ +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: plex-config +provisioner: kubernetes.io/no-provisioner +volumeBindingMode: WaitForFirstConsumer +--- +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: media-data +provisioner: kubernetes.io/no-provisioner +volumeBindingMode: WaitForFirstConsumer \ No newline at end of file diff --git a/apps/plex/service.yaml b/apps/plex/service.yaml new file mode 100644 index 0000000..0ea169e --- /dev/null +++ b/apps/plex/service.yaml @@ -0,0 +1,33 @@ +apiVersion: v1 +kind: Service +metadata: + namespace: plex + name: plex +spec: + type: LoadBalancer + ports: + - name: web + port: 32400 + - name: a + port: 1900 + protocol: UDP + - name: b + port: 3005 + - name: c + port: 8324 + - name: d + port: 32410 + protocol: UDP + - name: e + port: 32412 + protocol: UDP + - name: f + port: 32413 + protocol: UDP + - name: g + port: 32414 + protocol: UDP + - name: h + port: 32469 + selector: + app: plex \ No newline at end of file diff --git a/apps/traefik-forward-auth/traefik-forward-auth/configs/traefik-forward-auth.ini b/apps/traefik-forward-auth/traefik-forward-auth/configs/traefik-forward-auth.ini index 3582bfd..0c48e1b 100644 --- a/apps/traefik-forward-auth/traefik-forward-auth/configs/traefik-forward-auth.ini +++ b/apps/traefik-forward-auth/traefik-forward-auth/configs/traefik-forward-auth.ini @@ -1,5 +1,5 @@ -cookie-name="_whoami_auth" -log-level="error" -cookie-domain="stonegarden.dev" -auth-host="auth.stonegarden.dev" -whitelist="veghag@gmail.com" \ No newline at end of file +cookie-name = "_whoami_auth" +log-level = "error" +cookie-domain = "stonegarden.dev" +auth-host = "auth.stonegarden.dev" +whitelist = "veghag@gmail.com" \ No newline at end of file