deployment.yaml 4.4 KB

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