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 startupProbe: httpGet: path: /health port: 5030 failureThreshold: 240 periodSeconds: 10 timeoutSeconds: 5 livenessProbe: httpGet: path: /health port: 5030 initialDelaySeconds: 30 periodSeconds: 20 timeoutSeconds: 5 readinessProbe: httpGet: path: /health port: 5030 initialDelaySeconds: 10 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