diff --git a/peertube/bucket.yaml b/peertube/bucket.yaml new file mode 100644 index 0000000..7882631 --- /dev/null +++ b/peertube/bucket.yaml @@ -0,0 +1,10 @@ +apiVersion: objectbucket.io/v1alpha1 +kind: ObjectBucketClaim +metadata: + name: peertube-bucket + namespace: peertube +spec: + generateBucketName: peertube + storageClassName: weyma-s3-bucket + additionalConfig: + maxSize: "100Gi" \ No newline at end of file diff --git a/peertube/config.yaml b/peertube/config.yaml new file mode 100644 index 0000000..7ad6fc1 --- /dev/null +++ b/peertube/config.yaml @@ -0,0 +1,35 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: peertube-config +data: + PEERTUBE_INSTANCE_NAME: "dubyatp peertube" + PEERTUBE_INSTANCE_DESCRIPTION: "duby's peertube instance" + POSTGRES_USER: peertube + POSTGRES_DB: peertube + PEERTUBE_DB_USERNAME: peertube + PEERTUBE_DB_HOSTNAME: weyma-pgsql-rw.cloudnativepg.svc.cluster.local + PEERTUBE_DB_PORT: "5432" + PEERTUBE_WEBSERVER_HOSTNAME: "tube.dubyatp.xyz" + PEERTUBE_TRUST_PROXY: '["127.0.0.1", "loopback", "172.18.0.0/16"]' + PEERTUBE_SMTP_USERNAME: "peertube_dubyatp" + PEERTUBE_SMTP_HOSTNAME: "mail.smtp2go.com" + PEERTUBE_SMTP_PORT: "465" + PEERTUBE_SMTP_TLS: "true" + PEERTUBE_SMTP_FROM: "peertube@em924671.dubyatp.xyz" + PEERTUBE_ADMIN_EMAIL: "me@williamtpeebles.com" + #PEERTUBE_OBJECT_STORAGE_ENABLED: "true" + #PEERTUBE_OBJECT_STORAGE_ENDPOINT: "https://weyma-s3.infra.dubyatp.xyz" + #PEERTUBE_OBJECT_STORAGE_REGION: "" + #PEERTUBE_OBJECT_STORAGE_STREAMING_PLAYLISTS_BUCKET_NAME: "peertube-953221d2-7649-48b2-b79f-5a9e59daedbb" + #PEERTUBE_OBJECT_STORAGE_STREAMING_PLAYLISTS_PREFIX: "streaming/" + #PEERTUBE_OBJECT_STORAGE_WEB_VIDEOS_BUCKET_NAME: "peertube-953221d2-7649-48b2-b79f-5a9e59daedbb" + #PEERTUBE_OBJECT_STORAGE_WEB_VIDEOS_PREFIX: "videos/" + #PEERTUBE_OBJECT_STORAGE_USER_EXPORTS_BUCKET_NAME: "peertube-953221d2-7649-48b2-b79f-5a9e59daedbb" + #PEERTUBE_OBJECT_STORAGE_USER_EXPORTS_PREFIX: "exports/" + #PEERTUBE_OBJECT_STORAGE_ORIGINAL_VIDEO_FILES_BUCKET_NAME: "peertube-953221d2-7649-48b2-b79f-5a9e59daedbb" + #PEERTUBE_OBJECT_STORAGE_ORIGINAL_VIDEO_FILES_PREFIX: "original-videos/" + #PEERTUBE_OBJECT_STORAGE_CAPTIONS_BUCKET_NAME: "peertube-953221d2-7649-48b2-b79f-5a9e59daedbb" + #PEERTUBE_OBJECT_STORAGE_CAPTIONS_PREFIX: "captions/" + #PEERTUBE_OBJECT_STORAGE_UPLOAD_ACL_PUBLIC: "public-read" + #PEERTUBE_OBJECT_STORAGE_UPLOAD_ACL_PRIVATE: "private" \ No newline at end of file diff --git a/peertube/deployment.yaml b/peertube/deployment.yaml new file mode 100644 index 0000000..c581dc4 --- /dev/null +++ b/peertube/deployment.yaml @@ -0,0 +1,69 @@ +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: peertube + image: chocobozzz/peertube:v7.2.3-bookworm + imagePullPolicy: IfNotPresent + ports: + - containerPort: 80 + name: http + - containerPort: 443 + name: https + - containerPort: 9000 + name: peertube + - containerPort: 1935 + name: rtmp + envFrom: + - secretRef: + name: peertube-secret + - secretRef: + name: peertube-bucket + - configMapRef: + name: peertube-config + env: + - name: PEERTUBE_REDIS_HOSTNAME + value: "localhost" + - name: PEERTUBE_REDIS_AUTH + value: "" + volumeMounts: + - name: peertube-data + mountPath: /data + resources: + requests: + cpu: "0.5" + memory: 1Gi + limits: + cpu: "1" + memory: 2Gi + - name: redis + image: redis:8.2.1-alpine + imagePullPolicy: IfNotPresent + ports: + - containerPort: 6379 + name: redis + resources: + requests: + cpu: "0.2" + memory: 256Mi + limits: + cpu: "0.5" + memory: 1Gi + volumes: + - name: peertube-data + persistentVolumeClaim: + claimName: peertube-data + diff --git a/peertube/ingress.yaml b/peertube/ingress.yaml new file mode 100644 index 0000000..7b44076 --- /dev/null +++ b/peertube/ingress.yaml @@ -0,0 +1,18 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: peertube + labels: + app.kubernetes.io/name: peertube +spec: + rules: + - host: tube.dubyatp.xyz + http: + paths: + - pathType: Prefix + path: "/" + backend: + service: + name: peertube + port: + number: 9000 diff --git a/peertube/pvc.yaml b/peertube/pvc.yaml new file mode 100644 index 0000000..e102abe --- /dev/null +++ b/peertube/pvc.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: peertube-data +spec: + accessModes: + - ReadWriteMany + resources: + requests: + storage: 50Gi \ No newline at end of file diff --git a/peertube/secret.yaml b/peertube/secret.yaml new file mode 100644 index 0000000..161dd65 --- /dev/null +++ b/peertube/secret.yaml @@ -0,0 +1,42 @@ +apiVersion: external-secrets.io/v1 +kind: ExternalSecret +metadata: + name: peertube-secret +spec: + data: + - remoteRef: + conversionStrategy: Default + decodingStrategy: None + key: peertube + metadataPolicy: None + property: PEERTUBE_SECRET + secretKey: PEERTUBE_SECRET + - remoteRef: + conversionStrategy: Default + decodingStrategy: None + key: peertube + metadataPolicy: None + property: PEERTUBE_DB_PASSWORD + secretKey: PEERTUBE_DB_PASSWORD + - remoteRef: + conversionStrategy: Default + decodingStrategy: None + key: peertube + metadataPolicy: None + property: PEERTUBE_SMTP_PASSWORD + secretKey: PEERTUBE_SMTP_PASSWORD + - remoteRef: + conversionStrategy: Default + decodingStrategy: None + key: peertube + metadataPolicy: None + property: POSTGRES_PASSWORD + secretKey: POSTGRES_PASSWORD + refreshInterval: 1h + secretStoreRef: + kind: ClusterSecretStore + name: weyma-vault + target: + creationPolicy: Owner + deletionPolicy: Retain + name: peertube-secret \ No newline at end of file diff --git a/peertube/service.yaml b/peertube/service.yaml new file mode 100644 index 0000000..53aa371 --- /dev/null +++ b/peertube/service.yaml @@ -0,0 +1,24 @@ +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 + - protocol: TCP + name: rtmp + port: 1935 + targetPort: 1935 \ No newline at end of file diff --git a/peertube/valkey.yaml b/peertube/valkey.yaml new file mode 100644 index 0000000..b5143bb --- /dev/null +++ b/peertube/valkey.yaml @@ -0,0 +1,16 @@ +apiVersion: hyperspike.io/v1 +kind: Valkey +metadata: + name: peertube-kv + labels: + app.kubernetes.io/instance: peertube +spec: + anonymousAuth: true + certIssuerType: ClusterIssuer + clusterDomain: cluster.local + clusterPreferredEndpointType: ip + nodes: 1 + prometheus: false + replicas: 3 + tls: false + volumePermissions: true \ No newline at end of file