Merge pull request #639 from 3dwardch3ng/app/plex

using pms docker chart for plex
This commit is contained in:
2024-07-24 20:24:18 +10:00
committed by GitHub
8 changed files with 94 additions and 148 deletions

View File

@@ -1,93 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: plex
namespace: plex
labels:
app.kubernetes.io/name: plex
spec:
selector:
matchLabels:
app.kubernetes.io/name: plex
template:
metadata:
labels:
app.kubernetes.io/name: plex
spec:
securityContext:
runAsUser: 911
runAsGroup: 1000
containers:
- name: plex
image: lscr.io/linuxserver/plex:1.40.4
securityContext:
allowPrivilegeEscalation: true
env:
- name: PUID
value: "911"
- name: PGID
value: "1000"
- name: TZ
value: "Australia/Sydney"
- name: VERSION
value: docker
- name: PLEX_CLAIM
value: "claim-LHi5dG2J4DyqtFbETDpJ"
ports:
- protocol: TCP
containerPort: 80
name: http
- protocol: TCP
containerPort: 32400
name: plex
- protocol: UDP
containerPort: 1900
name: 1900-udp
- protocol: TCP
containerPort: 8324
name: 8324-tcp
- protocol: UDP
containerPort: 5353
name: 5353-udp
- protocol: UDP
containerPort: 32410
name: 32410-udp
- protocol: UDP
containerPort: 32412
name: 32412-udp
- protocol: UDP
containerPort: 32413
name: 32413-udp
- protocol: UDP
containerPort: 32414
name: 32414-udp
- protocol: TCP
containerPort: 32469
name: 32469-tcp
volumeMounts:
- name: plex-config
mountPath: /config
- name: plex-tv
mountPath: /tv
- name: plex-movie
mountPath: /movie
- name: plex-music
mountPath: /music
- name: plex-gv
mountPath: /gv
volumes:
- name: plex-config
hostPath:
path: /mnt/nfs/AppData/plex/config
- name: plex-tv
hostPath:
path: /mnt/nfs/AppData/plex/tv
- name: plex-movie
hostPath:
path: /mnt/nfs/AppData/plex/movie
- name: plex-music
hostPath:
path: /mnt/nfs/AppData/plex/music
- name: plex-gv
hostPath:
path: /mnt/nfs/AppData/plex/gv

View File

@@ -3,3 +3,12 @@ kind: Kustomization
resources: resources:
- ./deployment.yaml - ./deployment.yaml
- ./service.yaml - ./service.yaml
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
helmCharts:
- name: plex-media-server
repo: https://raw.githubusercontent.com/plexinc/pms-docker/gh-pages
version: 1.16.0
releaseName: plex-media-server
valuesFile: values.yaml

View File

@@ -1,21 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: plex
namespace: plex
labels:
app.kubernetes.io/name: plex
spec:
selector:
app.kubernetes.io/name: plex
type: ClusterIP
internalTrafficPolicy: Cluster
ports:
- protocol: TCP
port: 8899
targetPort: 80
name: http
- protocol: TCP
port: 32400
targetPort: 32400
name: plex

View File

@@ -0,0 +1,38 @@
ingress:
enabled: true
ingressClassName: nginx
url: plex.cluster.edward.sydney
pms:
storageClassName: local-path
existingClaim: plex-config-pvc
extraEnv:
PLEX_CLAIM: ""
TZ: "Australia/Sydney"
PLEX_UID: 1000
PLEX_GID: 1000
extraVolumeMounts:
- name: plex-tv
mountPath: /tv
- name: plex-movie
mountPath: /movie
- name: plex-music
mountPath: /music
- name: plex-gv
mountPath: /gv
extraVolumes:
- name: plex-tv
hostPath:
path: /mnt/nfs/AppData/plex/tv
type: Directory
- name: plex-movie
hostPath:
path: /mnt/nfs/AppData/plex/movie
type: Directory
- name: plex-music
hostPath:
path: /mnt/nfs/AppData/plex/music
type: Directory
- name: plex-gv
hostPath:
path: /mnt/nfs/AppData/plex/gv
type: Directory

View File

@@ -1,31 +0,0 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: plex-ingress
namespace: plex
annotations:
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/use-regex: "true"
spec:
ingressClassName: nginx
rules:
- host: "plex.cluster.edward.sydney"
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: plex
port:
number: 32400
- host: "plex-web.cluster.edward.sydney"
http:
paths:
- pathType: Prefix
path: "/"
backend:
service:
name: plex
port:
number: 8899

View File

@@ -2,4 +2,3 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization kind: Kustomization
resources: resources:
- ../../base - ../../base
- ./ingress.yaml

View File

@@ -0,0 +1,30 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: plex-config-pv
namespace: plex
labels:
type: local
spec:
storageClassName: local-path
volumeMode: Filesystem
capacity:
storage: 5Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
local:
path: "/mnt/nfs/AppData/plex/config"
claimRef:
apiVersion: v1
kind: PersistentVolumeClaim
name: plex-config-pvc
namespace: plex
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- arm64

View File

@@ -0,0 +1,15 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: plex-config-pvc
namespace: plex
labels:
name: plex-config-pvc
spec:
storageClassName: local-path
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi