claudeandClaude Opus 5.5 503135b852 Funkwhale on Kubernetes with Dex login and Catppuccin
Plain manifests in the listmonk role's style: PostgreSQL 17, Redis, api
(migrations in an init container), Celery worker and beat, and the
front, behind ingress-nginx with ca-issuer TLS. Dex login comes from the
funkwhale-oidc plugin, pip-installed into each pod at start-up.
files/catppuccin.css maps Funkwhale 2.x's neutral scale and colour
palettes to Latte/Mocha. Instance preferences and a break-glass admin
are converged in the database on every run. The Django key and the
DB and admin passwords are generated once and kept in the Secret, so
Vault only needs the Dex client secret.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 15:22:55 -05:00

ansible-role-funkwhale

Deploys Funkwhale 2.0.13, eom.dev's federated music and podcast server, to Kubernetes as plain manifests.

It fits in with the rest of eom.dev:

  • Login goes through Dex, using the funkwhale-oidc plugin and the same "eom.dev account" button as the other services. /login sends you straight to Dex.
    • Any account Dex lets through gets a Funkwhale account on first login, with a federation actor and libraries. The local sign-up form stays closed.
    • Users listed in funkwhale_oidc_admin_users become superusers.
    • When Dex is down, use the break-glass breakglass login at /login?local=1.
  • Look: Catppuccin Latte in light mode and Mocha in dark mode, the same palette as dex.eom.dev, listmonk and www. The neutral surfaces, every alert and tag palette, and the font come from files/catppuccin.css. Primary (mauve) and accent (lavender) come from Funkwhale's own theme-colour settings. Users can still pick light, dark or auto.
  • Mail goes out through postfix.eom.dev:587 as the LDAP account news, the same account listmonk uses.
  • Cluster conventions: ca-issuer TLS, nfs-client volumes, and anti-affinity that keeps the pods off the ingress-nginx node.

What it creates

Object Purpose
Secret/funkwhale Django key, DB password, SMTP URL, break-glass admin password, Dex client secret
ConfigMap/funkwhale Everything else, as environment variables
StatefulSet/funkwhale-db PostgreSQL 17 (alpine, uid 70)
Deployment/funkwhale-redis Cache and Celery broker; no persistence
Deployment/funkwhale-api Gunicorn. Init containers install the plugin, then run migrate and collectstatic
Deployment/funkwhale-celeryworker, -celerybeat Background jobs (imports, federation, transcoding) and their scheduler
Deployment/funkwhale-front Funkwhale's nginx and web app, with the plugin's login button and its /accounts/ route
PVC/funkwhale-{media,music,static} Uploads, in-place music library, Django static files (RWX)
Ingress/funkwhale https://funkwhale.eom.dev

Every pod that loads Funkwhale's settings runs a plugins init container. It pip-installs funkwhale_oidc_plugin_url (a tagged archive from Gitea) and PyJWT into an emptyDir, so the stock images are used unchanged.

Instance settings live in Funkwhale's database. The role writes the ones in funkwhale_preferences / funkwhale_preferences_extra on every run, using templates/configure.py.j2 run inside the API pod. That covers the name, description, sign-up, theme colours and custom CSS. The same script also creates the break-glass admin, or resets its password. Anything else stays under the admin UI's control.

Secrets

Variable Notes
funkwhale_oidc_client_secret Required. Must match the funkwhale client in Dex. Vault: funkwhale_dex_client_secret
funkwhale_smtp_password Required. Password of the news LDAP account. Vault: listmonk_smtp_password
funkwhale_django_secret_key, funkwhale_db_password, funkwhale_admin_password Optional. If empty, they are generated on the first run, stored in Secret/funkwhale and reused afterwards

To read the break-glass password:

kubectl -n funkwhale get secret funkwhale -o jsonpath='{.data.FUNKWHALE_CLI_USER_PASSWORD}' | base64 -d

One-time setup outside this role

Add the funkwhale client to Dex (ericomeehan.dex/playbooks/deploy-eom.yml) with this redirect URI, then run that play:

https://funkwhale.eom.dev/accounts/oidc/dex/login/callback/

Upgrading Funkwhale

  1. Bump funkwhale_version.
  2. Run the plugin's end-to-end test (funkwhale-oidc/tests/compose.yaml) against the new version.
  3. Check that the theme still applies. It overrides the --color-default-* and --fw-* variables from front/src/ui/fw.css.

Never change funkwhale_host after the first deploy. Every federated object carries it.

Testing

ansible-playbook -i tests/inventory tests/render.yml   # renders into .render/

To validate against the cluster without changing anything, pipe the rendered manifests into kubectl apply --dry-run=server -f -.

License

MIT-0

S
Description
Ansible role to deploy Funkwhale to Kubernetes
Readme MIT-0
114 KiB
Languages
CSS 52.6%
Jinja 40.5%
Python 4.1%
Shell 2.3%
JavaScript 0.5%