deployment.yaml 4.3 KB

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