feat(transmission): migrate transmission-daemon to Kubernetes htpc namespace
Sync HTPC Manifests to GitOps / Sync Manifests to GitOps Repo (push) Successful in 4s
Sync HTPC Manifests to GitOps / Sync Manifests to GitOps Repo (push) Successful in 4s
This commit is contained in:
@@ -0,0 +1,123 @@
|
||||
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-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
|
||||
@@ -0,0 +1,8 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
resources:
|
||||
- secret.yaml
|
||||
- pvc.yaml
|
||||
- service.yaml
|
||||
- deployment.yaml
|
||||
@@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: transmission-config
|
||||
namespace: htpc
|
||||
labels:
|
||||
app.kubernetes.io/name: transmission
|
||||
app.kubernetes.io/part-of: htpc
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
storageClassName: local-path
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
@@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: transmission-secret
|
||||
namespace: htpc
|
||||
labels:
|
||||
app.kubernetes.io/name: transmission
|
||||
app.kubernetes.io/part-of: htpc
|
||||
type: Opaque
|
||||
stringData:
|
||||
USER: "bart"
|
||||
PASS: "8x5yPgAa"
|
||||
PEERPORT: "53662"
|
||||
@@ -0,0 +1,25 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: transmission
|
||||
namespace: htpc
|
||||
labels:
|
||||
app.kubernetes.io/name: transmission
|
||||
app.kubernetes.io/part-of: htpc
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 9091
|
||||
targetPort: 9091
|
||||
protocol: TCP
|
||||
name: http
|
||||
- port: 53662
|
||||
targetPort: 53662
|
||||
protocol: TCP
|
||||
name: peer-tcp
|
||||
- port: 53662
|
||||
targetPort: 53662
|
||||
protocol: UDP
|
||||
name: peer-udp
|
||||
selector:
|
||||
app: transmission
|
||||
Reference in New Issue
Block a user