deployment.yaml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. {{- else }}
  41. hostPort: null
  42. {{- end }}
  43. - name: plex-dlna
  44. protocol: TCP
  45. containerPort: 32469
  46. {{- if not .Values.hostNetwork }}
  47. hostPort: null
  48. {{- end }}
  49. - name: plex-dlna-udp
  50. protocol: UDP
  51. containerPort: 1900
  52. {{- if not .Values.hostNetwork }}
  53. hostPort: null
  54. {{- end }}
  55. - name: plex-gdm1
  56. protocol: UDP
  57. containerPort: 32410
  58. {{- if not .Values.hostNetwork }}
  59. hostPort: null
  60. {{- end }}
  61. - name: plex-gdm2
  62. protocol: UDP
  63. containerPort: 32412
  64. {{- if not .Values.hostNetwork }}
  65. hostPort: null
  66. {{- end }}
  67. - name: plex-gdm3
  68. protocol: UDP
  69. containerPort: 32413
  70. {{- if not .Values.hostNetwork }}
  71. hostPort: null
  72. {{- end }}
  73. - name: plex-gdm4
  74. protocol: UDP
  75. containerPort: 32414
  76. {{- if not .Values.hostNetwork }}
  77. hostPort: null
  78. {{- end }}
  79. env:
  80. - name: KUBE_NAMESPACE
  81. valueFrom:
  82. fieldRef:
  83. fieldPath: metadata.namespace
  84. - name: POD_IP
  85. valueFrom:
  86. fieldRef:
  87. fieldPath: status.podIP
  88. {{ $envList := (default list .Values.environmentVariables) }}
  89. {{ if and .Values.gpuConfiguration (hasKey .Values.gpuConfiguration "nvidia.com/gpu") (gt (get .Values.gpuConfiguration "nvidia.com/gpu" | toDecimal) 0) }}
  90. {{ $envList = mustAppend $envList (dict "name" "NVIDIA_DRIVER_CAPABILITIES" "value" "all") }}
  91. {{ end }}
  92. {{ $envList = mustAppend $envList (dict "name" "TZ" "value" .Values.timezone) }}
  93. {{ $envList = mustAppend $envList (dict "name" "PLEX_CLAIM" "value" .Values.claimToken) }}
  94. {{ $envList = mustAppend $envList (dict "name" "PMS_INTERNAL_ADDRESS" "value" (printf "http://%s:32400" (include "common.names.fullname" .))) }}
  95. {{ $envList = mustAppend $envList (dict "name" "PMS_IMAGE" "value" (printf "%s:%s" .Values.image.repository .Values.image.tag))}}
  96. {{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 12 }}
  97. readinessProbe:
  98. tcpSocket:
  99. port: 32400
  100. initialDelaySeconds: 10
  101. periodSeconds: 10
  102. timeoutSeconds: 5
  103. failureThreshold: 5
  104. successThreshold: 2
  105. livenessProbe:
  106. tcpSocket:
  107. port: 32400
  108. initialDelaySeconds: 10
  109. periodSeconds: 10
  110. timeoutSeconds: 5
  111. failureThreshold: 5
  112. successThreshold: 1
  113. startupProbe:
  114. tcpSocket:
  115. port: 32400
  116. initialDelaySeconds: 10
  117. periodSeconds: 5
  118. timeoutSeconds: 2
  119. failureThreshold: 60
  120. successThreshold: 1
  121. {{ include "common.networking.dnsConfiguration" .Values | nindent 6 }}
  122. volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }}
  123. {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
  124. - name: extrappvolume-{{ $index }}
  125. hostPath:
  126. path: {{ $hostPathConfiguration.hostPath }}
  127. {{ end }}