deployment.yaml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. {{ include "common.deployment.common_config" . | nindent 0 }}
  2. spec: {{ include "common.deployment.common_spec" . | nindent 2 }}
  3. template: {{ include "common.deployment.pod.metadata" . | nindent 4 }}
  4. spec:
  5. {{- if .Values.hostNetwork }}
  6. hostNetwork: {{ .Values.hostNetwork }}
  7. dnsPolicy: ClusterFirstWithHostNet
  8. {{- end }}
  9. containers:
  10. - name: {{ .Chart.Name }}
  11. {{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
  12. {{ include "common.containers.gpuConfiguration" .Values | nindent 10 }}
  13. volumeMounts: {{ include "common.storage.configureAppVolumeMountsInContainer" .Values | nindent 12 }}
  14. - name: plex-probe-check
  15. mountPath: /bin/plex_probe_check.sh
  16. readOnly: true
  17. subPath: entrypoint.sh
  18. ports:
  19. - name: pms
  20. protocol: TCP
  21. containerPort: 32400
  22. {{- if .Values.hostNetwork }}
  23. hostPort: {{ .Values.plexServiceTCP.port }}
  24. {{- end }}
  25. - name: plex-dlna
  26. protocol: TCP
  27. containerPort: 32469
  28. - name: plex-dlna-udp
  29. protocol: UDP
  30. containerPort: 1900
  31. - name: plex-gdm1
  32. protocol: UDP
  33. containerPort: 32410
  34. - name: plex-gdm2
  35. protocol: UDP
  36. containerPort: 32412
  37. - name: plex-gdm3
  38. protocol: UDP
  39. containerPort: 32413
  40. - name: plex-gdm4
  41. protocol: UDP
  42. containerPort: 32414
  43. env:
  44. - name: KUBE_NAMESPACE
  45. valueFrom:
  46. fieldRef:
  47. fieldPath: metadata.namespace
  48. - name: POD_IP
  49. valueFrom:
  50. fieldRef:
  51. fieldPath: status.podIP
  52. {{ $envList := (default list .Values.environmentVariables) }}
  53. {{ if and .Values.gpuConfiguration (hasKey .Values.gpuConfiguration "nvidia.com/gpu") (gt (get .Values.gpuConfiguration "nvidia.com/gpu" | toDecimal) 0) }}
  54. {{ $envList = mustAppend $envList (dict "name" "NVIDIA_DRIVER_CAPABILITIES" "value" "all") }}
  55. {{ end }}
  56. {{ $envList = mustAppend $envList (dict "name" "TZ" "value" .Values.timezone) }}
  57. {{ $envList = mustAppend $envList (dict "name" "PLEX_CLAIM" "value" .Values.claimToken) }}
  58. {{ $envList = mustAppend $envList (dict "name" "PMS_INTERNAL_ADDRESS" "value" (printf "http://%s:32400" (include "common.names.fullname" .))) }}
  59. {{ $envList = mustAppend $envList (dict "name" "PMS_IMAGE" "value" (printf "%s:%s" .Values.image.repository .Values.image.tag))}}
  60. {{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 12 }}
  61. readinessProbe:
  62. exec:
  63. command:
  64. - /bin/plex_probe_check.sh
  65. failureThreshold: 5
  66. periodSeconds: 15
  67. livenessProbe:
  68. exec:
  69. command:
  70. - /bin/plex_probe_check.sh
  71. failureThreshold: 5
  72. periodSeconds: 15
  73. startupProbe:
  74. exec:
  75. command:
  76. - /bin/plex_probe_check.sh
  77. initialDelaySeconds: 5
  78. failureThreshold: 40
  79. periodSeconds: 15
  80. volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }}
  81. - name: plex-probe-check
  82. configMap:
  83. defaultMode: 0700
  84. name: "plex-probe-check"