Helm chart for deploying Peertube on kubernetes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

251 lines
7.8 KiB

  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: {{ template "peertube.fullname" . }}
  5. labels:
  6. app: {{ template "peertube.name" . }}
  7. chart: {{ template "peertube.chart" . }}
  8. release: {{ .Release.Name }}
  9. heritage: {{ .Release.Service }}
  10. spec:
  11. replicas: {{ .Values.replicaCount }}
  12. selector:
  13. matchLabels:
  14. app: {{ template "peertube.name" . }}
  15. release: {{ .Release.Name }}
  16. template:
  17. metadata:
  18. labels:
  19. app: {{ template "peertube.name" . }}
  20. release: {{ .Release.Name }}
  21. spec:
  22. initContainers:
  23. - name: peertube-init
  24. image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
  25. imagePullPolicy: {{ .Values.image.pullPolicy }}
  26. volumeMounts:
  27. - name: data
  28. mountPath: /data
  29. - name: config
  30. mountPath: /config
  31. - mountPath: /init
  32. name: peertube-init
  33. readOnly: true
  34. - name: peertubeassets
  35. mountPath: /assets
  36. command:
  37. - sh
  38. - /init/peertube-init.sh
  39. {{- if .Values.chowncontainer.enabled }}
  40. - name: peertube-chown
  41. image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
  42. imagePullPolicy: {{ .Values.image.pullPolicy }}
  43. volumeMounts:
  44. - name: data
  45. mountPath: /data
  46. - name: config
  47. mountPath: /config
  48. - mountPath: /init
  49. name: peertube-chown
  50. readOnly: true
  51. command:
  52. - sh
  53. - /init/peertube-chown.sh
  54. {{- end }}
  55. containers:
  56. {{- if .Values.nginxproxy.enabled }}
  57. - name: nginx-proxy
  58. image: "{{ .Values.nginxproxy.image.repository }}:{{ .Values.nginxproxy.image.tag }}"
  59. imagePullPolicy: {{ .Values.image.pullPolicy }}
  60. ports:
  61. - name: http
  62. containerPort: {{ .Values.ports.nginxproxyPort }}
  63. protocol: TCP
  64. startupProbe:
  65. httpGet:
  66. path: /
  67. port: http
  68. initialDelaySeconds: 300
  69. failureThreshold: 30
  70. periodSeconds: 10
  71. livenessProbe:
  72. httpGet:
  73. path: /
  74. port: http
  75. initialDelaySeconds: 60
  76. readinessProbe:
  77. httpGet:
  78. path: /
  79. port: http
  80. initialDelaySeconds: 60
  81. volumeMounts:
  82. - name: nginxtemp
  83. mountPath: /nginxtemp
  84. - mountPath: /etc/nginx/conf.d
  85. name: nginx-proxyconf
  86. readOnly: true
  87. - name: peertubeassets
  88. mountPath: /assets
  89. readOnly: true
  90. - name: data
  91. mountPath: /data
  92. {{- end }}
  93. - name: {{ .Chart.Name }}
  94. image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
  95. imagePullPolicy: {{ .Values.image.pullPolicy }}
  96. {{- if .Values.nginxproxy.enabled }}
  97. {{- if .Values.ports.livePort }}
  98. ports:
  99. - name: live
  100. containerPort: {{ .Values.ports.livePort }}
  101. protocol: TCP
  102. {{- end }}
  103. startupProbe:
  104. httpGet:
  105. path: /
  106. port: 9000
  107. initialDelaySeconds: 60
  108. failureThreshold: 3000
  109. periodSeconds: 10
  110. livenessProbe:
  111. httpGet:
  112. path: /
  113. port: 9000
  114. initialDelaySeconds: 600
  115. failureThreshold: 3
  116. periodSeconds: 10
  117. readinessProbe:
  118. httpGet:
  119. path: /
  120. port: 9000
  121. initialDelaySeconds: 300
  122. failureThreshold: 3
  123. periodSeconds: 10
  124. {{- else }}
  125. ports:
  126. - name: http
  127. containerPort: {{ .Values.ports.peertubePort }}
  128. protocol: TCP
  129. {{- if .Values.ports.livePort }}
  130. - name: live
  131. containerPort: {{ .Values.ports.livePort }}
  132. protocol: TCP
  133. {{- end }}
  134. startupProbe:
  135. httpGet:
  136. path: /
  137. port: 9000
  138. initialDelaySeconds: 60
  139. failureThreshold: 3000
  140. periodSeconds: 10
  141. livenessProbe:
  142. httpGet:
  143. path: /
  144. port: http
  145. initialDelaySeconds: 600
  146. failureThreshold: 3
  147. periodSeconds: 10
  148. readinessProbe:
  149. httpGet:
  150. path: /
  151. port: http
  152. initialDelaySeconds: 30
  153. failureThreshold: 3
  154. periodSeconds: 10
  155. {{- end }}
  156. command:
  157. - gosu
  158. - peertube
  159. - npm
  160. - start
  161. env:
  162. - name: PEERTUBE_WEBSERVER_HOSTNAME
  163. value: {{ .Values.environment.hostname }}
  164. - name: PEERTUBE_WEBSERVER_PORT
  165. value: {{ .Values.environment.http | quote }}
  166. - name: PEERTUBE_WEBSERVER_HTTPS
  167. value: {{ .Values.environment.httpsEnabled | quote }}
  168. - name: PEERTUBE_DB_HOSTNAME
  169. value: {{ .Values.environment.dbHostname }}
  170. - name: PEERTUBE_DB_USERNAME
  171. value: {{ .Values.environment.dbUser }}
  172. - name: PEERTUBE_DB_PASSWORD
  173. value: {{ .Values.environment.dbPassword }}
  174. - name: PEERTUBE_REDIS_HOSTNAME
  175. value: {{ .Values.environment.redisHostname }}
  176. - name: PEERTUBE_REDIS_AUTH
  177. value: {{ .Values.environment.redisAuth }}
  178. - name: PEERTUBE_SMTP_USERNAME
  179. value: {{ .Values.environment.smtpUser | quote }}
  180. - name: PEERTUBE_SMTP_PASSWORD
  181. value: {{ .Values.environment.smtpPassword }}
  182. - name: PEERTUBE_SMTP_HOSTNAME
  183. value: {{ .Values.environment.smtpHostname }}
  184. - name: PEERTUBE_SMTP_PORT
  185. value: {{ .Values.environment.smtpPort | quote }}
  186. - name: PEERTUBE_SMTP_FROM
  187. value: {{ .Values.environment.smtpFrom | quote }}
  188. - name: PEERTUBE_SMTP_TLS
  189. value: {{ .Values.environment.smtpTls | quote }}
  190. - name: PEERTUBE_ADMIN_EMAIL
  191. value: {{ .Values.environment.admin | quote }}
  192. - name: PEERTUBE_TRANSCODING_ENABLED
  193. value: {{ .Values.environment.transcoding | quote }}
  194. volumeMounts:
  195. - name: data
  196. mountPath: /data
  197. - name: config
  198. mountPath: /config
  199. resources:
  200. {{ toYaml .Values.resources | indent 12 }}
  201. {{- with .Values.nodeSelector }}
  202. nodeSelector:
  203. {{ toYaml . | indent 8 }}
  204. {{- end }}
  205. {{- with .Values.affinity }}
  206. affinity:
  207. {{ toYaml . | indent 8 }}
  208. {{- end }}
  209. {{- with .Values.tolerations }}
  210. tolerations:
  211. {{ toYaml . | indent 8 }}
  212. {{- end }}
  213. volumes:
  214. {{- if .Values.persistence.data.enabled }}
  215. - name: data
  216. persistentVolumeClaim:
  217. claimName: {{ .Values.persistence.data.existingClaim }}
  218. {{- else }}
  219. - name: data
  220. emptyDir: {}
  221. {{- end }}
  222. {{- if .Values.persistence.config.enabled }}
  223. - name: config
  224. persistentVolumeClaim:
  225. claimName: {{ .Values.persistence.config.existingClaim }}
  226. {{- else }}
  227. - name: config
  228. emptyDir: {}
  229. {{- end }}
  230. {{- if .Values.nginxproxy.persistence.enabled }}
  231. - name: nginxtemp
  232. persistentVolumeClaim:
  233. claimName: {{ .Values.nginxproxy.persistence.existingClaim }}
  234. {{- else }}
  235. - name: nginxtemp
  236. emptyDir: {}
  237. {{- end }}
  238. - name: peertubeassets
  239. emptyDir: {}
  240. - configMap:
  241. defaultMode: 420
  242. name: nginx-proxyconf
  243. name: nginx-proxyconf
  244. - configMap:
  245. defaultMode: 420
  246. name: peertube-init
  247. name: peertube-init
  248. - configMap:
  249. defaultMode: 420
  250. name: peertube-chown
  251. name: peertube-chown