From 5208022354afe6be44bb0ed611ef32aae6e2e147 Mon Sep 17 00:00:00 2001 From: Tyler Perkins Date: Sat, 23 Nov 2024 14:56:59 -0500 Subject: [PATCH] Add plex --- cluster/plex/plex-deployment.yaml | 51 +++++++++++++++++++++++++++++++ cluster/plex/plex-media-pv.yaml | 13 ++++++++ cluster/plex/plex-media-pvc.yaml | 12 ++++++++ cluster/plex/plex-service.yaml | 46 ++++++++++++++++++++++++++++ 4 files changed, 122 insertions(+) create mode 100644 cluster/plex/plex-deployment.yaml create mode 100644 cluster/plex/plex-media-pv.yaml create mode 100644 cluster/plex/plex-media-pvc.yaml create mode 100644 cluster/plex/plex-service.yaml diff --git a/cluster/plex/plex-deployment.yaml b/cluster/plex/plex-deployment.yaml new file mode 100644 index 0000000..870c15b --- /dev/null +++ b/cluster/plex/plex-deployment.yaml @@ -0,0 +1,51 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: plex + namespace: default +spec: + replicas: 1 + selector: + matchLabels: + app: plex + template: + metadata: + labels: + app: plex + spec: + containers: + - name: plex + image: linuxserver/plex:latest + ports: + - containerPort: 32400 + protocol: TCP # Plex web UI + - containerPort: 32410 + protocol: UDP # DLNA discovery + - containerPort: 1900 + protocol: UDP # DLNA + - containerPort: 32412 + protocol: UDP # Plex DLNA additional + - containerPort: 32413 + protocol: UDP # Plex DLNA additional + - containerPort: 32414 + protocol: UDP # Plex DLNA additional + - containerPort: 3005 + protocol: TCP # Plex companion + - containerPort: 8324 + protocol: TCP # Plex GDM + - containerPort: 32469 + protocol: TCP # DLNA + volumeMounts: + - mountPath: /media + name: plex-media + env: + - name: PUID + value: "1000" # Adjust based on your Plex user ID + - name: PGID + value: "1000" # Adjust based on your Plex group ID + - name: TZ + value: "America/New_York" # Adjust based on your timezone + volumes: + - name: plex-media + persistentVolumeClaim: + claimName: plex-media-pvc diff --git a/cluster/plex/plex-media-pv.yaml b/cluster/plex/plex-media-pv.yaml new file mode 100644 index 0000000..0b63db7 --- /dev/null +++ b/cluster/plex/plex-media-pv.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: plex-media-pv + namespace: default +spec: + capacity: + storage: 8Ti + accessModes: + - ReadWriteMany + nfs: + path: /volume1/tank/media + server: 10.0.3.5 diff --git a/cluster/plex/plex-media-pvc.yaml b/cluster/plex/plex-media-pvc.yaml new file mode 100644 index 0000000..3290897 --- /dev/null +++ b/cluster/plex/plex-media-pvc.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: plex-media-pvc + namespace: default +spec: + accessModes: + - ReadWriteMany + storageClassName: "" + resources: + requests: + storage: 8Ti diff --git a/cluster/plex/plex-service.yaml b/cluster/plex/plex-service.yaml new file mode 100644 index 0000000..53a23dc --- /dev/null +++ b/cluster/plex/plex-service.yaml @@ -0,0 +1,46 @@ +apiVersion: v1 +kind: Service +metadata: + name: plex + namespace: default +spec: + selector: + app: plex + ports: + - protocol: TCP + port: 32400 + targetPort: 32400 + name: plex-ui + - protocol: UDP + port: 32410 + targetPort: 32410 + name: dlna-discovery + - protocol: UDP + port: 1900 + targetPort: 1900 + name: dlna + - protocol: UDP + port: 32412 + targetPort: 32412 + name: plex-dlna-additional-1 + - protocol: UDP + port: 32413 + targetPort: 32413 + name: plex-dlna-additional-2 + - protocol: UDP + port: 32414 + targetPort: 32414 + name: plex-dlna-additional-3 + - protocol: TCP + port: 3005 + targetPort: 3005 + name: plex-companion + - protocol: TCP + port: 8324 + targetPort: 8324 + name: plex-gdm + - protocol: TCP + port: 32469 + targetPort: 32469 + name: dlna-tcp + type: LoadBalancer