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.

222 lines
7.0 KiB

  1. apiVersion: apps/v1beta2
  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. livenessProbe:
  65. httpGet:
  66. path: /
  67. port: http
  68. initialDelaySeconds: 60
  69. readinessProbe:
  70. httpGet:
  71. path: /
  72. port: http
  73. initialDelaySeconds: 60
  74. volumeMounts:
  75. - name: nginxtemp
  76. mountPath: /nginxtemp
  77. - mountPath: /etc/nginx/conf.d
  78. name: nginx-proxyconf
  79. readOnly: true
  80. - name: peertubeassets
  81. mountPath: /assets
  82. readOnly: true
  83. - name: data
  84. mountPath: /data
  85. {{- end }}
  86. - name: {{ .Chart.Name }}
  87. image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
  88. imagePullPolicy: {{ .Values.image.pullPolicy }}
  89. {{- if .Values.nginxproxy.enabled }}
  90. {{- if .Values.ports.livePort }}
  91. ports:
  92. - name: live
  93. containerPort: {{ .Values.ports.livePort }}
  94. protocol: TCP
  95. {{- end }}
  96. livenessProbe:
  97. httpGet:
  98. path: /
  99. port: 9000
  100. initialDelaySeconds: 60
  101. readinessProbe:
  102. httpGet:
  103. path: /
  104. port: 9000
  105. initialDelaySeconds: 60
  106. {{- else }}
  107. ports:
  108. - name: http
  109. containerPort: {{ .Values.ports.peertubePort }}
  110. protocol: TCP
  111. {{- if .Values.ports.livePort }}
  112. - name: live
  113. containerPort: {{ .Values.ports.livePort }}
  114. protocol: TCP
  115. {{- end }}
  116. livenessProbe:
  117. httpGet:
  118. path: /
  119. port: http
  120. initialDelaySeconds: 60
  121. readinessProbe:
  122. httpGet:
  123. path: /
  124. port: http
  125. initialDelaySeconds: 60
  126. {{- end }}
  127. command:
  128. - gosu
  129. - peertube
  130. - npm
  131. - start
  132. env:
  133. - name: PEERTUBE_WEBSERVER_HOSTNAME
  134. value: {{ .Values.environment.hostname }}
  135. - name: PEERTUBE_WEBSERVER_PORT
  136. value: {{ .Values.environment.http | quote }}
  137. - name: PEERTUBE_WEBSERVER_HTTPS
  138. value: {{ .Values.environment.httpsEnabled | quote }}
  139. - name: PEERTUBE_DB_HOSTNAME
  140. value: {{ .Values.environment.dbHostname }}
  141. - name: PEERTUBE_DB_SUFFIX
  142. value: _prod
  143. - name: PEERTUBE_DB_USERNAME
  144. value: {{ .Values.environment.dbUser }}
  145. - name: PEERTUBE_DB_PASSWORD
  146. value: {{ .Values.environment.dbPassword }}
  147. - name: PEERTUBE_REDIS_HOSTNAME
  148. value: {{ .Release.Name }}-{{ .Values.environment.redisHostname }}-master
  149. - name: PEERTUBE_SMTP_USERNAME
  150. value: {{ .Values.environment.smtpUser | quote }}
  151. - name: PEERTUBE_SMTP_PASSWORD
  152. value: {{ .Values.environment.smtpPassword }}
  153. - name: PEERTUBE_SMTP_HOSTNAME
  154. value: {{ .Values.environment.smtpHostname }}
  155. - name: PEERTUBE_SMTP_PORT
  156. value: {{ .Values.environment.smtpPort | quote }}
  157. - name: PEERTUBE_SMTP_FROM
  158. value: {{ .Values.environment.smtpFrom | quote }}
  159. - name: PEERTUBE_SMTP_TLS
  160. value: {{ .Values.environment.smtpTls | quote }}
  161. - name: PEERTUBE_ADMIN_EMAIL
  162. value: {{ .Values.environment.admin | quote }}
  163. - name: PEERTUBE_TRANSCODING_ENABLED
  164. value: {{ .Values.environment.transcoding | quote }}
  165. volumeMounts:
  166. - name: data
  167. mountPath: /data
  168. - name: config
  169. mountPath: /config
  170. resources:
  171. {{ toYaml .Values.resources | indent 12 }}
  172. {{- with .Values.nodeSelector }}
  173. nodeSelector:
  174. {{ toYaml . | indent 8 }}
  175. {{- end }}
  176. {{- with .Values.affinity }}
  177. affinity:
  178. {{ toYaml . | indent 8 }}
  179. {{- end }}
  180. {{- with .Values.tolerations }}
  181. tolerations:
  182. {{ toYaml . | indent 8 }}
  183. {{- end }}
  184. volumes:
  185. {{- if .Values.persistence.data.enabled }}
  186. - name: data
  187. persistentVolumeClaim:
  188. claimName: {{ .Values.persistence.data.existingClaim }}
  189. {{- else }}
  190. - name: data
  191. emptyDir: {}
  192. {{- end }}
  193. {{- if .Values.persistence.config.enabled }}
  194. - name: config
  195. persistentVolumeClaim:
  196. claimName: {{ .Values.persistence.config.existingClaim }}
  197. {{- else }}
  198. - name: config
  199. emptyDir: {}
  200. {{- end }}
  201. {{- if .Values.nginxproxy.persistence.enabled }}
  202. - name: nginxtemp
  203. persistentVolumeClaim:
  204. claimName: {{ .Values.nginxproxy.persistence.existingClaim }}
  205. {{- else }}
  206. - name: nginxtemp
  207. emptyDir: {}
  208. {{- end }}
  209. - name: peertubeassets
  210. emptyDir: {}
  211. - configMap:
  212. defaultMode: 420
  213. name: nginx-proxyconf
  214. name: nginx-proxyconf
  215. - configMap:
  216. defaultMode: 420
  217. name: peertube-init
  218. name: peertube-init
  219. - configMap:
  220. defaultMode: 420
  221. name: peertube-chown
  222. name: peertube-chown