From faf0af1f22c240be3f933adab3d70d5d087d66ef Mon Sep 17 00:00:00 2001 From: Victor Hery Date: Fri, 29 Dec 2023 14:04:16 +0100 Subject: [PATCH 1/2] Compatibility increased for k8s 1.25+ and bump to Peertube v5.2.1 --- CHANGELOG.md | 8 ++++++++ Chart.yaml | 6 +++--- templates/ingress.yaml | 4 +++- values.yaml | 9 +++------ 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4d1f6a..67c2b02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# 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 diff --git a/Chart.yaml b/Chart.yaml index 2a92eab..dae856d 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v1 -appVersion: "v4.3.0-bullseye" -description: A Helm chart for Kubernetes +appVersion: "v5.2.1-bullseye" +description: A Helm chart to install peertube in kubernetes name: peertube -version: 1.5.0 +version: 1.5.1 diff --git a/templates/ingress.yaml b/templates/ingress.yaml index adb8a2c..5956cce 100644 --- a/templates/ingress.yaml +++ b/templates/ingress.yaml @@ -1,6 +1,7 @@ {{- if .Values.ingress.enabled -}} {{- $fullName := include "peertube.fullname" . -}} {{- $ingressPath := .Values.ingress.path -}} +{{- $ingressPathType := .Values.ingress.pathType -}} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: @@ -15,6 +16,7 @@ metadata: {{ toYaml . | indent 4 }} {{- end }} spec: + ingressClassName: {{ .Values.ingress.ingressClassName }} {{- if .Values.ingress.tls }} tls: {{- range .Values.ingress.tls }} @@ -31,7 +33,7 @@ spec: http: paths: - path: {{ $ingressPath }} - pathType: Prefix + pathType: {{ $ingressPathType }} backend: service: name: {{ $fullName }} diff --git a/values.yaml b/values.yaml index f7fe1b2..ded573f 100644 --- a/values.yaml +++ b/values.yaml @@ -7,7 +7,7 @@ replicaCount: 1 image: repository: chocobozzz/peertube - tag: v4.0.0-bullseye + tag: v5.2.1-bullseye pullPolicy: IfNotPresent service: @@ -26,11 +26,12 @@ ports: 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: @@ -45,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 From 0735152fba59d1ac787eccc34c3f545e97988d62 Mon Sep 17 00:00:00 2001 From: LecygneNoir Date: Fri, 29 Dec 2023 14:53:49 +0100 Subject: [PATCH 2/2] 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 --- CHANGELOG.md | 9 +++++++++ Chart.yaml | 4 ++-- scripts/peertube-init.sh | 11 ++++++++++- values.yaml | 2 +- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67c2b02..fac6e22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +# 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 diff --git a/Chart.yaml b/Chart.yaml index dae856d..abc0232 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v1 -appVersion: "v5.2.1-bullseye" +appVersion: "v6.0.2-bookworm" description: A Helm chart to install peertube in kubernetes name: peertube -version: 1.5.1 +version: 1.6.0 diff --git a/scripts/peertube-init.sh b/scripts/peertube-init.sh index 61acc61..083e6d5 100644 --- a/scripts/peertube-init.sh +++ b/scripts/peertube-init.sh @@ -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 \ No newline at end of file +exit 0 diff --git a/values.yaml b/values.yaml index ded573f..b4a4e6c 100644 --- a/values.yaml +++ b/values.yaml @@ -7,7 +7,7 @@ replicaCount: 1 image: repository: chocobozzz/peertube - tag: v5.2.1-bullseye + tag: v6.0.2-bookworm pullPolicy: IfNotPresent service: