24 Commits

Author SHA1 Message Date
  LecygneNoir 397bf84b5b Merge branch 'release/v1.6.0' 2 months ago
  LecygneNoir 0735152fba Upgrade to Peertube v6.0.2, using init-container to move directory from /data/videos to /data/web-videos and applying production.yaml.new file 2 months ago
  Victor Hery faf0af1f22 Compatibility increased for k8s 1.25+ and bump to Peertube v5.2.1 2 months ago
  Victor Hery 900be2a3a4 Compatibility increased for k8s 1.25+ and bump to Peertube v5.2.1 2 months ago
  LecygneNoir d150a918e6 Merge tag 'v1.5.0' into develop 1 year ago
  LecygneNoir ee7ac87f78 Merge branch 'release/v1.5.0' 1 year ago
  LecygneNoir b88f4ceba4 Compatibility for Peertube v4.3.0 and removing of very old redis chart dependancy 1 year ago
  LecygneNoir a9c164a021 Merge tag 'v1.4.0' into develop 1 year ago
  LecygneNoir 8d9f7ca91d Merge branch 'release/v1.4.0' 1 year ago
  LecygneNoir 0b5049fec1 Release v1.4.0, compatibility with k8s 1.19+, no more fixed suffix for database 1 year ago
  LecygneNoir 554dd10c49 Update default app value to v4.0.0-bullseye. Warn if you are upgrading for 3.4, see release note for post maj script: https://github.com/Chocobozzz/PeerTube/releases/tag/v4.0.0 2 years ago
  LecygneNoir e4470c3f48 Merge branch 'hotfix/v1.2.1' 2 years ago
  LecygneNoir 5525e601df bump version to 1.2.1 2 years ago
  LecygneNoir d29cbfb320 Fix startupProbe port using http instead of 9000, and adapt initialDelay to avoid longer start when the instance starts quickly 2 years ago
  LecygneNoir 4dd6c1f172 Merge branch 'release/v1.2.0' 2 years ago
  LecygneNoir 6265ed4162 Add CHANGELOG.md for v1.2.0 2 years ago
  LecygneNoir 629ab1e250 Update charts for k8s1.16+ compatibility. Use tag post_k8s1.16 for k8s1.15- 3 years ago
  LecygneNoir 047c1eb3bc Add startupProbe (used in k8s1.16+) with very large FailureThreshold. Objective is to absolutely avoid peertube to be killed during an upgrade process. For normal start, there is no delay as StartupProbe will quuickly see everything are Ok 3 years ago
  LecygneNoir 0340f1662b Add config to support new live feature for Peertube v3 3 years ago
  LecygneNoir ccb8b974ab Merge branch 'hotfix/1.1.2' 3 years ago
  LecygneNoir f05e38f830 Update compatibility to Peertube v2.3.0, remove unused env variables 3 years ago
  LecygneNoir e02ddcdb55 Merge branch 'hotfix/1.1.1' 3 years ago
  LecygneNoir 72424e4314 Bump compatibility version to Peertube v2.2-buster 3 years ago
  LecygneNoir f03110680a Remove variable PEERTUBE_TRUST_PROXY as it does not exist anymore in peertube v2.2 3 years ago
11 changed files with 208 additions and 59 deletions
Split View
  1. +100
    -0
      CHANGELOG.md
  2. +3
    -3
      Chart.yaml
  3. +19
    -6
      README.md
  4. BIN
      charts/redis-3.3.5.tgz
  5. +0
    -6
      requirements.lock
  6. +0
    -5
      requirements.yaml
  7. +10
    -1
      scripts/peertube-init.sh
  8. +51
    -15
      templates/deployment.yaml
  9. +8
    -3
      templates/ingress.yaml
  10. +6
    -0
      templates/service.yaml
  11. +11
    -20
      values.yaml

+ 100
- 0
CHANGELOG.md View File

@ -0,0 +1,100 @@
# v1.6.0
## Important
- From Peertube 6.0, [storage directoy for video changes](https://github.com/Chocobozzz/PeerTube/releases/tag/v6.0.0)! This new Chart version includes an init script that move directory from `/data/videos` to `/data/web-videos` before starting peertube (as in k8s, it's very hard to move data in place 😅 ) **but you need** to edit your config file accordingly!
## Features
- Compatibility with Peertube v6.0.2
- Use the new production.yaml.new files generated by peertube during upgrade if it exists
# v1.5.1
## Important
- Add pathType and ingressClassName in values.yml for better support in k8s 1.25+
## Feature
- Compatibility with Peertube 5.2.1
# v1.5.1
## Important
- Add pathType and ingressClassName in values.yml for better support in k8s 1.25+
## Feature
- Compatibility with Peertube 5.2.1
# v1.5.0
## Important
- Removed redis from this chart as it's osbolete. You need to install a redis server aside! See README for details.
## Features:
- Compatibility with peertube v4.3.0
# v1.4.0
## Feature
- Upgrade Ingress template for k8s 1.19+ compatibility
- Remove fixed database suffix from deployment, please use production.yml to configure if default "_prod" is not sufficient
# v1.3.0
## Feature
- Bump to peertube v4.0 by default. Warn if you are upgrading for 3.4, see release note for post maj script: https://github.com/Chocobozzz/PeerTube/releases/tag/v4.0.0
# v1.2.1
## Fix
- Adjust initialDelaySecond for startupProbe to avoid waiting 5min even if the instance starts quickly
- Adjust startupProbe port to use 9000 instead of http
# v1.2.0
## Features
- Compatibility with helm 3 and k8s 1.16+
- Now use StartupProbe to enable very long start when updating Peertube and running upgrade scripts
# v1.1.2
## Fixes
- Update compatibility to Peertube v2.3.0
- Remove deprecated env variables for docker
# v1.1.1
Ensure compatibility with Peertube v2.2.0 by removing the PEERTUBE_TRUST_PROXY env variable that does not exist anymore.
Is you used it, configure your production.yml instead for better reliability.
# v1.1.0
## Features
Add a nginx sidecar to use the official Peertube optimisations for Nginx (Fix #2)
# v1.0.2
## Breaking changes
The option initcontainer is now renamed chowncontainer as it fit better to its usage.
## Fixes
- Fix issue #3 to avoid breaking Peertube upgrade by using 2 initContainers
# v1.0.1
Now use Peertube v2.1.0-buster as default
# v1.0.0
*Initial release*
##Features
- Deploy Peertube in kubernetes
- Deploy redis server to be used by Peertube
- Allow to enable usual docker "chown" to speed up startup through InitContainer

+ 3
- 3
Chart.yaml View File

@ -1,5 +1,5 @@
apiVersion: v1
appVersion: "v2.1.0-buster"
description: A Helm chart for Kubernetes
appVersion: "v6.0.2-bookworm"
description: A Helm chart to install peertube in kubernetes
name: peertube
version: 1.1.0
version: 1.6.0

+ 19
- 6
README.md View File

@ -4,7 +4,7 @@ Federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly
---
## Status : WIP
## Status : WIP but workable
- [x] Run Peertube and Redis
- [x] Use pvc to persist data
@ -12,12 +12,25 @@ Federated (ActivityPub) video streaming platform using P2P (BitTorrent) directly
## Before deploying
Currently if you want use persistent volume you need to create persistent volume and persistent volume claim. You may use sample claims from `sample`:
Currently if you want use persistent volume you need to create persistent volume and persistent volume claim. You may use sample claims from `sample`:
- change the storageclass from `ChangeMeStorageClass` to your correct class
- apply the claim: `kubectl apply -f sample/claim.pvc-pt.yml`
You also need a postgresql server.
If you know what you are doing and want to store postgres in Kubernetes, I suggest the excellent [stolon](https://github.com/helm/charts/tree/master/stable/stolon).
### Postgres
You need a postgresql server.
If you know what you are doing and want to store postgres in Kubernetes, I suggest [postgres-operator](https://access.crunchydata.com/documentation/postgres-operator/5.1.1/) from CrunchyData
### You also need a redis
From peertube helm v1.5.0, redis is no more provided inside the chart. Indeed peertube does not handle anymore redis 3.3, so I advice installing and managing redis outside the chart like postgres cluster.
I suggest using [bitnami redis](https://github.com/bitnami/charts/tree/master/bitnami/redis) with `architecture=standalone` to avoid uneeded slave (Peertube only need master)
Once installed, use following values to pass needed info to your peertube instance.
```
redisHostname
redisAuth
```
## Installing the chart
@ -40,5 +53,5 @@ See the sample/values.yml for example of values to use
## Source
Originated from https://github.com/MikaXII/helm-charts
Thanks!
Originated from https://github.com/MikaXII/helm-charts
Thanks!

BIN
charts/redis-3.3.5.tgz View File


+ 0
- 6
requirements.lock View File

@ -1,6 +0,0 @@
dependencies:
- name: redis
repository: https://kubernetes-charts.storage.googleapis.com
version: 3.3.5
digest: sha256:bc60370cbce6d02249e972f74489dc20248f8bd3d61d7e031d6e186ff07c42ad
generated: 2018-06-08T16:58:13.072321307+02:00

+ 0
- 5
requirements.yaml View File

@ -1,5 +0,0 @@
# requirements.yaml
dependencies:
- name: redis
version: "3.3.5"
repository: "@stable"

+ 10
- 1
scripts/peertube-init.sh View File

@ -8,10 +8,19 @@ fi
# Always copy default and custom env configuration file, in cases new keys were added
cp /app/config/default.yaml /config
cp /app/support/docker/production/config/custom-environment-variables.yaml /config
# From 5.2 peertube upgrade script creates a production.yaml.new containing production.yml config and news mandatory keys, directly usable
if [ -f "/config/production.yaml.new" ]; then
mv /config/production.yaml.new /config/production.yaml
fi
# Patch user after the cp
find /config ! -user peertube -exec chown peertube:peertube {} \;
# Move videos data for Peertube 6.0.0 before starting peertube
if [ -d "/data/videos" -a ! -d "/data/web-videos" ]; then
mv /data/videos /data/web-videos
fi
# Prepare assets for the Nginx sidecar
cp -r /app/client/dist/* /assets/
exit 0
exit 0

+ 51
- 15
templates/deployment.yaml View File

@ -1,4 +1,4 @@
apiVersion: apps/v1beta2
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "peertube.fullname" . }}
@ -61,6 +61,13 @@ spec:
- name: http
containerPort: {{ .Values.ports.nginxproxyPort }}
protocol: TCP
startupProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 300
failureThreshold: 30
periodSeconds: 10
livenessProbe:
httpGet:
path: /
@ -87,31 +94,64 @@ spec:
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.nginxproxy.enabled }}
livenessProbe:
{{- if .Values.ports.livePort }}
ports:
- name: live
containerPort: {{ .Values.ports.livePort }}
protocol: TCP
{{- end }}
startupProbe:
httpGet:
path: /
port: 9000
initialDelaySeconds: 60
failureThreshold: 3000
periodSeconds: 10
livenessProbe:
httpGet:
path: /
port: 9000
initialDelaySeconds: 600
failureThreshold: 3
periodSeconds: 10
readinessProbe:
httpGet:
path: /
port: 9000
initialDelaySeconds: 60
initialDelaySeconds: 300
failureThreshold: 3
periodSeconds: 10
{{- else }}
ports:
- name: http
containerPort: {{ .Values.ports.peertubePort }}
protocol: TCP
- name: http
containerPort: {{ .Values.ports.peertubePort }}
protocol: TCP
{{- if .Values.ports.livePort }}
- name: live
containerPort: {{ .Values.ports.livePort }}
protocol: TCP
{{- end }}
startupProbe:
httpGet:
path: /
port: 9000
initialDelaySeconds: 60
failureThreshold: 3000
periodSeconds: 10
livenessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 60
initialDelaySeconds: 600
failureThreshold: 3
periodSeconds: 10
readinessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 60
initialDelaySeconds: 30
failureThreshold: 3
periodSeconds: 10
{{- end }}
command:
- gosu
@ -127,14 +167,14 @@ spec:
value: {{ .Values.environment.httpsEnabled | quote }}
- name: PEERTUBE_DB_HOSTNAME
value: {{ .Values.environment.dbHostname }}
- name: PEERTUBE_DB_SUFFIX
value: _prod
- name: PEERTUBE_DB_USERNAME
value: {{ .Values.environment.dbUser }}
- name: PEERTUBE_DB_PASSWORD
value: {{ .Values.environment.dbPassword }}
- name: PEERTUBE_REDIS_HOSTNAME
value: {{ .Release.Name }}-{{ .Values.environment.redisHostname }}-master
value: {{ .Values.environment.redisHostname }}
- name: PEERTUBE_REDIS_AUTH
value: {{ .Values.environment.redisAuth }}
- name: PEERTUBE_SMTP_USERNAME
value: {{ .Values.environment.smtpUser | quote }}
- name: PEERTUBE_SMTP_PASSWORD
@ -149,12 +189,8 @@ spec:
value: {{ .Values.environment.smtpTls | quote }}
- name: PEERTUBE_ADMIN_EMAIL
value: {{ .Values.environment.admin | quote }}
- name: PEERTUBE_SIGNUP_ENABLED
value: {{ .Values.environment.signup | quote }}
- name: PEERTUBE_TRANSCODING_ENABLED
value: {{ .Values.environment.transcoding | quote }}
- name: PEERTUBE_TRUST_PROXY
value: {{ .Values.environment.trustProxy | quote }}
volumeMounts:
- name: data
mountPath: /data

+ 8
- 3
templates/ingress.yaml View File

@ -1,7 +1,8 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "peertube.fullname" . -}}
{{- $ingressPath := .Values.ingress.path -}}
apiVersion: extensions/v1beta1
{{- $ingressPathType := .Values.ingress.pathType -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}
@ -15,6 +16,7 @@ metadata:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
ingressClassName: {{ .Values.ingress.ingressClassName }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
@ -31,8 +33,11 @@ spec:
http:
paths:
- path: {{ $ingressPath }}
pathType: {{ $ingressPathType }}
backend:
serviceName: {{ $fullName }}
servicePort: http
service:
name: {{ $fullName }}
port:
number: 9000
{{- end }}
{{- end }}

+ 6
- 0
templates/service.yaml View File

@ -20,6 +20,12 @@ spec:
targetPort: http
protocol: TCP
name: http
{{- end }}
{{- if .Values.ports.livePort }}
- port: {{ .Values.ports.livePort }}
targetPort: {{ .Values.ports.livePort }}
protocol: TCP
name: live
{{- end }}
selector:
app: {{ template "peertube.name" . }}

+ 11
- 20
values.yaml View File

@ -7,7 +7,7 @@ replicaCount: 1
image:
repository: chocobozzz/peertube
tag: v2.1.0-buster
tag: v6.0.2-bookworm
pullPolicy: IfNotPresent
service:
@ -20,14 +20,18 @@ ports:
# The chart uses the correct port for service and ingress according to configuration
peertubePort: 9000
nginxproxyPort: 9001
# livePort is a directly exposed TCP port used for the live streaming feature.
# Should match your live configuration in production.yml, and default to 1935
livePort: 1935
ingress:
enabled: true
ingressClassName: haproxy
annotations:
kubernetes.io/ingress.class: haproxy
kubernetes.io/tls-acme: "true"
certmanager.k8s.io/cluster-issuer: your-certmanager
path: /
pathType: Prefix
hosts:
- peertube.domain.tld
tls:
@ -42,10 +46,6 @@ chowncontainer:
enabled: true
resources:
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
requests:
cpu: 3
memory: 6Gi
@ -83,6 +83,7 @@ environment:
dbUser: peertube
dbPassword: postgres
redisHostname: redis
redisAuth: redispassword
smtpUser: peertube@peertube.domain.tld
smtpPassword: smtppassword
smtpHostname: smtp.peertube.domain.tld
@ -90,11 +91,13 @@ environment:
smtpFrom: peertube@peertube.domain.tld
smtpTls: true
admin: peertube@peertube.domain.tld
signup: false
transcoding: true
# WARNING nginxproxy is not compatible with live at the moment
# Because it search .../streaming-playlists/... in URL path directly in filesystem path
# and if you use .../streaming_playlists/... on filesystem, live is broken (notice the - vs _)
nginxproxy:
enabled: true
enabled: false
image:
repository: nginx
tag: 1.17.9
@ -104,15 +107,3 @@ nginxproxy:
persistence:
enabled: false
existingClaim: pvc-nginx-proxy
redis:
usePassword: false
password: peertube
master:
persistence:
enabled: true
path: /data
# PVC are not handled by helm, you need to create redis volume before deploying helm
persistence:
enabled: true
existingClaim: pvc-redis-prod

Loading…
Cancel
Save