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.

136 lines
4.5 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: initPeertube
  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. command:
  35. - sh
  36. - /init/peertube-init.sh
  37. containers:
  38. - name: {{ .Chart.Name }}
  39. image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
  40. imagePullPolicy: {{ .Values.image.pullPolicy }}
  41. ports:
  42. - name: http
  43. containerPort: 9000
  44. protocol: TCP
  45. livenessProbe:
  46. httpGet:
  47. path: /
  48. port: http
  49. initialDelaySeconds: 60
  50. readinessProbe:
  51. httpGet:
  52. path: /
  53. port: http
  54. initialDelaySeconds: 90
  55. command:
  56. - gosu
  57. - peertube
  58. - npm
  59. - start
  60. env:
  61. - name: PEERTUBE_WEBSERVER_HOSTNAME
  62. value: {{ .Values.environment.hostname }}
  63. - name: PEERTUBE_WEBSERVER_PORT
  64. value: {{ .Values.environment.http | quote }}
  65. - name: PEERTUBE_WEBSERVER_HTTPS
  66. value: {{ .Values.environment.httpsEnabled | quote }}
  67. - name: PEERTUBE_DB_HOSTNAME
  68. value: {{ .Values.environment.dbHostname }}
  69. - name: PEERTUBE_DB_SUFFIX
  70. value: _prod
  71. - name: PEERTUBE_DB_USERNAME
  72. value: {{ .Values.environment.dbUser }}
  73. - name: PEERTUBE_DB_PASSWORD
  74. value: {{ .Values.environment.dbPassword }}
  75. - name: PEERTUBE_REDIS_HOSTNAME
  76. value: {{ .Release.Name }}-{{ .Values.environment.redisHostname }}-master
  77. - name: PEERTUBE_SMTP_USERNAME
  78. value: {{ .Values.environment.smtpUser | quote }}
  79. - name: PEERTUBE_SMTP_PASSWORD
  80. value: {{ .Values.environment.smtpPassword }}
  81. - name: PEERTUBE_SMTP_HOSTNAME
  82. value: {{ .Values.environment.smtpHostname }}
  83. - name: PEERTUBE_SMTP_PORT
  84. value: {{ .Values.environment.smtpPort | quote }}
  85. - name: PEERTUBE_SMTP_FROM
  86. value: {{ .Values.environment.smtpFrom | quote }}
  87. - name: PEERTUBE_SMTP_TLS
  88. value: {{ .Values.environment.smtpTls | quote }}
  89. - name: PEERTUBE_ADMIN_EMAIL
  90. value: {{ .Values.environment.admin | quote }}
  91. - name: PEERTUBE_SIGNUP_ENABLED
  92. value: {{ .Values.environment.signup | quote }}
  93. - name: PEERTUBE_TRANSCODING_ENABLED
  94. value: {{ .Values.environment.transcoding | quote }}
  95. - name: PEERTUBE_TRUST_PROXY
  96. value: {{ .Values.environment.trustProxy | quote }}
  97. volumeMounts:
  98. - name: data
  99. mountPath: /data
  100. - name: config
  101. mountPath: /config
  102. resources:
  103. {{ toYaml .Values.resources | indent 12 }}
  104. {{- with .Values.nodeSelector }}
  105. nodeSelector:
  106. {{ toYaml . | indent 8 }}
  107. {{- end }}
  108. {{- with .Values.affinity }}
  109. affinity:
  110. {{ toYaml . | indent 8 }}
  111. {{- end }}
  112. {{- with .Values.tolerations }}
  113. tolerations:
  114. {{ toYaml . | indent 8 }}
  115. {{- end }}
  116. volumes:
  117. {{- if .Values.persistence.data.enabled }}
  118. - name: data
  119. persistentVolumeClaim:
  120. claimName: {{ .Values.persistence.data.existingClaim }}
  121. {{- else }}
  122. - name: data
  123. emptyDir: {}
  124. {{- end }}
  125. {{- if .Values.persistence.config.enabled }}
  126. - name: config
  127. persistentVolumeClaim:
  128. claimName: {{ .Values.persistence.config.existingClaim }}
  129. {{- else }}
  130. - name: config
  131. emptyDir: {}
  132. {{- end }}
  133. - configMap:
  134. defaultMode: 420
  135. name: peertube-init
  136. name: peertube-init