deployment.yaml 4.4 KB

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