plex.yaml 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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,transcodes
  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: transcodes
  45. # Quicksync
  46. - name: "render-device"
  47. mountPath: "/dev/dri/renderD128"
  48. # Quicksync
  49. securityContext:
  50. privileged: true
  51. env:
  52. - name: PUID
  53. value: "1000"
  54. - name: PGID
  55. value: "1000"
  56. livenessProbe:
  57. httpGet:
  58. path: /web/index.html
  59. port: 32400
  60. failureThreshold: 5
  61. initialDelaySeconds: 10
  62. periodSeconds: 30
  63. timeoutSeconds: 10
  64. resources:
  65. limits:
  66. ephemeral-storage: "10Gi"
  67. affinity:
  68. nodeAffinity:
  69. requiredDuringSchedulingIgnoredDuringExecution:
  70. nodeSelectorTerms:
  71. - matchExpressions:
  72. - key: gpu-node
  73. operator: In
  74. values:
  75. - "true"
  76. volumes:
  77. - name: config
  78. persistentVolumeClaim:
  79. claimName: plex-config-pvc
  80. - name: media-metadata
  81. persistentVolumeClaim:
  82. claimName: plex-metadata-pvc
  83. - name: media
  84. persistentVolumeClaim:
  85. claimName: plex-pvc
  86. readOnly: true
  87. - name: transcodes
  88. emptyDir: {}
  89. # Quicksync
  90. - name: "render-device"
  91. hostPath:
  92. path: "/dev/dri/renderD128"
  93. ---
  94. apiVersion: v1
  95. kind: Service
  96. metadata:
  97. name: plex-service
  98. namespace: plex
  99. spec:
  100. selector:
  101. app: plex
  102. type: ClusterIP
  103. ports:
  104. - name: plex-web-port
  105. protocol: TCP
  106. port: 32400
  107. targetPort: http-web-svc
  108. ---
  109. apiVersion: networking.k8s.io/v1
  110. kind: Ingress
  111. metadata:
  112. name: plex
  113. namespace: plex
  114. annotations:
  115. traefik.ingress.kubernetes.io/router.entrypoints: websecure
  116. spec:
  117. rules:
  118. - host: plex.jibby.org
  119. http:
  120. paths:
  121. - path: /
  122. pathType: Prefix
  123. backend:
  124. service:
  125. name: plex-service
  126. port:
  127. number: 32400