plex.yaml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. ---
  2. apiVersion: v1
  3. kind: Namespace
  4. metadata:
  5. name: plex
  6. ---
  7. apiVersion: apps/v1
  8. kind: Deployment
  9. metadata:
  10. name: plex
  11. namespace: plex
  12. spec:
  13. strategy:
  14. type: Recreate
  15. selector:
  16. matchLabels:
  17. app: plex
  18. replicas: 1
  19. template:
  20. metadata:
  21. labels:
  22. app: plex
  23. annotations:
  24. backup.velero.io/backup-volumes-excludes: media,media-metadata,tmpfs
  25. spec:
  26. containers:
  27. - name: plex
  28. image: linuxserver/plex:latest
  29. imagePullPolicy: Always
  30. # for debugging
  31. # command: ["/bin/sh"]
  32. # args: ["-c", "sleep 3600"]
  33. ports:
  34. - containerPort: 32400
  35. name: http-web-svc
  36. volumeMounts:
  37. - mountPath: "/config"
  38. name: config
  39. - mountPath: "/config/Library/Application Support/Plex Media Server/Media"
  40. name: media-metadata
  41. - mountPath: "/media"
  42. name: media
  43. - mountPath: "/transcodes"
  44. name: tmpfs
  45. # Quicksync
  46. - name: "render-device"
  47. mountPath: "/dev/dri/renderD128"
  48. env:
  49. - name: PUID
  50. value: "1000"
  51. - name: PGID
  52. value: "1000"
  53. ## NVIDIA
  54. #- name: NVIDIA_DRIVER_CAPABILITIES
  55. # value: "all"
  56. # Quicksync
  57. securityContext:
  58. privileged: true
  59. livenessProbe:
  60. httpGet:
  61. path: /web/index.html
  62. port: 32400
  63. failureThreshold: 5
  64. initialDelaySeconds: 10
  65. periodSeconds: 30
  66. timeoutSeconds: 10
  67. ## NVIDIA
  68. #resources:
  69. # limits:
  70. # nvidia.com/gpu: 1
  71. affinity:
  72. nodeAffinity:
  73. requiredDuringSchedulingIgnoredDuringExecution:
  74. nodeSelectorTerms:
  75. - matchExpressions:
  76. - key: gpu-node
  77. operator: In
  78. values:
  79. - "true"
  80. volumes:
  81. - name: config
  82. persistentVolumeClaim:
  83. claimName: plex-config-pvc
  84. - name: media-metadata
  85. persistentVolumeClaim:
  86. claimName: plex-metadata-pvc
  87. - name: media
  88. persistentVolumeClaim:
  89. claimName: plex-pvc
  90. readOnly: true
  91. - name: tmpfs
  92. emptyDir:
  93. medium: Memory
  94. sizeLimit: 12Gi
  95. # Quicksync
  96. - name: "render-device"
  97. hostPath:
  98. path: "/dev/dri/renderD128"
  99. ---
  100. apiVersion: v1
  101. kind: Service
  102. metadata:
  103. name: plex-service
  104. namespace: plex
  105. spec:
  106. selector:
  107. app: plex
  108. type: ClusterIP
  109. ports:
  110. - name: plex-web-port
  111. protocol: TCP
  112. port: 32400
  113. targetPort: http-web-svc
  114. ---
  115. apiVersion: traefik.containo.us/v1alpha1
  116. kind: IngressRoute
  117. metadata:
  118. name: plex
  119. namespace: plex
  120. spec:
  121. entryPoints:
  122. - websecure
  123. routes:
  124. - kind: Rule
  125. match: Host(`plex.jibby.org`)
  126. services:
  127. - kind: Service
  128. name: plex-service
  129. port: 32400