Sync HTPC Manifests to GitOps / Sync Manifests to GitOps Repo (push) Successful in 4s
125 lines
3.8 KiB
YAML
125 lines
3.8 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: transmission
|
|
namespace: htpc
|
|
labels:
|
|
app.kubernetes.io/name: transmission
|
|
app.kubernetes.io/part-of: htpc
|
|
spec:
|
|
replicas: 1
|
|
strategy:
|
|
type: Recreate
|
|
selector:
|
|
matchLabels:
|
|
app: transmission
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: transmission
|
|
app.kubernetes.io/name: transmission
|
|
app.kubernetes.io/part-of: htpc
|
|
spec:
|
|
nodeSelector:
|
|
kubernetes.io/hostname: vmserver
|
|
initContainers:
|
|
- name: migrate-config
|
|
image: lscr.io/linuxserver/transmission:latest
|
|
imagePullPolicy: IfNotPresent
|
|
command:
|
|
- /bin/sh
|
|
- -c
|
|
- |
|
|
if [ ! -d /config/torrents ] && [ -d /host-config/torrents ]; then
|
|
echo "Migrating transmission config from host..."
|
|
cp -a /host-config/torrents /config/
|
|
cp -a /host-config/resume /config/
|
|
[ -d /host-config/blocklists ] && cp -a /host-config/blocklists /config/
|
|
for f in settings.json stats.json dht.dat bandwidth-groups.json; do
|
|
[ -f "/host-config/$f" ] && cp -a "/host-config/$f" /config/
|
|
done
|
|
fi
|
|
if [ -f /config/settings.json ]; then
|
|
sed -i 's/"rpc-authentication-required": true/"rpc-authentication-required": false/g' /config/settings.json
|
|
sed -i 's/"rpc-whitelist-enabled": true/"rpc-whitelist-enabled": false/g' /config/settings.json
|
|
sed -i 's/"rpc-host-whitelist-enabled": true/"rpc-host-whitelist-enabled": false/g' /config/settings.json
|
|
fi
|
|
chown -R 33:33 /config
|
|
volumeMounts:
|
|
- name: config
|
|
mountPath: /config
|
|
- name: host-config
|
|
mountPath: /host-config
|
|
readOnly: true
|
|
containers:
|
|
- name: transmission
|
|
image: lscr.io/linuxserver/transmission:latest
|
|
imagePullPolicy: IfNotPresent
|
|
env:
|
|
- name: PUID
|
|
value: "33"
|
|
- name: PGID
|
|
value: "33"
|
|
- name: TZ
|
|
value: "Europe/Amsterdam"
|
|
- name: UMASK
|
|
value: "0002"
|
|
envFrom:
|
|
- secretRef:
|
|
name: transmission-secret
|
|
ports:
|
|
- name: http
|
|
containerPort: 9091
|
|
hostPort: 9091
|
|
protocol: TCP
|
|
- name: peer-tcp
|
|
containerPort: 53662
|
|
hostPort: 53662
|
|
protocol: TCP
|
|
- name: peer-udp
|
|
containerPort: 53662
|
|
hostPort: 53662
|
|
protocol: UDP
|
|
resources:
|
|
requests:
|
|
cpu: 100m
|
|
memory: 256Mi
|
|
limits:
|
|
cpu: 2000m
|
|
memory: 4Gi
|
|
volumeMounts:
|
|
- name: config
|
|
mountPath: /config
|
|
- name: datadisk
|
|
mountPath: /datadisk
|
|
- name: mnt-mp3
|
|
mountPath: /mnt/mp3
|
|
livenessProbe:
|
|
tcpSocket:
|
|
port: 9091
|
|
initialDelaySeconds: 60
|
|
periodSeconds: 20
|
|
timeoutSeconds: 5
|
|
readinessProbe:
|
|
tcpSocket:
|
|
port: 9091
|
|
initialDelaySeconds: 15
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
volumes:
|
|
- name: config
|
|
persistentVolumeClaim:
|
|
claimName: transmission-config
|
|
- name: host-config
|
|
hostPath:
|
|
path: /var/www/.config/transmission-daemon
|
|
type: DirectoryOrCreate
|
|
- name: datadisk
|
|
hostPath:
|
|
path: /datadisk
|
|
type: Directory
|
|
- name: mnt-mp3
|
|
hostPath:
|
|
path: /mnt/mp3
|
|
type: Directory
|