Skip to content

Instantly share code, notes, and snippets.

@cclloyd
Created June 8, 2020 19:05
Show Gist options
  • Save cclloyd/5f023168309ffa905957f3dae8c15557 to your computer and use it in GitHub Desktop.
Save cclloyd/5f023168309ffa905957f3dae8c15557 to your computer and use it in GitHub Desktop.
PeerTube Kubernetes
apiVersion: apps/v1
kind: Deployment
metadata:
name: peertube
labels:
app: peertube
spec:
replicas: 1
selector:
matchLabels:
app: peertube
template:
metadata:
labels:
app: peertube
spec:
containers:
- name: postfix
image: mwader/postfix-relay
imagePullPolicy: IfNotPresent
ports:
- containerPort: 25
name: smtp
env:
- name: POSTGRES_USER
value: "peertube"
- name: POSTGRES_PASSWORD
value: "REDACTED"
- name: POSTGRES_DB
value: "peertube"
- name: PEERTUBE_DB_USERNAME
value: "peertube"
- name: PEERTUBE_DB_PASSWORD
value: "REDACTED"
- name: PEERTUBE_DB_HOSTNAME
value: "db-postgres-postgresql"
- name: PEERTUBE_WEBSERVER_HOSTNAME
value: "gameclips.app"
- name: PEERTUBE_WEBSERVER_PORT
value: "80"
- name: PEERTUBE_WEBSERVER_HTTPS
value: "false"
- name: PEERTUBE_TRUST_PROXY
value: '["10.0.0.0/8"]'
- name: PEERTUBE_SMTP_HOSTNAME
value: "localhost"
- name: PEERTUBE_SMTP_PORT
value: "25"
- name: PEERTUBE_SMTP_FROM
value: "[email protected]"
- name: PEERTUBE_SMTP_TLS
value: "false"
- name: PEERTUBE_SMTP_DISABLE_STARTTLS
value: "false"
- name: PEERTUBE_ADMIN_EMAIL
value: "[email protected]"
- name: POSTFIX_myhostname
value: "gameclips.app"
- name: PEERTUBE_REDIS_HOSTNAME
value: "peertube-redis-master"
- name: PEERTUBE_REDIS_AUTH
value: "REDACTED"
- name: peertube
image: chocobozzz/peertube:production-buster
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
name: http
- containerPort: 443
name: https
- containerPort: 9000
name: peertube
env:
- name: POSTGRES_USER
value: "peertube"
- name: POSTGRES_PASSWORD
value: "REDACTED"
- name: POSTGRES_DB
value: "peertube"
- name: PEERTUBE_DB_USERNAME
value: "peertube"
- name: PEERTUBE_DB_PASSWORD
value: "REDACTED"
- name: PEERTUBE_DB_HOSTNAME
value: "db-postgres-postgresql"
- name: PEERTUBE_WEBSERVER_HOSTNAME
value: "gameclips.app"
- name: PEERTUBE_WEBSERVER_PORT
value: "80"
- name: PEERTUBE_WEBSERVER_HTTPS
value: "false"
- name: PEERTUBE_TRUST_PROXY
value: '["10.0.0.0/8"]'
- name: PEERTUBE_SMTP_HOSTNAME
value: "localhost"
- name: PEERTUBE_SMTP_PORT
value: "25"
- name: PEERTUBE_SMTP_FROM
value: "[email protected]"
- name: PEERTUBE_SMTP_TLS
value: "false"
- name: PEERTUBE_SMTP_DISABLE_STARTTLS
value: "false"
- name: PEERTUBE_ADMIN_EMAIL
value: "[email protected]"
- name: POSTFIX_myhostname
value: "gameclips.app"
- name: PEERTUBE_REDIS_HOSTNAME
value: "peertube-redis-master"
- name: PEERTUBE_REDIS_AUTH
value: "REDACTED"
volumeMounts:
- name: peertube-config
mountPath: /config
- name: peertube-data
mountPath: /data
volumes:
- name: peertube-config
persistentVolumeClaim:
claimName: peertube-config
- name: peertube-data
persistentVolumeClaim:
claimName: peertube-data
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: peertube
labels:
app: peertube
annotations:
kubernetes.io/ingress.class: nginx
cert-manager.io/cluster-issuer: "letsencrypt-prod"
nginx.ingress.kubernetes.io/connection-proxy-header: "keep-alive"
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
nginx.ingress.kubernetes.io/ssl-redirect: "true"
spec:
tls:
- hosts:
- gameclips.app
secretName: peertube-tls
rules:
- host: gameclips.app
http:
paths:
- path: /
backend:
serviceName: peertube
servicePort: peertube
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: peertube-config
labels:
app: peertube
spec:
storageClassName: cephfs
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: peertube-data
labels:
app: peertube
spec:
storageClassName: fastnfs
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Gi
# NOTE: This is a helm chart for bitnami/redis.
global:
redis:
password: REDACTED
cluster:
enabled: false
securityContext:
enabled: false
master:
persistence:
storageClass: cephfs
size: 2Gi
---
kind: Service
apiVersion: v1
metadata:
name: peertube
spec:
selector:
app: peertube
ports:
- protocol: TCP
port: 80
targetPort: 80
name: http
- protocol: TCP
port: 25
targetPort: 25
name: smtp
- protocol: TCP
port: 9000
targetPort: 9000
name: peertube
@arthurzenika
Copy link

Thanks for sharing your configuration, we've reused part of it for a deployment and are trying to maintain a public version in a repo that might be referenced in the peertube "unofficial" documentation : https://forge.extranet.logilab.fr/open-source/peertube-on-kubernetes (we've modified it to provide s3 storage for the videos)

We'd love some feedback or updates that you might have done to this deployment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment