refine snapcast deployment so piping between containers works

This commit is contained in:
2025-12-20 18:02:07 +01:00
parent 8c7b532a31
commit 7f3b3ff48e
4 changed files with 38 additions and 22 deletions

7
apps/snapcast/README.md Normal file
View File

@@ -0,0 +1,7 @@
### Credentials
Since this tries to run in an isolated network we can't rely on autodiscover and the spotify client needs to be tied to an account.
This is achieved by registering the client on startup via oauth. The logs show an url which should be copied to a local browser. The successfull redirect needs to be forwarded back to the client, hence run:
```
k port-forward deployments/snapcast 5588:5588
```

View File

@@ -51,9 +51,20 @@ spec:
- name: TZ - name: TZ
value: Europe/Berlin value: Europe/Berlin
- name: AIRPLAY_CONFIG_ENABLED - name: AIRPLAY_CONFIG_ENABLED
value: "0" value: "1"
- name: SPOTIFY_CONFIG_ENABLED - name: SPOTIFY_CONFIG_ENABLED
value: "0" value: "0"
- name: PIPE_CONFIG_ENABLED
value: "1"
- name: PIPE_PATH
value: /mnt/pipe/spotipipe
- name: PIPE_SOURCE_NAME
value: "Librespot"
# - name: PIPE_MODE
# value: "read"
- name: PIPE_EXTRA_ARGS
# see https://github.com/badaix/snapcast/issues/1248
value: "&sampleformat=44100:16:2"
volumeMounts: volumeMounts:
- name: pipe - name: pipe
mountPath: /mnt/pipe mountPath: /mnt/pipe
@@ -68,34 +79,31 @@ spec:
requests: requests:
memory: "128Mi" memory: "128Mi"
cpu: "250m" cpu: "250m"
# ports: ports:
- containerPort: 5588 # default port for oauth callback
env: env:
- name: BACKEND - name: BACKEND
value: pipe value: pipe
- name: DEVICE - name: DEVICE
value: /mnt/pipe/spotipipe value: /mnt/pipe/spotipipe
- name: DISABLE_DISCOVERY
value: Y
- name: AUTOPLAY
value: Y
# - name: VERBOSE
# value: Y
# - name: PASSTHROUGH
# value: Y
- name: ADDITIONAL_ARGUMENTS
value: "--enable-oauth --cache /cache"
volumeMounts: volumeMounts:
- name: pipe - name: pipe
mountPath: /mnt/pipe mountPath: /mnt/pipe
- name: credentials-cache
mountPath: /cache
volumes: volumes:
- name: pipe - name: pipe
emptyDir: {} emptyDir: {}
- name: credentials-cache
persistentVolumeClaim:
# - name: SPOTIFY_ACCESS_TOKEN claimName: cache
# value: BQBxGPPPXZTXF7WTBzJItu3KNkeoZu2j2-Rlk1RmtnmXvzPh1fWFpOT2VeXwWxMJXlBYwxSOTo1ZKk3hAr08OhDhbQChi6KDl6qEmK-Y8Wq8g3EoP7M-oRnHt4WFMg1zC1C37t90nQUKZ-F9UdSuL9A6Ny6V6pYsai1bUspOU0q5UHn6-Dv9E8gwEKXOPMlBKEXNi1D0sT2m9rzwI7UK1g7ToRPn03eqGe41RRvlfrSCgf41tg
# - name: SPOTIFY_EXTRA_ARGS
# value: " --disable-discovery --access-token BQBxGPPPXZTXF7WTBzJItu3KNkeoZu2j2-Rlk1RmtnmXvzPh1fWFpOT2VeXwWxMJXlBYwxSOTo1ZKk3hAr08OhDhbQChi6KDl6qEmK-Y8Wq8g3EoP7M-oRnHt4WFMg1zC1C37t90nQUKZ-F9UdSuL9A6Ny6V6pYsai1bUspOU0q5UHn6-Dv9E8gwEKXOPMlBKEXNi1D0sT2m9rzwI7UK1g7ToRPn03eqGe41RRvlfrSCgf41tg"
# volumeMounts:
# - name: config
# mountPath: /config
# - name: snapserver-config
# mountPath: /root/.config/
# volumes:
# - name: config
# secret:
# secretName: snapcast-config
# - name: snapserver-config
# emptyDir: {}

View File

@@ -7,6 +7,7 @@ resources:
- namespace.yaml - namespace.yaml
- deployment.yaml - deployment.yaml
- service.yaml - service.yaml
- pvc.yaml
- snapcast-config.secret.yaml - snapcast-config.secret.yaml
images: images:

View File

@@ -1,7 +1,7 @@
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
apiVersion: v1 apiVersion: v1
metadata: metadata:
name: data name: cache
spec: spec:
storageClassName: "nfs-client" storageClassName: "nfs-client"
accessModes: accessModes: