Files
bart c05308417e
Sync HTPC Manifests to GitOps / Sync Manifests to GitOps Repo (push) Successful in 6s
feat: Separate Icecast streaming server into standalone deployment with standby fallbacks
2026-11-07 12:50:49 +01:00

178 lines
5.6 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: radio-chicken
namespace: htpc
labels:
app.kubernetes.io/name: radio-chicken
app.kubernetes.io/part-of: htpc
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: radio-chicken
template:
metadata:
labels:
app: radio-chicken
app.kubernetes.io/name: radio-chicken
app.kubernetes.io/part-of: htpc
spec:
nodeSelector:
kubernetes.io/hostname: vmserver
initContainers:
- name: migrate-data
image: alpine:3.20
imagePullPolicy: IfNotPresent
command:
- /bin/sh
- -c
- |
echo "Checking and preparing directories for Radio Chicken..."
mkdir -p /data/data /data/webroot
if [ ! -f /data/data/settings.json ] && [ -f /host-radio/data/settings.json ]; then
echo "Syncing Radio Chicken data and cache from host (/home/bart/jellyfinradio/data)..."
cp -a /host-radio/data/* /data/data/ || true
fi
if [ ! -f /data/webroot/standby.ogg ] && [ -d /host-radio/webroot ]; then
echo "Syncing standby media files from host (/home/bart/jellyfinradio/webroot)..."
cp -a /host-radio/webroot/* /data/webroot/ || true
fi
chmod -R 777 /data
echo "Init container completed successfully."
volumeMounts:
- name: data
mountPath: /data
- name: host-radio
mountPath: /host-radio
readOnly: true
containers:
# Container: Radio Chicken Web Application & Audio/Video Streamer
- name: radio-chicken
image: git.bnhmeijer.nl/bart/radio-chicken:latest
imagePullPolicy: Always
securityContext:
privileged: true
env:
- name: JELLYFIN_URL
value: "http://jellyfin:8096/jellyfin"
- name: JELLYFIN_API_KEY
value: "c58f4b427eaf475aafd86abd87f139af"
- name: JELLYFIN_USER_ID
value: "40a220e1e05e4a4395c9b0c6569f6e82"
- name: ICECAST_URL
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
value: "/dev/dri/renderD128"
ports:
- name: web
containerPort: 5000
hostPort: 5000
protocol: TCP
resources:
requests:
cpu: 200m
memory: 1Gi
limits:
cpu: 4000m
memory: 6Gi
volumeMounts:
- name: data
mountPath: /app/data
subPath: data
- name: music-videos
mountPath: /music_videos
- name: dri
mountPath: /dev/dri
livenessProbe:
httpGet:
path: /live
port: 5000
initialDelaySeconds: 45
periodSeconds: 20
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /live
port: 5000
initialDelaySeconds: 20
periodSeconds: 10
timeoutSeconds: 5
# Container 3: Radio Chicken Autoplacer Worker
- name: autoplacer
image: git.bnhmeijer.nl/bart/radio-chicken-autoplacer:latest
imagePullPolicy: IfNotPresent
env:
- name: JELLYFIN_URL
value: "http://jellyfin:8096/jellyfin"
- name: JELLYFIN_API_KEY
value: "c58f4b427eaf475aafd86abd87f139af"
- name: JELLYFIN_USER_ID
value: "40a220e1e05e4a4395c9b0c6569f6e82"
- name: CHECK_INTERVAL_SECONDS
value: "60"
- name: PROCESS_DELAY_SECONDS
value: "3"
resources:
requests:
cpu: 50m
memory: 256Mi
limits:
cpu: 1000m
memory: 2Gi
# Container 4: Radio Chicken Music Video Downloader Worker
- name: mv-downloader
image: git.bnhmeijer.nl/bart/radio-chicken-mv-downloader:latest
imagePullPolicy: IfNotPresent
env:
- name: JELLYFIN_URL
value: "http://jellyfin:8096/jellyfin"
- name: JELLYFIN_API_KEY
value: "c58f4b427eaf475aafd86abd87f139af"
- name: JELLYFIN_USER_ID
value: "40a220e1e05e4a4395c9b0c6569f6e82"
- name: MUSIC_VIDEOS_DIR
value: "/music_videos"
- name: CHECK_INTERVAL_SECONDS
value: "3600"
- name: PROCESS_DELAY_SECONDS
value: "3"
resources:
requests:
cpu: 50m
memory: 256Mi
limits:
cpu: 2000m
memory: 2Gi
volumeMounts:
- name: music-videos
mountPath: /music_videos
volumes:
- name: data
persistentVolumeClaim:
claimName: radio-chicken-data
- name: music-videos
hostPath:
path: /datadisk/htpc/music_video
type: Directory
- name: dri
hostPath:
path: /dev/dri
type: Directory
- name: host-radio
hostPath:
path: /home/bart/jellyfinradio
type: DirectoryOrCreate