deployment.yaml 4.6 KB

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