deployment.yaml 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
  19. - name: extrappvolume-{{ $index }}
  20. mountPath: {{ $hostPathConfiguration.mountPath }}
  21. {{ end }}
  22. ports:
  23. - name: pms
  24. protocol: TCP
  25. containerPort: 32400
  26. {{- if .Values.hostNetwork }}
  27. hostPort: {{ .Values.plexServiceTCP.port }}
  28. {{- end }}
  29. - name: plex-dlna
  30. protocol: TCP
  31. containerPort: 32469
  32. - name: plex-dlna-udp
  33. protocol: UDP
  34. containerPort: 1900
  35. - name: plex-gdm1
  36. protocol: UDP
  37. containerPort: 32410
  38. - name: plex-gdm2
  39. protocol: UDP
  40. containerPort: 32412
  41. - name: plex-gdm3
  42. protocol: UDP
  43. containerPort: 32413
  44. - name: plex-gdm4
  45. protocol: UDP
  46. containerPort: 32414
  47. env:
  48. - name: KUBE_NAMESPACE
  49. valueFrom:
  50. fieldRef:
  51. fieldPath: metadata.namespace
  52. - name: POD_IP
  53. valueFrom:
  54. fieldRef:
  55. fieldPath: status.podIP
  56. {{ $envList := (default list .Values.environmentVariables) }}
  57. {{ if and .Values.gpuConfiguration (hasKey .Values.gpuConfiguration "nvidia.com/gpu") (gt (get .Values.gpuConfiguration "nvidia.com/gpu" | toDecimal) 0) }}
  58. {{ $envList = mustAppend $envList (dict "name" "NVIDIA_DRIVER_CAPABILITIES" "value" "all") }}
  59. {{ end }}
  60. {{ $envList = mustAppend $envList (dict "name" "TZ" "value" .Values.timezone) }}
  61. {{ $envList = mustAppend $envList (dict "name" "PLEX_CLAIM" "value" .Values.claimToken) }}
  62. {{ $envList = mustAppend $envList (dict "name" "PMS_INTERNAL_ADDRESS" "value" (printf "http://%s:32400" (include "common.names.fullname" .))) }}
  63. {{ $envList = mustAppend $envList (dict "name" "PMS_IMAGE" "value" (printf "%s:%s" .Values.image.repository .Values.image.tag))}}
  64. {{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 12 }}
  65. readinessProbe:
  66. exec:
  67. command:
  68. - /bin/plex_probe_check.sh
  69. failureThreshold: 5
  70. periodSeconds: 15
  71. livenessProbe:
  72. exec:
  73. command:
  74. - /bin/plex_probe_check.sh
  75. failureThreshold: 5
  76. periodSeconds: 15
  77. startupProbe:
  78. exec:
  79. command:
  80. - /bin/plex_probe_check.sh
  81. initialDelaySeconds: 5
  82. failureThreshold: 40
  83. periodSeconds: 15
  84. {{ include "common.networking.dnsConfiguration" .Values | nindent 6 }}
  85. volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }}
  86. - name: plex-probe-check
  87. configMap:
  88. defaultMode: 0700
  89. name: "plex-probe-check"
  90. {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
  91. - name: extrappvolume-{{ $index }}
  92. hostPath:
  93. path: {{ $hostPathConfiguration.hostPath }}
  94. {{ end }}