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.

215 lines
6.9 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.nginxproxy.service.port }}
  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. livenessProbe:
  91. httpGet:
  92. path: /
  93. port: 9000
  94. initialDelaySeconds: 60
  95. readinessProbe:
  96. httpGet:
  97. path: /
  98. port: 9000
  99. initialDelaySeconds: 60
  100. {{- else }}
  101. ports:
  102. - name: http
  103. containerPort: {{ .Values.service.port }}
  104. protocol: TCP
  105. livenessProbe:
  106. httpGet:
  107. path: /
  108. port: http
  109. initialDelaySeconds: 60
  110. readinessProbe:
  111. httpGet:
  112. path: /
  113. port: http
  114. initialDelaySeconds: 60
  115. {{- end }}
  116. command:
  117. - gosu
  118. - peertube
  119. - npm
  120. - start
  121. env:
  122. - name: PEERTUBE_WEBSERVER_HOSTNAME
  123. value: {{ .Values.environment.hostname }}
  124. - name: PEERTUBE_WEBSERVER_PORT
  125. value: {{ .Values.environment.http | quote }}
  126. - name: PEERTUBE_WEBSERVER_HTTPS
  127. value: {{ .Values.environment.httpsEnabled | quote }}
  128. - name: PEERTUBE_DB_HOSTNAME
  129. value: {{ .Values.environment.dbHostname }}
  130. - name: PEERTUBE_DB_SUFFIX
  131. value: _prod
  132. - name: PEERTUBE_DB_USERNAME
  133. value: {{ .Values.environment.dbUser }}
  134. - name: PEERTUBE_DB_PASSWORD
  135. value: {{ .Values.environment.dbPassword }}
  136. - name: PEERTUBE_REDIS_HOSTNAME
  137. value: {{ .Release.Name }}-{{ .Values.environment.redisHostname }}-master
  138. - name: PEERTUBE_SMTP_USERNAME
  139. value: {{ .Values.environment.smtpUser | quote }}
  140. - name: PEERTUBE_SMTP_PASSWORD
  141. value: {{ .Values.environment.smtpPassword }}
  142. - name: PEERTUBE_SMTP_HOSTNAME
  143. value: {{ .Values.environment.smtpHostname }}
  144. - name: PEERTUBE_SMTP_PORT
  145. value: {{ .Values.environment.smtpPort | quote }}
  146. - name: PEERTUBE_SMTP_FROM
  147. value: {{ .Values.environment.smtpFrom | quote }}
  148. - name: PEERTUBE_SMTP_TLS
  149. value: {{ .Values.environment.smtpTls | quote }}
  150. - name: PEERTUBE_ADMIN_EMAIL
  151. value: {{ .Values.environment.admin | quote }}
  152. - name: PEERTUBE_SIGNUP_ENABLED
  153. value: {{ .Values.environment.signup | quote }}
  154. - name: PEERTUBE_TRANSCODING_ENABLED
  155. value: {{ .Values.environment.transcoding | quote }}
  156. - name: PEERTUBE_TRUST_PROXY
  157. value: {{ .Values.environment.trustProxy | quote }}
  158. volumeMounts:
  159. - name: data
  160. mountPath: /data
  161. - name: config
  162. mountPath: /config
  163. resources:
  164. {{ toYaml .Values.resources | indent 12 }}
  165. {{- with .Values.nodeSelector }}
  166. nodeSelector:
  167. {{ toYaml . | indent 8 }}
  168. {{- end }}
  169. {{- with .Values.affinity }}
  170. affinity:
  171. {{ toYaml . | indent 8 }}
  172. {{- end }}
  173. {{- with .Values.tolerations }}
  174. tolerations:
  175. {{ toYaml . | indent 8 }}
  176. {{- end }}
  177. volumes:
  178. {{- if .Values.persistence.data.enabled }}
  179. - name: data
  180. persistentVolumeClaim:
  181. claimName: {{ .Values.persistence.data.existingClaim }}
  182. {{- else }}
  183. - name: data
  184. emptyDir: {}
  185. {{- end }}
  186. {{- if .Values.persistence.config.enabled }}
  187. - name: config
  188. persistentVolumeClaim:
  189. claimName: {{ .Values.persistence.config.existingClaim }}
  190. {{- else }}
  191. - name: config
  192. emptyDir: {}
  193. {{- end }}
  194. {{- if .Values.nginxproxy.persistence.enabled }}
  195. - name: nginxtemp
  196. persistentVolumeClaim:
  197. claimName: {{ .Values.nginxproxy.persistence.existingClaim }}
  198. {{- else }}
  199. - name: nginxtemp
  200. emptyDir: {}
  201. {{- end }}
  202. - name: peertubeassets
  203. emptyDir: {}
  204. - configMap:
  205. defaultMode: 420
  206. name: nginx-proxyconf
  207. name: nginx-proxyconf
  208. - configMap:
  209. defaultMode: 420
  210. name: peertube-init
  211. name: peertube-init
  212. - configMap:
  213. defaultMode: 420
  214. name: peertube-chown
  215. name: peertube-chown