music-assistant

by benji

Helm chartv0.2.0App 2.10.6Verified publisher

Music Assistant server - a music library manager that connects your streaming services to a wide range of connected speakers (Chromecast/Google Cast, AirPlay, Sonos, DLNA, Squeezebox, ...)

About this chart

music-assistant

Music Assistant server - a music library manager that connects your streaming services to a wide range of connected speakers (Chromecast/Google Cast, AirPlay, Sonos, DLNA, Squeezebox, ...)

This chart installs the Music Assistant server on Kubernetes. Upstream only supports running it as a standalone, host-networked container; this chart keeps that model (one host-networked pod) and adds the Kubernetes pieces around it: a Service, an optional Ingress/HTTPRoute, persistence, and probes.

Networking

The pod runs with hostNetwork: true by default, and that's required for normal use, for two reasons:

  • Player discovery (Chromecast/Google Cast, AirPlay, Sonos, DLNA, ...) is mDNS/SSDP multicast on the LAN, which doesn't cross pod networking.
  • Streaming is pull-based. Music Assistant hands each speaker a URL on its own LAN address and the streamserver port (8097 by default), and the speaker fetches the audio from there.

Consequences:

  • Ports 8095 (web UI/API) and 8097 (stream) are bound on the node. They must be free on every node the pod can be scheduled on. Use nodeSelector/affinity to restrict that set if needed.
  • If the pod moves to another node, Music Assistant picks up the new node's address by itself. Playback in progress at that moment stops, and speakers are rediscovered within a few seconds.
  • dnsPolicy defaults to ClusterFirstWithHostNet, so the server can still resolve in-cluster Service names (e.g. Home Assistant's).

A ClusterIP Service is always created for port 8095. It's the stable address for in-cluster clients and the backend for the Ingress/HTTPRoute. Speakers don't use it.

Connecting Home Assistant

Add the Music Assistant integration in Home Assistant and point it at the Service:

http://<release-fullname>.<namespace>.svc.cluster.local:8095

If Home Assistant itself runs with hostNetwork: true, it needs dnsPolicy: ClusterFirstWithHostNet to resolve that name. Music Assistant 2.7+ requires authentication; the integration's config flow takes care of logging in.

Web UI behind an Ingress / HTTPRoute

The UI keeps a long-lived WebSocket open to /ws. With ingress-nginx, raise the proxy timeouts so idle sessions aren't cut every 60s:

ingress:
  annotations:
    nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
    nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"

Note that with host networking, port 8095 is also reachable directly on the node's address regardless of the Ingress, so an Ingress-level IP allowlist doesn't restrict it. Music Assistant's own login does.

Persistence

/data holds the library database, provider logins (e.g. Spotify), and all settings, plus the artwork/metadata cache under /data/.cache. It's enabled by default and kept on uninstall (persistence.data.skipuninstall). Music Assistant uses SQLite, so block storage is preferable to NFS where you have the choice.

For a local music library, enable persistence.media with either an existing PVC or an NFS export. It's mounted read-only at /media and used through the Filesystem (local disk) provider. Mounting SMB/NFS shares from inside Music Assistant instead requires extra capabilities. See securityContext in the values below.

Upgrades

Pin image.tag (or rely on the chart's appVersion) rather than latest, so a pod restart never upgrades the server unexpectedly. Don't switch an existing install between the stable and beta image channels: upstream doesn't support moving a database between them.

Installing the Chart

This chart is published two ways: as a classic Helm repo via GitHub Pages (releases only), and as an OCI artifact via the GitHub Container Registry (releases and alpha builds).

Via the classic repo:

$ helm repo add newbenji-charts https://newbenji.github.io/charts/
$ helm repo update
$ helm install my-release newbenji-charts/music-assistant --version 0.2.0

Via OCI:

$ helm install my-release oci://ghcr.io/newbenji/charts/music-assistant --version 0.2.0

To just download the chart package:

$ helm pull oci://ghcr.io/newbenji/charts/music-assistant --version 0.2.0

Maintainers

NameEmailUrl
newbenji[email protected]

Source Code

Values

KeyTypeDefaultDescription
affinityobject{}Set Pod affinity rules
commonAnnotationsobject{}Annotations added to every resource the chart creates
commonLabelsobject{}Labels added to every resource the chart creates
deploymentAnnotationsobject{}Annotations to add to the Deployment
dnsPolicystring""DNS policy for the pod. ClusterFirstWithHostNet keeps cluster DNS (Service names) resolvable while on the host network; plain ClusterFirst silently falls back to the node's resolv.conf when hostNetwork is on. Leave empty to use ClusterFirstWithHostNet with hostNetwork and ClusterFirst without
envobject{}Additional environment variables, as a name/value map
envFromSecretslist[]Set environment variables from Secret(s)
extraContainerslist[]Sidecar containers to run next to Music Assistant (rendered with tpl), e.g. a snapserver or a backup agent
extraEnvlist[]Additional environment variables in full Kubernetes EnvVar form (e.g. for valueFrom)
extraManifestslist[]Extra Kubernetes manifests to deploy with the release (list or map of objects or YAML strings, rendered with tpl), e.g. an ExternalSecret or a backup schedule for the /data PVC
extraVolumeMountslist[]Additional volume mounts to add to the container
extraVolumeslist[]Additional volumes to add to the pod
fullnameOverridestring""Overrides the Full Name of resources
hostAliaseslist[]Extra /etc/hosts entries for the pod, e.g. to reach a NAS or speaker by a name your DNS doesn't serve
hostNetworkbooltrueRun the pod in the node's network namespace. Upstream only supports host (or macvlan) networking: player discovery (mDNS/SSDP for Chromecast, AirPlay, Sonos, DLNA, ...) is multicast and the speakers pull audio back from the server's own LAN address, neither of which works through pod networking. Only turn this off if you attach the pod to the LAN another way (e.g. Multus/macvlan via podAnnotations)
httpRoute.annotationsobject{}Annotations to add to the HTTPRoute
httpRoute.enabledboolfalseExpose the web UI via a Gateway API HTTPRoute instead of an Ingress. Requires the Gateway API CRDs and a Gateway to already exist in the cluster. Mutually exclusive with ingress.enabled
httpRoute.hostnameslist[]Hostnames the route matches. Leave empty to match all hostnames on the parent Gateway listener(s)
httpRoute.labelsobject{}Additional labels to add to the HTTPRoute
httpRoute.matcheslist[{"path":"/","pathType":"PathPrefix"}]Path matches routed to the web UI Service
httpRoute.parentRefslist[{"name":""}]References to the Gateway(s) this route attaches to
image.digeststring""Pin the image by digest (e.g. sha256:...). When set, it's used in addition to the tag (repo:tag@digest), so the tag stays readable but can't be silently re-pointed
image.pullPolicystring"IfNotPresent"Docker image pull policy
image.repositorystring"ghcr.io/music-assistant/server"Docker registry/repository to pull the image from
image.tagstring""Overrides the default tag (appVersion) used in Chart.yaml. Defaults to the chart's appVersion (2.10.6) when left empty. Don't switch an existing install between the stable and beta channels by changing the tag - upstream doesn't support moving a database between channels. See available tags at https://github.com/music-assistant/server/pkgs/container/server
imagePullSecretslist[]Docker image pull secrets
ingress.annotationsobject{}annotations to configure your Ingress. See your Ingress Controller's Docs for more info.
ingress.classNamestring""ingressClassName for using on clusters with multiple ingresses, default is null
ingress.enabledboolfalseEnables the use of an Ingress Controller to front the web UI and can provide HTTPS. Mutually exclusive with httpRoute.enabled. The UI uses a long-lived WebSocket (/ws), so raise your controller's proxy read/send timeouts (e.g. nginx.ingress.kubernetes.io/proxy-read-timeout: "3600")
ingress.hostslist[{"host":"chart-example.local","paths":[{"path":"/","pathType":"ImplementationSpecific"}]}]list of hosts and their paths that the ingress controller should respond to. Each path may also set pathType (defaults to ImplementationSpecific when unset)
ingress.tlslist[]list of TLS configurations
initContainerslist[]Init containers to run before Music Assistant starts (rendered with tpl)
lifecycleobject{}Lifecycle hooks for the Music Assistant container
logLevelstring"info"Log level passed as LOG_LEVEL (critical, error, warning, info, debug)
nameOverridestring""Overrides the name of resources
networkPolicy.allowSameNamespacebooltrueAllow incoming traffic from all pods in the release namespace
networkPolicy.enabledboolfalseCreate a NetworkPolicy that blocks incoming traffic to the Music Assistant pod, except what is allowed below. Outgoing traffic is not restricted. Traffic from an Ingress controller or a Gateway in another namespace must be allowed in ingress. With Cilium's Gateway API, Envoy uses the reserved identity "ingress", which a NetworkPolicy cannot match: allow it with a CiliumClusterwideNetworkPolicy (fromEntities: [ingress]) instead. Kubelet probes from the node are allowed by most CNIs (Cilium always allows the local node).
networkPolicy.ingresslist[]More NetworkPolicy ingress rules, added as-is, e.g. [{from: [{namespaceSelector: {matchLabels: {kubernetes.io/metadata.name: monitoring}}}], ports: [{port: 8123, protocol: TCP}]}]
nodeSelectorobject{}Node Selector configuration
persistence.data.accessModestring"ReadWriteOnce"access mode to use for the PVC
persistence.data.annotationsobject{}Annotations to add to the PVC, e.g. for a backup tool
persistence.data.enabledbooltrueEnables persistence for /data, which holds the library database, provider logins (e.g. Spotify), player and core settings. Without it, everything is lost whenever the pod restarts. Strongly recommended. Music Assistant keeps SQLite databases here, so prefer block storage (iSCSI, Longhorn, local) over NFS where you can
persistence.data.existingClaimstring""Use an existing PVC instead of creating one
persistence.data.sizestring"2Gi"size/capacity of the PVC. Artwork/metadata cache lives here too (/data/.cache), so large libraries need more
persistence.data.skipuninstallbooltrueKeep the PVC when the release is uninstalled (sets helm.sh/resource-policy: keep)
persistence.data.storageClassstring""storageClassName for the PVC. Leave empty to use the cluster default, - to disable dynamic provisioning
persistence.media.enabledboolfalseMount a local music library at /media, for the Filesystem (local disk) music provider
persistence.media.existingClaimstring""Existing PVC to mount. Takes precedence over nfs
persistence.media.mountPathstring"/media"Path the library is mounted at inside the container
persistence.media.nfsobject{}Mount an NFS export directly instead of a PVC, e.g. {server: nas.lan, path: /volume1/music}
persistence.media.readOnlybooltrueMount the library read-only, as upstream recommends
podAnnotationsobject{}Set additional pod annotations
podLabelsobject{}Set additional pod labels
podSecurityContextobject{}Set Pod level Security Context. The container level security context defined below will override it
ports.streamint8097Port the built-in streamserver listens on, which players pull audio from. Configured in the Music Assistant UI (Settings > Core > Streamserver), not by this chart - this value only documents/exposes it. With hostNetwork this port must be free on every node the pod can be scheduled on (Music Assistant moves on to the next free port if it isn't)
ports.webint8095Port the web UI/API listens on. Music Assistant always binds 8095; only change this if you've changed it upstream too. With hostNetwork this port must be free on every node the pod can be scheduled on
priorityClassNamestring""Priority class name for the pod
probes.livenessobject{"failureThreshold":3,"httpGet":{"path":"/info","port":"http"},"periodSeconds":30,"timeoutSeconds":10}Liveness probe
probes.readinessobject{"failureThreshold":3,"httpGet":{"path":"/info","port":"http"},"periodSeconds":10,"timeoutSeconds":5}Readiness probe
probes.startupobject{"failureThreshold":30,"httpGet":{"path":"/info","port":"http"},"periodSeconds":10,"timeoutSeconds":5}Startup probe. Music Assistant loads all providers before its webserver answers, which can take a while on first start or with large libraries, so this allows up to 5 minutes. P

Deploy music-assistant with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has music-assistant on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartmusic-assistant is pinned at v0.2.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply