From c05308417e6091417a69f114f30e3654c8581dab Mon Sep 17 00:00:00 2001 From: bart Date: Sat, 7 Nov 2026 12:50:49 +0100 Subject: [PATCH] feat: Separate Icecast streaming server into standalone deployment with standby fallbacks --- k8s/radio-chicken/deployment-icecast.yaml | 102 ++++++++++++++++++++++ k8s/radio-chicken/deployment.yaml | 60 +------------ k8s/radio-chicken/kustomization.yaml | 1 + k8s/radio-chicken/service.yaml | 4 - 4 files changed, 107 insertions(+), 60 deletions(-) create mode 100644 k8s/radio-chicken/deployment-icecast.yaml diff --git a/k8s/radio-chicken/deployment-icecast.yaml b/k8s/radio-chicken/deployment-icecast.yaml new file mode 100644 index 0000000..7a10001 --- /dev/null +++ b/k8s/radio-chicken/deployment-icecast.yaml @@ -0,0 +1,102 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: radio-chicken-icecast + namespace: htpc + labels: + app: radio-chicken-icecast + app.kubernetes.io/name: radio-chicken-icecast + app.kubernetes.io/part-of: htpc +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app: radio-chicken-icecast + template: + metadata: + labels: + app: radio-chicken-icecast + app.kubernetes.io/name: radio-chicken-icecast + app.kubernetes.io/part-of: htpc + spec: + nodeSelector: + kubernetes.io/hostname: vmserver + containers: + - name: icecast + image: moul/icecast:latest + imagePullPolicy: IfNotPresent + env: + - name: ICECAST_SOURCE_PASSWORD + value: "hackme" + - name: ICECAST_ADMIN_PASSWORD + value: "hackme" + - name: ICECAST_PASSWORD + value: "hackme" + ports: + - name: icecast + containerPort: 8000 + hostPort: 8000 + protocol: TCP + resources: + requests: + cpu: 50m + memory: 64Mi + limits: + cpu: 500m + memory: 512Mi + volumeMounts: + - name: icecast-config + mountPath: /etc/icecast2/icecast.xml + subPath: icecast.xml + - name: standby-media + mountPath: /usr/share/icecast2/web/standby.ogg + subPath: standby.ogg + - name: standby-media + mountPath: /usr/share/icecast2/web/standby.mp3 + subPath: standby.mp3 + - name: standby-media + mountPath: /usr/share/icecast2/web/standby_video.webm + subPath: standby_video.webm + livenessProbe: + httpGet: + path: /status-json.xsl + port: 8000 + initialDelaySeconds: 15 + periodSeconds: 20 + timeoutSeconds: 5 + readinessProbe: + httpGet: + path: /status-json.xsl + port: 8000 + initialDelaySeconds: 5 + periodSeconds: 10 + timeoutSeconds: 5 + volumes: + - name: icecast-config + configMap: + name: radio-chicken-icecast-config + - name: standby-media + hostPath: + path: /home/bart/jellyfinradio/webroot + type: Directory +--- +apiVersion: v1 +kind: Service +metadata: + name: radio-chicken-icecast + namespace: htpc + labels: + app: radio-chicken-icecast + app.kubernetes.io/name: radio-chicken-icecast + app.kubernetes.io/part-of: htpc +spec: + type: ClusterIP + selector: + app: radio-chicken-icecast + ports: + - name: http-icecast + port: 8000 + targetPort: 8000 + protocol: TCP diff --git a/k8s/radio-chicken/deployment.yaml b/k8s/radio-chicken/deployment.yaml index c528525..355d5df 100644 --- a/k8s/radio-chicken/deployment.yaml +++ b/k8s/radio-chicken/deployment.yaml @@ -52,58 +52,7 @@ spec: mountPath: /host-radio readOnly: true containers: - # Container 1: Icecast Audio & Video Streaming Server - - name: icecast - image: moul/icecast:latest - imagePullPolicy: IfNotPresent - env: - - name: ICECAST_SOURCE_PASSWORD - value: "hackme" - - name: ICECAST_ADMIN_PASSWORD - value: "hackme" - - name: ICECAST_PASSWORD - value: "hackme" - ports: - - name: icecast - containerPort: 8000 - hostPort: 8000 - protocol: TCP - resources: - requests: - cpu: 50m - memory: 64Mi - limits: - cpu: 500m - memory: 512Mi - volumeMounts: - - name: icecast-config - mountPath: /etc/icecast2/icecast.xml - subPath: icecast.xml - - name: data - mountPath: /usr/share/icecast2/web/standby.ogg - subPath: webroot/standby.ogg - - name: data - mountPath: /usr/share/icecast2/web/standby.mp3 - subPath: webroot/standby.mp3 - - name: data - mountPath: /usr/share/icecast2/web/standby_video.webm - subPath: webroot/standby_video.webm - livenessProbe: - httpGet: - path: /status-json.xsl - port: 8000 - initialDelaySeconds: 15 - periodSeconds: 20 - timeoutSeconds: 5 - readinessProbe: - httpGet: - path: /status-json.xsl - port: 8000 - initialDelaySeconds: 5 - periodSeconds: 10 - timeoutSeconds: 5 - - # Container 2: Radio Chicken Web Application & Audio/Video Streamer + # Container: Radio Chicken Web Application & Audio/Video Streamer - name: radio-chicken image: git.bnhmeijer.nl/bart/radio-chicken:latest imagePullPolicy: Always @@ -117,7 +66,9 @@ spec: - name: JELLYFIN_USER_ID value: "40a220e1e05e4a4395c9b0c6569f6e82" - name: ICECAST_URL - value: "icecast://source:hackme@127.0.0.1:8000/chicken" + value: "icecast://source:hackme@radio-chicken-icecast:8000/chicken" + - name: ICECAST_STATUS_URL + value: "http://radio-chicken-icecast:8000/status-json.xsl" - name: VIDEO_ENCODER value: "h264_vaapi" - name: VAAPI_DEVICE @@ -212,9 +163,6 @@ spec: - name: data persistentVolumeClaim: claimName: radio-chicken-data - - name: icecast-config - configMap: - name: radio-chicken-icecast-config - name: music-videos hostPath: path: /datadisk/htpc/music_video diff --git a/k8s/radio-chicken/kustomization.yaml b/k8s/radio-chicken/kustomization.yaml index e7bbfd8..4af23fa 100644 --- a/k8s/radio-chicken/kustomization.yaml +++ b/k8s/radio-chicken/kustomization.yaml @@ -5,4 +5,5 @@ resources: - configmap.yaml - pvc.yaml - service.yaml + - deployment-icecast.yaml - deployment.yaml diff --git a/k8s/radio-chicken/service.yaml b/k8s/radio-chicken/service.yaml index d600ee0..2d888e0 100644 --- a/k8s/radio-chicken/service.yaml +++ b/k8s/radio-chicken/service.yaml @@ -15,7 +15,3 @@ spec: port: 5000 targetPort: 5000 protocol: TCP - - name: http-icecast - port: 8000 - targetPort: 8000 - protocol: TCP