deployment.yaml 4.5 KB

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