plex.yaml 2.8 KB

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