deployment.yaml 4.3 KB

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