Merge branch 'music-assistant'
commit
e0e3eab8b6
|
@ -0,0 +1,20 @@
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: music-assistant
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: music-assistant
|
||||||
|
app.kubernetes.io/component: music-assistant
|
||||||
|
spec:
|
||||||
|
ingressClassName: nginx
|
||||||
|
rules:
|
||||||
|
- host: music.pyrocufflink.blue
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: music-assistant
|
||||||
|
port:
|
||||||
|
name: http
|
|
@ -0,0 +1,40 @@
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
|
||||||
|
namespace: music-assistant
|
||||||
|
|
||||||
|
labels:
|
||||||
|
- pairs:
|
||||||
|
app.kubernetes.io/instance: music-assistant
|
||||||
|
includeSelectors: true
|
||||||
|
- pairs:
|
||||||
|
app.kubernetes.io/part-of: music-assistant
|
||||||
|
includeTemplates: true
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- namespace.yaml
|
||||||
|
- music-assistant.yaml
|
||||||
|
- ingress.yaml
|
||||||
|
|
||||||
|
patches:
|
||||||
|
- patch: |
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
name: music-assistant
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: music-assistant
|
||||||
|
lifecycle:
|
||||||
|
postStart:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- wget
|
||||||
|
- -qO-
|
||||||
|
- http://ntfy.ntfy:2586/0e386416-ac43-488c-b709-efac8e2555a3/publish?message=restart
|
||||||
|
|
||||||
|
images:
|
||||||
|
- name: ghcr.io/music-assistant/server
|
||||||
|
newTag: 2.6.0b18
|
|
@ -0,0 +1,78 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: music-assistant
|
||||||
|
labels: &labels
|
||||||
|
app.kubernetes.io/name: music-assistant
|
||||||
|
app.kubernetes.io/component: music-assistant
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 1Gi
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: music-assistant
|
||||||
|
labels: &labels
|
||||||
|
app.kubernetes.io/name: music-assistant
|
||||||
|
app.kubernetes.io/component: music-assistant
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- port: 8095
|
||||||
|
name: http
|
||||||
|
selector: *labels
|
||||||
|
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: StatefulSet
|
||||||
|
metadata:
|
||||||
|
name: music-assistant
|
||||||
|
labels: &labels
|
||||||
|
app.kubernetes.io/name: music-assistant
|
||||||
|
app.kubernetes.io/component: music-assistant
|
||||||
|
spec:
|
||||||
|
serviceName: music-assistant
|
||||||
|
selector:
|
||||||
|
matchLabels: *labels
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels: *labels
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: music-assistant
|
||||||
|
image: ghcr.io/music-assistant/server
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
ports:
|
||||||
|
- containerPort: 8095
|
||||||
|
name: http
|
||||||
|
readinessProbe: &probe
|
||||||
|
httpGet:
|
||||||
|
port: http
|
||||||
|
path: /
|
||||||
|
failureThreshold: 3
|
||||||
|
periodSeconds: 60
|
||||||
|
successThreshold: 1
|
||||||
|
timeoutSeconds: 1
|
||||||
|
startupProbe:
|
||||||
|
<<: *probe
|
||||||
|
failureThreshold: 90
|
||||||
|
periodSeconds: 1
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: /data
|
||||||
|
name: music-assistant-data
|
||||||
|
subPath: data
|
||||||
|
dnsPolicy: ClusterFirstWithHostNet
|
||||||
|
hostNetwork: true
|
||||||
|
securityContext:
|
||||||
|
runAsNonRoot: true
|
||||||
|
runAsUser: 8095
|
||||||
|
runAsGroup: 8095
|
||||||
|
fsGroup: 8095
|
||||||
|
volumes:
|
||||||
|
- name: music-assistant-data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: music-assistant
|
|
@ -0,0 +1,6 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: music-assistant
|
||||||
|
labels:
|
||||||
|
app.kubernetes.io/name: music-assistant
|
|
@ -0,0 +1,22 @@
|
||||||
|
# vim: set ft=systemd :
|
||||||
|
|
||||||
|
# In order for this to be effective, `shairport-sync.service` needs a
|
||||||
|
# configuration override to enable auto-restart, e.g.:
|
||||||
|
#
|
||||||
|
# [Service]
|
||||||
|
# Restart=always
|
||||||
|
# RestartSec=1
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Description=Restart shairport-sync when music-assistant restarts
|
||||||
|
Wants=network-online.target
|
||||||
|
After=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
ExecStart=/usr/local/libexec/restart-sync.sh
|
||||||
|
Restart=always
|
||||||
|
RestartSec=1
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=shairport-sync.service
|
|
@ -0,0 +1,15 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
TOPIC=0e386416-ac43-488c-b709-efac8e2555a3
|
||||||
|
NTFY=https://ntfy.pyrocufflink.net
|
||||||
|
DELAY=10
|
||||||
|
|
||||||
|
url=$(printf '%s/%s/raw' "${NTFY}" "${TOPIC}")
|
||||||
|
|
||||||
|
curl -sN "${url}" \
|
||||||
|
| stdbuf -o0 grep restart \
|
||||||
|
| while read l; do
|
||||||
|
printf 'Restarting shairport-sync in %d seconds\n' "$DELAY" >&2
|
||||||
|
sleep $DELAY
|
||||||
|
busctl call org.gnome.ShairportSync /org/gnome/ShairportSync org.gnome.ShairportSync Quit
|
||||||
|
done
|
Loading…
Reference in New Issue