add tdarr

This commit is contained in:
2024-03-16 08:16:38 -06:00
parent 4efdc15832
commit c0b41a6d6c
8 changed files with 435 additions and 0 deletions

18
charts/tdarr/Chart.yaml Normal file
View File

@@ -0,0 +1,18 @@
apiVersion: v2
name: tdarr
version: 0.0.1
description: Chart for Tdarr V2
keywords:
- video
- transcode
sources:
- https://github.com/HaveAGitGat/Tdarr
- https://github.com/homeylab/helm-charts/tree/main/charts/tdarr-exporter
maintainers:
- name: alexlebens
icon: https://avatars.githubusercontent.com/u/43864057?s=48&v=4
dependencies:
- name: tdarr-exporter
version: 1.0.0
repository: https://homeylab.github.io/helm-charts/
appVersion: "2.17.01"

16
charts/tdarr/README.md Normal file
View File

@@ -0,0 +1,16 @@
## Introduction
[Tdarr V2](https://github.com/HaveAGitGat/Tdarr)
Distributed transcode automation using FFmpeg/HandBrake + Audio/Video library analytics + video health checking.
This chart bootstraps an [Tdarr V2](https://github.com/HaveAGitGat/Tdarr) server deployment with separate node deployments on a [Kubernetes](https://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
## Prerequisites
- Kubernetes
- Helm
## Parameters
See the [values files](values.yaml).

View File

@@ -0,0 +1,185 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: tdarr-server
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: tdarr-server
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: web
app.kubernetes.io/part-of: tdarr-server
spec:
revisionHistoryLimit: 3
replicas: {{ .Values.server.replicas }}
strategy:
type: {{ .Values.server.strategy }}
selector:
matchLabels:
app.kubernetes.io/name: tdarr-server
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: tdarr-server
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
serviceAccountName: {{ .Release.Name }}
automountServiceAccountToken: true
containers:
- name: tdarr-server
image: "{{ .Values.server.image.repository }}:{{ .Values.server.image.tag }}"
imagePullPolicy: {{ .Values.server.image.pullPolicy }}
ports:
- name: api
containerPort: {{ .Values.server.service.api.port }}
protocol: TCP
- name: web
containerPort: {{ .Values.server.service.web.port }}
protocol: TCP
env:
{{- with (concat .Values.global.env .Values.server.env) }}
{{- toYaml . | nindent 12 }}
{{- end }}
- name: internalNode
value: "false"
- name: inContainer
value: "true"
- name: nodeName
value: tdarr-server
- name: serverIP
value: 0.0.0.0
- name: serverPort
value: "{{ .Values.server.service.api.port }}"
- name: webUIPort
value: "{{ .Values.server.service.web.port }}"
volumeMounts:
- name: tdarr-server-config
mountPath: /app/configs
- name: tdarr-server-server
mountPath: /app/server
- name: tdarr-server-cache
mountPath: /tcache
- name: media-storage
mountPath: {{ .Values.global.persistence.media.mountPath }}
resources:
{{- toYaml .Values.server.resources | nindent 12 }}
livenessProbe:
tcpSocket:
port: {{ .Values.server.service.api.port }}
initialDelaySeconds: 0
failureThreshold: 3
timeoutSeconds: 1
periodSeconds: 10
readinessProbe:
tcpSocket:
port: {{ .Values.server.service.api.port }}
initialDelaySeconds: 0
failureThreshold: 3
timeoutSeconds: 1
periodSeconds: 10
startupProbe:
tcpSocket:
port: {{ .Values.server.service.api.port }}
initialDelaySeconds: 0
failureThreshold: 30
timeoutSeconds: 1
periodSeconds: 5
volumes:
- name: tdarr-server-config
persistentVolumeClaim:
claimName: tdarr-server-config
- name: tdarr-server-server
persistentVolumeClaim:
claimName: tdarr-server-server
- name: tdarr-server-cache
emptyDir:
sizeLimit: {{ .Values.node.persistence.cache.size }}
- name: media-storage
persistentVolumeClaim:
claimName: {{ .Values.global.persistence.media.claimName }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: tdarr-node
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: tdarr-node
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: web
app.kubernetes.io/part-of: tdarr-node
spec:
revisionHistoryLimit: 3
replicas: {{ .Values.node.replicas }}
strategy:
type: {{ .Values.node.strategy }}
selector:
matchLabels:
app.kubernetes.io/name: tdarr-node
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: tdarr-node
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
serviceAccountName: {{ .Release.Name }}
automountServiceAccountToken: true
containers:
- name: tdarr-node
image: "{{ .Values.node.image.repository }}:{{ .Values.node.image.tag }}"
imagePullPolicy: {{ .Values.node.image.pullPolicy }}
ports:
- name: api
containerPort: {{ .Values.node.service.api.port }}
protocol: TCP
env:
{{- with (concat .Values.global.env .Values.node.env) }}
{{- toYaml . | nindent 12 }}
{{- end }}
- name: inContainer
value: "true"
- name: nodeName
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: serverPort
value: "{{ .Values.node.service.api.port }}"
volumeMounts:
- name: tdarr-node-cache
mountPath: /tcache
- name: media-storage
mountPath: {{ .Values.global.persistence.media.mountPath }}
resources:
{{- toYaml .Values.node.resources | nindent 12 }}
livenessProbe:
tcpSocket:
port: {{ .Values.node.service.api.port }}
initialDelaySeconds: 0
failureThreshold: 3
timeoutSeconds: 1
periodSeconds: 10
readinessProbe:
tcpSocket:
port: {{ .Values.node.service.api.port }}
initialDelaySeconds: 0
failureThreshold: 3
timeoutSeconds: 1
periodSeconds: 10
startupProbe:
tcpSocket:
port: {{ .Values.node.service.api.port }}
initialDelaySeconds: 0
failureThreshold: 30
timeoutSeconds: 1
periodSeconds: 5
volumes:
- name: tdarr-node-cache
emptyDir:
sizeLimit: {{ .Values.node.persistence.cache.size }}
- name: media-storage
persistentVolumeClaim:
claimName: {{ .Values.global.persistence.media.claimName }}

View File

@@ -0,0 +1,32 @@
{{- if .Values.server.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: tdarr-server
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: tdarr-server
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: web
app.kubernetes.io/part-of: tdarr-server
annotations:
{{- toYaml .Values.server.ingress.annotations | nindent 4 }}
spec:
ingressClassName: {{ .Values.server.ingress.className }}
tls:
- hosts:
- {{ .Values.server.ingress.host }}
secretName: tdarr-server-secret-tls
rules:
- host: {{ .Values.server.ingress.host }}
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: tdarr-server-web
port:
name: web
{{- end }}

View File

@@ -0,0 +1,40 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: tdarr-server-config
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: tdarr-server
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: storage
app.kubernetes.io/part-of: tdarr-server
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.server.persistence.config.storageSize }}
storageClassName: {{ .Values.server.persistence.config.storageClassName }}
volumeMode: {{ .Values.server.persistence.config.volumeMode }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: tdarr-server-server
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: tdarr-server
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: storage
app.kubernetes.io/part-of: tdarr-server
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.server.persistence.server.storageSize }}
storageClassName: {{ .Values.server.persistence.server.storageClassName }}
volumeMode: {{ .Values.server.persistence.server.volumeMode }}

View File

@@ -0,0 +1,13 @@
{{- if .Values.global.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: {{ .Release.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: web
app.kubernetes.io/part-of: {{ .Release.Name }}
{{- end }}

View File

@@ -0,0 +1,43 @@
apiVersion: v1
kind: Service
metadata:
name: tdarr-server-api
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: tdarr-server
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: web
app.kubernetes.io/part-of: tdarr-server
spec:
type: ClusterIP
ports:
- port: {{ .Values.server.service.api.port }}
targetPort: api
protocol: TCP
name: api
selector:
app.kubernetes.io/name: tdarr-server
app.kubernetes.io/instance: {{ .Release.Name }}
---
apiVersion: v1
kind: Service
metadata:
name: tdarr-server-web
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: tdarr-server
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion }}
app.kubernetes.io/component: web
app.kubernetes.io/part-of: tdarr-server
spec:
ports:
- port: {{ .Values.server.service.web.port }}
targetPort: web
protocol: TCP
name: web
selector:
app.kubernetes.io/name: tdarr-server
app.kubernetes.io/instance: {{ .Release.Name }}

88
charts/tdarr/values.yaml Normal file
View File

@@ -0,0 +1,88 @@
global:
serviceAccount:
create: true
env:
- name: TZ
value: UTC
- name: PUID
value: "1001"
- name: PGID
value: "1001"
- name: UMASK_SET
value: "002"
- name: ffmpegVersion
value: "6"
persistence:
media:
claimName:
mountPath:
server:
replicas: 1
strategy: Recreate
image:
repository: ghcr.io/haveagitgat/tdarr
tag: "2.17.01"
pullPolicy: IfNotPresent
env: []
envFrom: []
resources:
requests:
cpu: 50m
memory: 256Mi
limits:
cpu: 500m
memory: 1Gi
service:
api:
port: 8266
web:
port: 8265
ingress:
enabled: false
className:
annotations:
host:
persistence:
config:
storageClassName: default
storageSize: 5Gi
volumeMode: Filesystem
server:
storageClassName: default
storageSize: 5Gi
volumeMode: Filesystem
cache:
size: 100Mi
node:
replicas: 3
strategy: Recreate
image:
repository: ghcr.io/haveagitgat/tdarr_node
tag: "2.17.01"
pullPolicy: IfNotPresent
env: []
envFrom: []
resources:
requests:
cpu: 100m
memory: 1Gi
limits:
cpu: 1000m
memory: 2Gi
service:
api:
port: 8266
persistence:
cache:
size: 5Gi
tdarr-exporter:
metrics:
serviceMonitor:
enabled: false
interval: 30s
scrapeTimeout: 30s
settings:
config:
url:
verify_ssl: false
log_level: "info"