feat(slskd): add slskd deployment, service, pvc and migration scripts
Sync HTPC Manifests to GitOps / Sync Manifests to GitOps Repo (push) Successful in 4s

This commit is contained in:
bart
2026-10-30 08:17:49 +01:00
parent 43c54f18b8
commit 78f5707aac
8 changed files with 349 additions and 0 deletions
+1
View File
@@ -9,5 +9,6 @@ resources:
- sonarr
- lidarr
- transmission
- slskd
+115
View File
@@ -0,0 +1,115 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: slskd
namespace: htpc
labels:
app.kubernetes.io/name: slskd
app.kubernetes.io/part-of: htpc
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: slskd
template:
metadata:
labels:
app: slskd
app.kubernetes.io/name: slskd
app.kubernetes.io/part-of: htpc
spec:
nodeSelector:
kubernetes.io/hostname: vmserver
initContainers:
- name: migrate-config
image: slskd/slskd:latest
imagePullPolicy: IfNotPresent
command:
- /bin/bash
- -c
- |
if [ ! -f /app/slskd.yml ] && [ -f /host-config/slskd.yml ]; then
echo "Migrating slskd config and databases from host..."
cp -a /host-config/* /app/
fi
chown -R 33:33 /app
volumeMounts:
- name: config
mountPath: /app
- name: host-config
mountPath: /host-config
readOnly: true
containers:
- name: slskd
image: slskd/slskd:latest
imagePullPolicy: IfNotPresent
env:
- name: PUID
value: "33"
- name: PGID
value: "33"
- name: SLSKD_UMASK
value: "0002"
- name: SLSKD_APP_DIR
value: "/app"
- name: SLSKD_REMOTE_CONFIGURATION
value: "true"
ports:
- name: http
containerPort: 5030
hostPort: 5030
protocol: TCP
- name: https
containerPort: 5031
hostPort: 5031
protocol: TCP
- name: slsk-listen
containerPort: 50300
hostPort: 50300
protocol: TCP
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: 2000m
memory: 2Gi
volumeMounts:
- name: config
mountPath: /app
- name: datadisk
mountPath: /datadisk
- name: mnt-mp3
mountPath: /mnt/mp3
livenessProbe:
httpGet:
path: /health
port: 5030
initialDelaySeconds: 45
periodSeconds: 20
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /health
port: 5030
initialDelaySeconds: 15
periodSeconds: 10
timeoutSeconds: 5
volumes:
- name: config
persistentVolumeClaim:
claimName: slskd-config
- name: host-config
hostPath:
path: /var/www/.local/share/slskd
type: DirectoryOrCreate
- name: datadisk
hostPath:
path: /datadisk
type: Directory
- name: mnt-mp3
hostPath:
path: /mnt/mp3
type: Directory
+7
View File
@@ -0,0 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- pvc.yaml
- service.yaml
- deployment.yaml
+15
View File
@@ -0,0 +1,15 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: slskd-config
namespace: htpc
labels:
app.kubernetes.io/name: slskd
app.kubernetes.io/part-of: htpc
spec:
accessModes:
- ReadWriteOnce
storageClassName: local-path
resources:
requests:
storage: 10Gi
+25
View File
@@ -0,0 +1,25 @@
apiVersion: v1
kind: Service
metadata:
name: slskd
namespace: htpc
labels:
app.kubernetes.io/name: slskd
app.kubernetes.io/part-of: htpc
spec:
type: ClusterIP
ports:
- port: 5030
targetPort: 5030
protocol: TCP
name: http
- port: 5031
targetPort: 5031
protocol: TCP
name: https
- port: 50300
targetPort: 50300
protocol: TCP
name: slsk-listen
selector:
app: slskd